Complete reference for the IIfaPriceFeed interface structures and function signatures
IIfaPriceFeed
interface defines the standard data structures and function signatures for the IFA Oracle Price Feed System. This interface ensures consistent interaction patterns across all implementations.
Field | Type | Range | Description |
---|---|---|---|
decimal | int256 | -30 to 30 | Decimal precision for the price value |
lastUpdateTime | uint256 | Unix timestamp | When the price was last updated |
price | uint256 | > 0 | Price value scaled by decimal precision |
roundId | uint256 | >= 1 | Sequential round identifier |
Field | Type | Value | Description |
---|---|---|---|
decimal | int256 | Always -30 | Fixed precision for derived calculations |
lastUpdateTime | uint256 | Unix timestamp | Earliest update time of the two assets |
derivedPrice | uint256 | > 0 | Exchange rate scaled to 30 decimals |
roundDifference | uint256 | >= 0 | Absolute difference between asset round IDs |
derivedPrice
is calculated as:
Direction | Assets | Calculation | Result |
---|---|---|---|
Forward | USDC → BTC | USDC price / BTC price | BTC per USDC |
Backward | USDC → BTC | BTC price / USDC price | USDC per BTC |
_assetIndex
: Asset identifier (typically keccak256(assetSymbol)
)assetInfo
: PriceFeed struct with price dataexist
: Boolean indicating if asset price exists_assetIndexes
: Array of asset identifiersassetsInfo
: Array of PriceFeed structsexists
: Array of booleans indicating existence_assetIndex0
: First asset identifier_assetIndex1
: Second asset identifier_direction
: Forward or Backward calculationpairInfo
: DerviedPair struct with exchange rate_assetIndexes0
: Array of first asset identifiers_assetsIndexes1
: Array of second asset identifierspairsInfo
: Array of DerviedPair structs (forward direction)_assetIndexes0
: Array of first asset identifiers_assetsIndexes1
: Array of second asset identifierspairsInfo
: Array of DerviedPair structs (backward direction)_assetIndexes0
: Array of first asset identifiers_assetsIndexes1
: Array of second asset identifiers_direction
: Array of directions for each pairpairsInfo
: Array of DerviedPair structs_assetIndex
: Asset identifierassetInfo
: PriceFeed struct with new price data_verifier
: Address of the verifier contractkeccak256
hashing:
Asset | Symbol | Identifier |
---|---|---|
Bitcoin | BTC | keccak256("BTC") |
Ethereum | ETH | keccak256("ETH") |
USD Coin | USDC | keccak256("USDC") |
Tether | USDT | keccak256("USDT") |
Nigerian Naira | CNGN | keccak256("CNGN") |