πŸ’½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

Sample Transaction

View Transaction


Oracle Configuration

Below is the configuration data for different tokens:


Data Sources

Last updated