Switchboard
Switchboard provides a trusted execution environment to ensure off-chain oracles are not tempered with.It also allows for developers to deploy custom oracles.
Interface
Structs
struct AggregatorKey has copy, drop, store {}A dynamic field key to store the address of the switchboard::aggregator::Aggregator that can that provide data to the oracle.
struct SwitchboardFeed has drop {}A witness that is added to the suitears::oracle::Request to prove that it collected data from Coin X Oracle's Pyth Network module.
Functions
report
It requests a price from Pyth Network and submits the information to a Coin X oracle request.
public fun report<Witness: drop>(oracle: &Oracle<Witness>, request: &mut Request, aggregator: &Aggregator)@param self. A
suiterars::oracle::Oraclewith this module's witness.@param request. A hot potato issued from the
selfto create asuiterars::oracle::Price.@param aggregator.
switchboard::aggregator::Aggregatorthat theselfwill use to fetch the price.
Aborts
the
aggregatoris not whitelisted.the
aggregatorprice is negative or zero.
Last updated
Was this helpful?