- What is Band?
- Deploying an example Oracle contract that calls the Band reference data contract
- Calling the reference data contract for current rates of different assets
What is Band?
Band is the data layer that trains AI engines and powers blockchain applications. By empowering DeFi, GameFi, and AI agents, it enables developers, institutions, and users to access real-time data with zero counterparty risk. With Band’s open, battle-tested data infrastructure built for blockchains and LLMs, it ensures that real-time information is always accessible—fueling everything from financial protocols to autonomous AI systems. You can read more about the specific details of the protocol here.Deploy Oracle
- Follow this link to Remix. The link contains an encoded example
DemoOracle.solcontract. - Compile the contract with compiler version
0.6.11. - Switch to the Deploy tab of Remix.
- Select “Injected Web3” in the Environment dropdown in the top left to connect Metamask.
- Make sure that Metamask is connected to the Celo Sepolia test network. You can read about adding Celo Sepolia to Metamask here.

- Enter the Band reference-data aggregator contract address for your network into the
DemoOracleconstructor and deploy the contract. Copy the current address for Celo from Band’s supported blockchains page — Band updates the reference contract from time to time, and a stale address returns stale data.

Get Rates
Clicking thegetPrice button will return the current price of CELO in USD. This function calls getReferenceData(string memory _base, string memory _quote) on the Band reference data contract, passing “CELO” and “USD”, indicating CELO as the base and USD as the quote. The rate returned is base/quote multiplied by 1e18.

DemoOracle contract only returns the latest rate, but the reference contract also returns values of the last time the base and quote references were updated.
The price is offset by 1e18. The returned value at the time of testing is 3747326500000000000. Multiplying by 1e-18 gives the current USD price given by the reference contract, 3.7473265 CELO/USD.
Clicking the getMultiPrices button returns multiple quotes in the same call, BTC/USD and BTC/ETH in this case. This function calls getReferenceDataBulk(string[] memory _bases, string[] memory _quotes) on the Band reference data contract, passing “CELO” as the base and “USD” and “ETH” for the quotes. This will return the current CELO prices in USD and ETH, as an array of integers. The call also returns just the exchange rates (multiplied by 1e18), but can be modified to return the last updated times for the bases and quotes.

price. This storage data will only be updated when the “savePrice” function is called, so the saved price value will go stale unless this function is called repeatedly.
