← Protocols
Band Protocol
Oracle·EVM · Cosmos · Multi-chain

Band Protocol

01Description

Cross-chain data oracle built on BandChain (Cosmos SDK). Validators source and aggregate off-chain data on BandChain, then relay results to consumer chains via IBC or per-chain `StdReference` proxy contracts. Exposes a simple `getReferenceData(base, quote)` interface across 30+ EVM chains.

02Best for
  • 01simple symbol-pair price feeds (`getReferenceData('BTC','USD')`)
  • 02Cosmos / IBC-native data oracles
  • 03long-tail EVM chains where major oracles are absent
  • 04low-cost on-chain price feeds with bulk reads
  • 05custom oracle scripts on BandChain
03Install
  • pnpm add @bandprotocol/bandchain.js
  • forge install bandprotocol/band-std-reference-contracts-solidity
04Environment variables
VariableScopeDescription
BAND_STD_REFERENCE_ADDRESSClientBand `StdReferenceProxy` contract address on the target chain. See docs.bandchain.org/develop/supported-blockchains.
05Prompt snippet
Import `IStdReference` from `@bandprotocol/std-reference-contracts/IStdReference.sol` and call `IStdReference(ref).getReferenceData('ETH','USD')` to get a `ReferenceData { uint256 rate; uint256 lastUpdatedBase; uint256 lastUpdatedQuote; }` — `rate` is the base/quote price multiplied by 1e18. For multiple pairs use `getReferenceDataBulk(string[] bases, string[] quotes)`. Always staleness-check both `lastUpdatedBase` and `lastUpdatedQuote` against `block.timestamp` (typical 5-30 min tolerance). Off-chain or for Cosmos-native consumers, use `@bandprotocol/bandchain.js` `Client.getReferenceData([{ symbol_pair: ['ETH','USD'] }])`. For custom feeds deploy an oracle script on BandChain via the `bandchain.js` `OracleScript` API.
06Gotchas
  • Two timestamps, not one: `getReferenceData` returns BOTH `lastUpdatedBase` and `lastUpdatedQuote` — for non-USD-quoted pairs (e.g. ETH/BTC) you MUST validate the older of the two; checking only one misses staleness on the other leg.
  • Decimal scaling is fixed to 1e18 regardless of asset (NOT Chainlink's per-feed `decimals()`); hardcoding 8 decimals like Chainlink is a 1e10 silent bug.
  • Push model: rates are relayed from BandChain on a per-chain heartbeat / deviation cadence — long-tail chains may relay infrequently; verify the per-chain relayer schedule before using for liquidations.
  • Per-chain `StdReference` addresses differ; the SAME pair has different proxy addresses on every chain. Copy from `docs.bandchain.org/develop/supported-blockchains` — never reuse mainnet addresses on testnet.
  • Symbol casing matters: `'ETH'` is not `'eth'`. Symbol strings are matched exactly by the on-chain registry; misspellings revert with `REF_DATA_NOT_AVAILABLE`.
  • Network fees: reads are free (just gas) but the cross-chain relayer is paid by the Band foundation / sponsors — long-tail chains MAY have stale relays during incidents; have a fallback oracle.
  • Band's chain coverage is narrower than Chainlink/Pyth — verify your target chain has an active relayer and recent updates before committing.
07Alternatives