2ī¸âƒŖGet Pools Config and Oracle Price Feeds

NAVI offers essential data about specific lending and borrowing pools, as well as oracle price feeds, through its public API and NAVI SDK. This data includes key details like pool ID, reserve ID, borrow and supply balances, caps, interest rates, and oracle prices. It enables developers and users to understand the current state of a pool, its limitations, and potential opportunities for interaction, such as borrowing, supplying, and calculating rewards.

Oracles in the NAVI Protocol

In the NAVI protocol, each oracle is associated with a specific poolId, enabling developers to efficiently access and interact with oracle data. The oracle provides essential fields for accurate financial operations:

  • Decimal: Defines the decimal precision of the pool's coin, ensuring calculations are accurate.

  • OracleID: The unique identifier for the oracle, specifying its asset ID.

  • Value: The current data point provided by the oracle, typically a numeric metric such as an asset price or exchange rate.

  • Price: The market price retrieved from the oracle, ensuring real-time accuracy in financial computations.

  • Valid: A boolean that indicates whether the oracle’s data is reliable and up-to-date. If valid is true, the data can be used safely for calculations. If false, the data may be outdated or unreliable.

To query an oracle, use the API to retrieve the oracle object linked to each pool and ensure you are accessing the correct data.

Sample Data of Sui Price from API:

"oracle": {
    "decimal": 9,
    "value": "1830516540",
    "price": "1.83051654",
    "oracleId": 0,
    "valid": true
}

Sample Tx and on-chain event of NAVI Orace Sui Price:

{
  "id": {
    "txDigest": "2jeVCjdfkUm4J6vMNVZtVne1o4NpdUFuJdvtuQyb8UgU",
    "eventSeq": "0"
  },
  "packageId": "0xca441b44943c16be0e6e23c5a955bb971537ea3289ae8016fbf33fffe1fd210f",
  "transactionModule": "oracle_pro",
  "sender": "0xa2fe7a0d7bd70fe76d32065ec7b3c604cd90016a560bf2f01b68f3b5bbd2d3aa",
  "type": "0xc2d49bf5e75d2258ee5563efa527feb6155de7ac6f6bf025a23ee88cd12d5a83::oracle::PriceUpdated",
  "parsedJson": {
    "id": 0,
    "last_price": "1831480060",
    "last_update_at": "1728614555256",
    "price": "1831268400",
    "price_oracle": "0x1568865ed9a0b5ec414220e8f79b3d04c77acc82358f6e5ae4635687392ffbef",
    "update_at": "1728614565290"
  },
  "bcs": "JjyLckUe7fhfVBPVwtNSNQKzVDkDMyjF92CYAsXDhUsTU28T1qeNR7r8GttQZ14V5yvEv4YQZW4XYRiMWLtt41NRhgxjCCvw5DwYEn3eFAaM3Bu4zYJBM24nFbCk2mXdnM2UkUNF3wEkUWZo4X23moGnzB"
}

Last updated