Smart Contracts

AFXO oracle contracts are deployed on Avalanche C-Chain as our canonical root (source of truth). Celo and Base coming next, followed by Arbitrum and Solana. All contracts implement a standard oracle interface for easy integration.

Standard Oracle Interface

Our oracles implement an industry-standard interface, making integration straightforward for existing DeFi protocols.

// SPDX-License-Identifier: MIT
interface IAFXOOracle {
    function latestRoundData() external view returns (
        uint80 roundId,
        int256 answer,
        uint256 startedAt,
        uint256 updatedAt,
        uint80 answeredInRound
    );

    function getRoundData(uint80 _roundId) external view returns (
        uint80 roundId,
        int256 answer,
        uint256 startedAt,
        uint256 updatedAt,
        uint80 answeredInRound
    );

    function decimals() external view returns (uint8);
    function description() external view returns (string memory);
    function version() external view returns (uint256);

    // AFXO Extensions
    function getConfidence() external view returns (uint8);
    function getSourceCount() external view returns (uint8);
}

Avalanche C-Chain

LiveChain ID: 43114

AFXOOracle (KES/USD)

Kenyan Shilling oracle

0x...

AFXOOracle (NGN/USD)

Nigerian Naira oracle

0x...

AFXOOracle (GHS/USD)

Ghanaian Cedi oracle

0x...

AFXORegistry

Oracle registry and discovery

0x...

Contract addresses will be published upon mainnet deployment. Currently in final testing.

Avalanche Fuji Testnet

TestnetChain ID: 43113

AFXOOracle (KES/USD)

Kenyan Shilling oracle (testnet)

0x742d35Cc6634C0532925a3b844Bc9e7595f...

AFXOOracle (NGN/USD)

Nigerian Naira oracle (testnet)

0x8Ba1f109551bD432803012645Ac136ddd...

AFXORegistry

Oracle registry (testnet)

0x1CBd3b2770909D4e10f157cABC84C7264073...

Chain Roadmap

CeloNext

Chain ID: 42220

BasePlanned

Chain ID: 8453

ArbitrumPlanned

Chain ID: 42161

SolanaFuture

Non-EVM

Integration Example

Example Solidity code for consuming AFXO oracle data:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "@afxo/contracts/interfaces/IAFXOOracle.sol";

contract MyDeFiProtocol {
    IAFXOOracle public kesOracle;

    constructor(address _kesOracle) {
        kesOracle = IAFXOOracle(_kesOracle);
    }

    function getKESPrice() external view returns (int256) {
        (
            ,
            int256 price,
            ,
            uint256 updatedAt,

        ) = kesOracle.latestRoundData();

        // Check data freshness (e.g., within 1 hour)
        require(block.timestamp - updatedAt < 3600, "Stale data");

        // Check confidence (optional but recommended)
        require(kesOracle.getConfidence() >= 70, "Low confidence");

        return price;
    }
}

Security Considerations

  • • Always verify data freshness before using oracle values
  • • Check confidence scores for critical operations
  • • Implement circuit breakers for extreme price movements
  • • Consider using multiple oracle sources for high-value operations
  • • Our contracts are audited — see our security page