đŸ’ŊOracle Interface

Oracle Integration Guide for Developers

To ensure accurate and up-to-date price information for your operations, you can trigger a manual price update using the oracle::oracle_pro::update_single_price function. This must be integrated into a PTB (Programmable Transaction Block) before invoking any functions from lending_core.


Oracle Interface Example

moveCopy codemodule oracle::oracle_pro {
    use sui::clock::{Clock};
    use oracle::oracle_provider::{OracleProviderConfig};
    use oracle::oracle::{PriceOracle};
    use oracle::config::{OracleConfig};
    use SupraOracle::SupraSValueFeed::{OracleHolder};
    use pyth::price_info::{PriceInfoObject};

    native public fun update_single_price(
        clock: &Clock, 
        oracle_config: &mut OracleConfig, 
        price_oracle: &mut PriceOracle, 
        supra_oracle_holder: &OracleHolder, 
        pyth_price_info: &PriceInfoObject, 
        feed_address: address
    );

    native public fun get_price_from_adaptor(
        oracle_provider_config: &OracleProviderConfig, 
        target_decimal: u8, 
        supra_oracle_holder: &OracleHolder, 
        pyth_price_info: &PriceInfoObject
    ): (u256, u64);
}

Example: Triggering a Price Update

typescriptCopy codethis.txb.moveCall({
    target: `${oracle.PackageId}::oracle_pro::update_single_price`,
    arguments: [
        this.txb.object('0x6'),
        this.txb.object(oracle.OracleConfig),
        this.txb.object(oracle.PriceOracle),
        this.txb.object(oracle.SupraOracleHolder),
        this.txb.object(asset.pythPriceInfoObject),
        this.txb.pure(asset.feedAddress),
    ],
});

Sample Transaction

View Transaction


Oracle Configuration

Below is the configuration data for different tokens:


OracleProConfig = {
    PackageId: '0xc2d49bf5e75d2258ee5563efa527feb6155de7ac6f6bf025a23ee88cd12d5a83', 
    PriceOracle: '0x1568865ed9a0b5ec414220e8f79b3d04c77acc82358f6e5ae4635687392ffbef', 
    OracleConfig: '0x1afe1cb83634f581606cc73c4487ddd8cc39a944b951283af23f7d69d5589478',
    SupraOracleHolder: '0xaa0315f0748c1f24ddb2b45f7939cff40f7a8104af5ccbc4a1d32f870c0b4105', 
};


