Oracles / IOracle interface

Oracles are flexible contracts to provide pricing data. That a lending pair uses a correctly configured oracle has to be verified by the UI. They all follow the following interface:

Methods

get nonpayable (bytes)

Get the latest exchange rate.

  • Parameters

  • bytes data: Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. For example: (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));

  • Return Values

  • bool _0: success if no valid (recent) rate is available, return false else true.

  • uint256 _1: rate The rate of the requested asset / pair / pool.

name view (bytes)

Returns a human readable name about this oracle.

  • Parameters

  • bytes _0

  • Return Values

  • string _0: (string) A human readable name about this oracle.

peek view (bytes)

Check the last exchange rate without any state changes.

  • Parameters

  • bytes data: Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. For example: (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));

  • Return Values

  • bool _0: success if no valid (recent) rate is available, return false else true.

  • uint256 _1: rate The rate of the requested asset / pair / pool.

peekSpot view (bytes)

Check the current spot exchange rate without any state changes. For oracles like TWAP this will be different from peek().

  • Parameters

  • bytes data: Usually abi encoded, implementation specific data that contains information and arguments to & about the oracle. For example: (string memory collateralSymbol, string memory assetSymbol, uint256 division) = abi.decode(data, (string, string, uint256));

  • Return Values

  • uint256 rate: The rate of the requested asset / pair / pool.

symbol view (bytes)

Returns a human readable (short) name about this oracle.

  • Parameters

  • bytes _0

  • Return Values

  • string _0: (string) A human readable symbol name about this oracle.