Oracles
Sujiko has a unique oracle architecture powered by Switchboard and Pyth.
Price data for collections is generated off-chain and published on-chain; Moreover, each market includes buffers storing historical data for 1hr TWAP, 5min TWAP and oracle price. Additionally, there are multiple validation checks to ensure oracle data is not stale or invalid (stale/invalid data can introduce bad data and risk to the protocol).
Sujiko uses an ETL pipeline where we:
- pull on-chain data from top NFT marketplaces
- tag and map on-chain data to a common format to be used in processing
- filter data using a band-pass filter (extremely high- or low-priced sales can manipulate the price feed)
- compute higher-order quantiles to establish a smart floor price to introduce some price robustness
- look at a rolling window of historical data (this ensures that we have a sufficiently large sample size to produce a higher confidence statistic and to ensure that blips in sales data do not have a disproportionate impact on published oracle data)
In order to prevent incorrect price data, Sujiko implements a number of oracle validation criteria.
Criteria include detection for:
- stale oracle date (not updated within 30 seconds)
- invalid price data (such as a negative value, i.e. -120)
- unexpectedly volatile conditions (price is outside of expected bands β 1hr and 5m TWAP)
- uncertain data (confidence interval is larger than pre-defined threshold set on market initialisation)
Action that could increase protocol risk β such as particular fills, withdrawals, funding rate payments, and liquidations β need to pass the oracle validation criteria. If the criteria is not met, actions will be blocked.