SUI: {
        oracleId: 0,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
        priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 10000000000, // 10 = 10 * 1e9 = 10000000000
        minimumEffectivePrice: 100000000, // 0.1 = 0.1 * 1e9 = 100000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',
        feedId: '0x2cab9b151ca1721624b09b421cc57d0bb26a1feb5da1f821492204b098ec35c9', // TODO: value
        supraPairId: 90, // SUI_USDT -> 90, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Under%20Supervision-,SUI_USDT,-90
        pythPriceFeedId: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744', // **fixed value: Crypto.SUI/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
        priceDecimal: 9,
        expiration: 30,
    },
    USDC: {
        oracleId: 1,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 80, // x1: 0.8% = 0.008 * 10000 = 80
        priceDiffThreshold2: 150, // x2: 1.5% = 0.015 * 10000 = 150
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 2000000, // 2 = 2 * 1e6 = 2000000
        minimumEffectivePrice: 100000, // 0.1 = 0.1 * 1e6 = 100000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN',
        feedId: '0x70a79226dda5c080378b639d1bb540ddea64761629aa4ad7355d79266d55af61', // TODO: value
        supraPairId: 47, // USDC_USDT -> 47, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Supra%20Standard-,USDC_USDT,-47
        pythPriceFeedId: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a', // **fixed value: Crypto.USDC/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',
        priceDecimal: 6,
        expiration: 30,
    },
    USDT: {
        oracleId: 2,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 80, // x1: 0.8% = 0.008 * 10000 = 80
        priceDiffThreshold2: 150, // x2: 1.5% = 0.015 * 10000 = 150
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 2000000, // 2 = 2 * 1e6 = 2000000
        minimumEffectivePrice: 100000, // 0.1 = 0.1 * 1e6 = 100000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN',
        feedId: '0xf72d8933873bb4e5bfa1edbfa9ff6443ec5fac25c1d99ba2ef37f50a125826f3', // TODO: value
        supraPairId: 48, // USDT_USD -> 48, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Supra%20Premium-,USDT_USD,-48
        pythPriceFeedId: '0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b', // **fixed value: Crypto.USDT/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572',
        priceDecimal: 6,
        expiration: 30,
    },
    WETH: {
        oracleId: 3,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
        priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 600000000000, // 6000 = 6000 * 1e8 = 600000000000
        minimumEffectivePrice: 100000000, // 1 = 1 * 1e8 = 100000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN',
        feedId: '0x44d92366eba1f1652ec81f34585406726bef267565a2db1664ffd5ef18e21693', // TODO: value
        supraPairId: 1, // ETH_USDT -> 1, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Supra%20Premium-,ETH_USDT,-1
        pythPriceFeedId: '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace', // **fixed value: Crypto.ETH/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab',
        priceDecimal: 8,
        expiration: 30,
    },
    CETUS: {
        oracleId: 4,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 200, // x1: 2% = 0.02 * 10000 = 200
        priceDiffThreshold2: 400, // x2: 4% = 0.04 * 10000 = 400
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 1500000000, // 1.5 = 1.5 * 1e9 = 1500000000
        minimumEffectivePrice: 1000000, // 0.001 = 0.001 * 1e9 = 1000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0x6864a6f921804860930db6ddbe2e16acdf8504495ea7481637a1c8b9a8fe54b::cetus::CETUS',
        feedId: '0x5ac98fc1e6723af2a6d9a68a5d771654a6043f9c4d2b836b2d5fb4832a3be4f2', // TODO: value
        supraPairId: 93, // CETUS_USDT -> 93, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Supra%20Premium-,CETUS_USDT,-93
        pythPriceFeedId: '0xe5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef', // **fixed value: Crypto.CETUS/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x24c0247fb22457a719efac7f670cdc79be321b521460bd6bd2ccfa9f80713b14',
        priceDecimal: 9,
        expiration: 30,
    },
    CERT: {
        oracleId: 5,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
        priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 10000000000, // 10 = 10 * 1e9 = 10000000000
        minimumEffectivePrice: 100000000, // 0.1 = 0.1 * 1e9 = 100000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT',
        feedId: '0x086bb5540047b3c77ae5e2f9b811c7ef085517a73510f776753c8ee83d19e62c', // TODO: value
        supraPairId: 90, // SUI_USDT -> 90, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Under%20Supervision-,SUI_USDT,-90
        pythPriceFeedId: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744', // **fixed value: Crypto.SUI/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
        priceDecimal: 9,
        expiration: 30,
    },
    HASUI: {
        oracleId: 6,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
        priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 10000000000, // 10 = 10 * 1e9 = 10000000000
        minimumEffectivePrice: 100000000, // 0.1 = 0.1 * 1e9 = 100000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0xbde4ba4c2e274a60ce15c1cfff9e5c42e41654ac8b6d906a57efa4bd3c29f47d::hasui::HASUI',
        feedId: '0xac934a2a2d406085e7f73b460221fe1b11935864605ba58cdbb8e21c15f12acd', // TODO: value
        supraPairId: 90, // SUI_USDT -> 90, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Under%20Supervision-,SUI_USDT,-90
        pythPriceFeedId: '0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744', // **fixed value: Crypto.SUI/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
        priceDecimal: 9,
        expiration: 30,
    },
    NAVX: {
        oracleId: 7,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 200, // x1: 2% = 0.02 * 10000 = 200
        priceDiffThreshold2: 400, // x2: 4% = 0.04 * 10000 = 400
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 1000000000, // 1 = 1 * 1e9 = 1000000000
        minimumEffectivePrice: 1000000, // 0.001 = 0.001 * 1e9 = 1000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0xa99b8952d4f7d947ea77fe0ecdcc9e5fc0bcab2841d6e2a5aa00c3044e5544b5::navx::NAVX',
        feedId: '0x4324c797d2f19eff517c24adec8b92aa2d282e44f3a5cafb36d6c4b30d7f2dca', // TODO: value
        supraPairId: 408, // NAVX_USDT -> 408, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Supra%20Premium-,NAVX_USDT,-408
        pythPriceFeedId: '0x88250f854c019ef4f88a5c073d52a18bb1c6ac437033f5932cd017d24917ab46', // **fixed value: Crypto.NAVX/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x5b117a6a2de70796bffe36495bad576b788a34c33ca0648bd57852ead3f41e32',
        priceDecimal: 9,
        expiration: 30,
    },
    WBTC: {
        oracleId: 8,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
        priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 20000000000000, // 200000 = 200000 * 1e8 = 20000000000000
        minimumEffectivePrice: 100000000, // 1 = 1 * 1e8 = 100000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN',
        feedId: '0x1bf4727242a61d892feef6616d3e40a3bd24b64b5deb884054e86cb9360556c4', // TODO: value
        supraPairId: 0, // BTC_USDT -> 0, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Pair%20Category-,BTC_USDT,-0
        pythPriceFeedId: '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43', // Crypto.BTC/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2',
        priceDecimal: 8,
        expiration: 30,
    },
    AUSD: {
        oracleId: 9,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 80, // x1: 0.8% = 0.008 * 10000 = 80
        priceDiffThreshold2: 150, // x2: 1.5% = 0.015 * 10000 = 150
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 2000000, // 2 = 2 * 1e6 = 2000000
        minimumEffectivePrice: 10000, // 0.01 = 0.01 * 1e6 = 10000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0x2053d08c1e2bd02791056171aab0fd12bd7cd7efad2ab8f6b9c8902f14df2ff2::ausd::AUSD',
        feedId: '0x9a0656e1e10a0cdf3f03dce9db9ad931f51dc6eac2e52ebfbf535dfbcf8100ef', // TODO: values
        supraPairId: 99999,
        pythPriceFeedId: '0xd9912df360b5b7f21a122f15bdd5e27f62ce5e72bd316c291f7c86620e07fb2a',
        pythPriceInfoObject: '0x94ef89923e7beccd4a52043a9451a87c614684b847426fb5fd76faa8cb1e907f',
        priceDecimal: 6,
        expiration: 30,
    },
    NUSDC: {
        oracleId: 10,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 80, // x1: 0.8% = 0.008 * 10000 = 80
        priceDiffThreshold2: 150, // x2: 1.5% = 0.015 * 10000 = 150
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 2000000, // 2 = 2 * 1e6 = 2000000
        minimumEffectivePrice: 100000, // 0.1 = 0.1 * 1e6 = 100000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0xdba34672e30cb065b1f93e3ab55318768fd6fef66c15942c9f7cb846e2f900e7::usdc::USDC',
        feedId: '0xe120611435395f144b4bcc4466a00b6b26d7a27318f96e148648852a9dd6b31c', // TODO: value
        supraPairId: 47, // USDC_USDT -> 47, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Supra%20Standard-,USDC_USDT,-47
        pythPriceFeedId: '0xeaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a', // **fixed value: Crypto.USDC/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x5dec622733a204ca27f5a90d8c2fad453cc6665186fd5dff13a83d0b6c9027ab',
        priceDecimal: 6,
        expiration: 30,
    },
    ETH: {
        oracleId: 11,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
        priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 600000000000, // 6000 = 6000 * 1e8 = 600000000000
        minimumEffectivePrice: 100000000, // 1 = 1 * 1e8 = 100000000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH',
        feedId: '0x9a6ffc707270286e98e8d0f654ce38f69efbc302ac98e2deb11fbad2211600f0', // TODO: value
        supraPairId: 1, // ETH_USDT -> 1, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Supra%20Premium-,ETH_USDT,-1
        pythPriceFeedId: '0xff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace', // **fixed value: Crypto.ETH/USD -> https://pyth.network/developers/price-feed-ids
        pythPriceInfoObject: '0x9193fd47f9a0ab99b6e365a464c8a9ae30e6150fc37ed2a89c1586631f6fc4ab',
        priceDecimal: 8,
        expiration: 30,
    },
    USDY: {
        oracleId: 12,
        maxTimestampDiff: 30 * 1000, // 30s(millisecond)
        priceDiffThreshold1: 80, // x1: 0.8% = 0.008 * 10000 = 80
        priceDiffThreshold2: 150, // x2: 1.5% = 0.015 * 10000 = 150
        maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 2000000, // 2 = 2 * 1e6 = 2000000
        minimumEffectivePrice: 10000, // 0.01 = 0.01 * 1e6 = 10000
        historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
        coinType: '0x960b531667636f39e85867775f52f6b1f220a058c4de786905bdf761e06a56bb::usdy::USDY',
        feedId: '0x11ddf2ac1868d493e2487deeb2a0c2791bb7ca69632c8c5fefe85e09390be093', // TODO: values
        supraPairId: 185,
        pythPriceFeedId: '0xe393449f6aff8a4b6d3e1165a7c9ebec103685f3b41e60db4277b5b6d10e7326',
        pythPriceInfoObject: '0x62e15c2fd1437a4d0e111dbd8a193f244878ba25cc7caa9120d0ee41ac151ea5',
        priceDecimal: 6,
        expiration: 30,
    },
    NS: {
        oracleId: 13,
        maxTimestampDiff: 30000, // 30s(millisecond)
        priceDiffThreshold1: 80, // x1: 0.8% = 0.008 * 10000 = 80
        priceDiffThreshold2: 150, // x2: 1.5% = 0.015 * 10000 = 150
        maxDurationWithinThresholds: 30000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 2000000, // 2 = 2 * 1e6 = 2000000
        minimumEffectivePrice: 100000, // 0.01 = 0.01 * 1e6 = 10000
        historicalPriceTTL: 300000, // 5min(millisecond)
        coinType: '0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS',
        feedId: '0xc771ec0ca245857f30195ce05197a7b3ab41c58c1e8abe0661919d90675ad63d',
        supraPairId: 99999, // ignore for now
        pythPriceFeedId: '0xbb5ff26e47a3a6cc7ec2fce1db996c2a145300edc5acaabe43bf9ff7c5dd5d32',
        pythPriceInfoObject: '0xc6352e1ea55d7b5acc3ed690cc3cdf8007978071d7bfd6a189445018cfb366e0',
        priceDecimal: 6,
        expiration: 30,
    },
    LorenzoBTC: {
        oracleId: 14,
        maxTimestampDiff: 30000, // 30s(millisecond)
        priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
        priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
        maxDurationWithinThresholds: 30000, // 30s(millisecond)
        maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
        maximumEffectivePrice: 20000000000000, // 20000000000000 = 200000 * 1e8 = 20000000000000
        minimumEffectivePrice: 100000000, // 1 = 1 * 1e8 = 100000000
        historicalPriceTTL: 300000, // 5min(millisecond)
        coinType: '0x5f496ed5d9d045c5b788dc1bb85f54100f2ede11e46f6a232c29daada4c5bdb6::coin::COIN',
        feedId: '0xdf9b254a7a64742e1edf8c48bd2a1f182b52f020de2ab070ae0e3f9228d05280',
        supraPairId: 0,
        pythPriceFeedId: '0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
        pythPriceInfoObject: '0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2',
        priceDecimal: 8,
        expiration: 30,
    },
    DEEP: {
    oracleId: 15,
    maxTimestampDiff: 30000, // 30s(millisecond)
    priceDiffThreshold1: 200, // x1: 2% = 0.02 * 10000 = 200
    priceDiffThreshold2: 400, // x2: 4% = 0.04 * 10000 = 400
    maxDurationWithinThresholds: 30000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 400000, // 0.4 = 0.4 * 1e6 = 400000
    minimumEffectivePrice: 1000, // 0.001 = 0.001 * 1e6 = 1000
    historicalPriceTTL: 300000, // 5min(millisecond)
    coinType:
      "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP",
    feedId:
      "0x4558092b08ad1b33b0eb536f91a4655693c2390ac568f06de6f6fad827888600",
    supraPairId: 491,
    pythPriceFeedId:
      "0x29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff",
    pythPriceInfoObject:
      "0x8c7f3a322b94cc69db2a2ac575cbd94bf5766113324c3a3eceac91e3e88a51ed",
    priceDecimal: 6,
    expiration: 30,
    },
    FDUSD: {
    oracleId: 16,
    maxTimestampDiff: 30000, // 30s(millisecond)
    priceDiffThreshold1: 80, // x1: 0.8% = 0.008 * 10000 = 80
    priceDiffThreshold2: 150, // x2: 1.5% = 0.015 * 10000 = 150
    maxDurationWithinThresholds: 30000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 2000000, // 2 = 2 * 1e6 = 2000000
    minimumEffectivePrice: 10000, // 0.01 = 0.01 * 1e6 = 10000
    historicalPriceTTL: 300000, // 5min(millisecond)
    coinType:
      "0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a::fdusd::FDUSD",
    feedId:
      "0x843b39829166bd97d61843b8967405f13d443e066ce2f4fa0685f187974d34bd",
    supraPairId: 474,
    pythPriceFeedId:
      "0xccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979",
    pythPriceInfoObject:
      "0x5f6583b2b0fe1ecf94aaffeaab8a838794693960cea48c0da282d5f4a24be027",
    priceDecimal: 6,
    expiration: 30,
    },
    BLUE: {
    oracleId: 17,
    maxTimestampDiff: 30000, // 30s(millisecond)
    priceDiffThreshold1: 200, // x1: 0.8% = 0.008 * 10000 = 80
    priceDiffThreshold2: 400, // x2: 1.5% = 0.015 * 10000 = 150
    maxDurationWithinThresholds: 30000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 2000000000, // 2 = 2 * 1e6 = 2000000
    minimumEffectivePrice: 1000000, // 0.01 = 0.01 * 1e6 = 10000
    historicalPriceTTL: 300000, // 5min(millisecond)
    coinType:
      "0xe1b45a0e641b9955a20aa0ad1c1f4ad86aad8afb07296d4085e349a50e90bdca::blue::BLUE",
    feedId:
      "0xd8286c11df7e49496ee75622ae4132c56385c30b4bedb392e36c0699a52a1d52",
    supraPairId: 99999,
    pythPriceFeedId:
      "0x04cfeb7b143eb9c48e9b074125c1a3447b85f59c31164dc20c1beaa6f21f2b6b",
    pythPriceInfoObject:
      "0x5515a34fc610bba6b601575ed1d2535b2f9df1f339fd0d435fef487c1ee3df9c",
    priceDecimal: 9,
    expiration: 30,
    },
    BUCK: {
    oracleId: 18,
    maxTimestampDiff: 30000, // 30s(millisecond)
    priceDiffThreshold1: 80,
    priceDiffThreshold2: 150,
    maxDurationWithinThresholds: 30000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 2000000000,
    minimumEffectivePrice: 1000000,
    historicalPriceTTL: 300000, // 5min(millisecond)
    coinType:
      "0xce7ff77a83ea0cb6fd39bd8748e2ec89a3f41e8efdc3f4eb123e0ca37b184db2::buck::BUCK",
    feedId:
      "0x93c1b815f64ef7c4311d74ff7c0ca1e47739c3ac31fdee0068c30887633ba2fb",
    supraPairId: 161,
    pythPriceFeedId:
      "0xfdf28a46570252b25fd31cb257973f865afc5ca2f320439e45d95e0394bc7382",
    pythPriceInfoObject:
      "0x3ef821a54dbdfe3f211b2ff7261dea0f0330c72fd292422ce586e21f43809a56",
    priceDecimal: 9,
    expiration: 30,
    },
    SUIUSDT: {
    oracleId: 19,
    maxTimestampDiff: 30000, // 30s(millisecond)
    priceDiffThreshold1: 80,
    priceDiffThreshold2: 150,
    maxDurationWithinThresholds: 30000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 2000000,
    minimumEffectivePrice: 100000,
    historicalPriceTTL: 300000, // 5min(millisecond)
    coinType:
      "0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068::usdt::USDT",
    feedId:
      "0xdeba21105ff41300f8829aaeba45fdec25d1533a64d504ef0348ff005da3fbe5",
    supraPairId: 48,
    pythPriceFeedId:
      "0x2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b",
    pythPriceInfoObject:
      "0x985e3db9f93f76ee8bace7c3dd5cc676a096accd5d9e09e9ae0fb6e492b14572",
    priceDecimal: 6,
    expiration: 30,
    },
    STSUI: {
    oracleId: 20,
    maxTimestampDiff: 30000, // 30s(millisecond)
    priceDiffThreshold1: 100,
    priceDiffThreshold2: 300,
    maxDurationWithinThresholds: 30000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 10000000000,
    minimumEffectivePrice: 100000000,
    historicalPriceTTL: 300000, // 5min(millisecond)
    coinType:
      "0xd1b72982e40348d069bb1ff701e634c117bb5f741f44dff91e472d3b01461e55::stsui::STSUI",
    feedId:
      "0xd7a8c920db9f8b5c3c300307d88fca53684fd15b760977dbf8f0adc6e55783bd",
    supraPairId: 90,
    pythPriceFeedId:
      "0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744",
    pythPriceInfoObject:
      "0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37",
    priceDecimal: 9,
    expiration: 30,
    },
    SUIBTC: {
    oracleId: 21,
    maxTimestampDiff: 30 * 1000, // 30s(millisecond)
    priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
    priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
    maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 20000000000000, // 200000 = 200000 * 1e8 = 20000000000000
    minimumEffectivePrice: 100000000, // 1 = 1 * 1e8 = 100000000
    historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
    coinType:
      "0xaafb102dd0902f5055cadecd687fb5b71ca82ef0e0285d90afde828ec58ca96b::btc::BTC",
    feedId:
      "0x4e4666c82c476f0b51b27c5ed8c77ab960aa5e4c3a48796e179d721b471e3b7e", // TODO: value
    supraPairId: 0, // BTC_USDT -> 0, https://supra.com/docs/data-feeds/data-feeds-index/#:~:text=Pair%20Category-,BTC_USDT,-0
    pythPriceFeedId:
      "0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", // Crypto.BTC/USD -> https://pyth.network/developers/price-feed-ids
    pythPriceInfoObject:
      "0x9a62b4863bdeaabdc9500fce769cf7e72d5585eeb28a6d26e4cafadc13f76ab2",
    priceDecimal: 8,
    expiration: 30,
    },
    WSOL: {
    oracleId: 22,
    maxTimestampDiff: 30 * 1000, // 30s(millisecond)
    priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
    priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
    maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 100000000000, // 1000 * 1e8 = 100000000000
    minimumEffectivePrice: 100000000, // 1 = 1 * 1e8 = 100000000
    historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
    coinType: '0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN',
    feedId: '0x2611dff736233a6855e28ae95f8e5f62a6bf80653ddb118bf012fd783d530fa1',
    supraPairId: 10, // SOL_USDT -> 10
    pythPriceFeedId: '0xef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d', // **fixed value: Crypto.SOL/USD -> https://pyth.network/developers/price-feed-ids
    pythPriceInfoObject: '0x9d0d275efbd37d8a8855f6f2c761fa5983293dd8ce202ee5196626de8fcd4469',
    priceDecimal: 8,
    expiration: 30,
    }
  LBTC: {
    oracleId: 23,
    maxTimestampDiff: 30 * 1000, // 30s(millisecond)
    priceDiffThreshold1: 100, // x1: 1% = 0.01 * 10000 = 100
    priceDiffThreshold2: 300, // x2: 3% = 0.03 * 10000 = 300
    maxDurationWithinThresholds: 30 * 1000, // 30s(millisecond)
    maximumAllowedSpanPercentage: 700, // 7% = 0.07 * 10000 = 700
    maximumEffectivePrice: 20000000000000, // 200000 = 200000 * 1e8 = 20000000000000
    minimumEffectivePrice: 100000000, // 1 = 1 * 1e8 = 100000000
    historicalPriceTTL: 5 * 60 * 1000, // 5min(millisecond)
    coinType: '0x3e8e9423d80e1774a7ca128fccd8bf5f1f7753be658c5e645929037f7c819040::lbtc::LBTC',
    feedId: '0x8ee4d9d61d0bfa342cdb3ee8b7f047c91f0b586e0ff66fd6e8fc761e235e5409', // TODO: value
    supraPairId: 99999, // none
    pythPriceFeedId: '0x8f257aab6e7698bb92b15511915e593d6f8eae914452f781874754b03d0c612b', // Crypto.LBTC/USD -> https://pyth.network/developers/price-feed-ids
    pythPriceInfoObject: '0xeba15840ddf425dacb5ff0990334fc03d034487f4ad416280859b96bf2af89f8',
    priceDecimal: 8,
    expiration: 30,
}


Data Sources

Last updated