DeFi Protocol Rates and States

How do I access DeFi protocol information using the DIA oracle system?

The oracle contains information about DeFi protocols. You can access a quotation of the current interest rate and the currently locked tokens as well as the timestamp of the last update.

  1. Call getCoinInfo(protocol_name) with protocol_name being the full protocol name such as Maker. You can use the "Read" section on Etherscan to execute this call.

  2. The response of the call contains four values:

    1. The interest rate with a fix-comma notation of five decimals.

    2. The currently locked assets.

    3. The UNIX timestamp of the last oracle update.

    4. The short name of the protocol, e.g., MKR for Maker Protocol.