{"id":19610694,"url":"https://github.com/onflow/band-oracle-contracts","last_synced_at":"2026-02-28T23:32:03.034Z","repository":{"id":193348012,"uuid":"679750990","full_name":"onflow/band-oracle-contracts","owner":"onflow","description":"Contracts and related for integration with Band protocol Oracle Network","archived":false,"fork":false,"pushed_at":"2025-12-03T21:49:00.000Z","size":99,"stargazers_count":3,"open_issues_count":2,"forks_count":6,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-12-07T03:34:57.321Z","etag":null,"topics":["blockchain","flow","oracle"],"latest_commit_sha":null,"homepage":"https://flow.com/","language":"Cadence","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-17T14:32:00.000Z","updated_at":"2025-12-03T21:49:01.000Z","dependencies_parsed_at":"2023-12-18T20:15:50.700Z","dependency_job_id":"c3164911-dbe8-45ce-af2c-7af29308dd59","html_url":"https://github.com/onflow/band-oracle-contracts","commit_stats":null,"previous_names":["onflow/band-oracle-contracts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/onflow/band-oracle-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fband-oracle-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fband-oracle-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fband-oracle-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fband-oracle-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onflow","download_url":"https://codeload.github.com/onflow/band-oracle-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onflow%2Fband-oracle-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29954966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T22:53:01.873Z","status":"ssl_error","status_checked_at":"2026-02-28T22:52:50.699Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","flow","oracle"],"created_at":"2024-11-11T10:32:03.091Z","updated_at":"2026-02-28T23:32:02.985Z","avatar_url":"https://github.com/onflow.png","language":"Cadence","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Band Oracle Contract\nThe Cadence smart contract enabling integration of the Band Protocol Oracle network. The oracle network presently offers the full set of [price quotes](https://data.bandprotocol.com/) from the Band Standard Dataset. These are available for any Cadence applications, contracts or transactions to use and presently charges no fees. \n\nCurrently supported cryptocurrency token pairs are: \n\n* ETH, FLOW, USDC, USDT, WBTC\n* BNB, XRP, ADA, DOGE, POL (MATIC)\n* SOL, DOT, LTC, SHIB. TRX\n* AVAX, DAI, WBTC, LINK, ATOM\n* XLM, AAVE, S (FTM), CRV, OP\n* CAKE, DYDX, 1INCH, BAT, SUSHI\n* UNI, SUI\n\nCurrently supported fiat currency pairs are: \n\n* KRW, INR, PLN, HKD, TWD\n* THB, TRY, AUD, BRL, CAD\n* CHF, CNY, CZK, EUR, GBP\n* JPY, MYR, NZD, PHP, RUB\n* SEK, SGD\n\nTo learn more about Band Protocol please refer to: https://faq.bandprotocol.com/\n\n## Contract Addresses \n\n|Name|Testnet|Mainnet|\n|----|-------|-------|\n|[BandOracle](contracts/BandOracle.cdc)|[0x2c71de7af78d1adf](https://contractbrowser.com/A.2c71de7af78d1adf.BandOracle)|[]()|\n|[BandOracle](contracts/BandOracle.cdc)|[]()|[0x6801a6222ebf784a](https://contractbrowser.com/A.6801a6222ebf784a.BandOracle)|\n\n## How it works?\nThe contract keeps a record of symbols and the corresponding financial price data for them. While financial data are only updated by authorized BandChain relayers, they can be queried via a script by any user or application on the Flow blockchain.\n\n### Storing the data\nMarket for each symbol is stored on a dictionary as a contract level field `access(contract) let symbolsRefData: {String: RefData}`. The `RefData` structs stores the following information: \n```cadence\n    pub struct RefData {\n        // USD-rate, multiplied by 1e9.\n        pub var rate: UInt64\n        // UNIX epoch when data is last resolved. \n        pub var timestamp: UInt64\n        // BandChain request identifier for this data.\n        pub var requestID: UInt64\n    }\n```\nThis struct provides the caller with the data received from the oracle network for the symbol in question. Keep in mind that all data is normalized and stored using a USD conversion rate, meaning that conversions into other symbols will derive from that.\n\n### Updating the data\nThe account where the contract is deployed will be granted an `OracleAdmin` resource. This resource can create `DataUpdater` resources and publish a `{\u0026RelayUpdate}` capability to them. An authorized account - belonging to a relayer - can claim said capability at the time of creating a `Relay` resource. This resource will grant the ability to call the `updateData` method that will call contract function `access(contract) fun updateRefData (symbolsRates: {String: UInt64}, resolveTime: UInt64, requestID: UInt64)` which in turn updates the `symbolsRefData` dictionary.\n\n### Querying the data\nWhen invoking the public function `pub fun getReferenceData (baseSymbol: String, quoteSymbol: String): RefData?` calling contracts or scripts would be provided the price corresponding to `quoteSymbol` in the `baseSymbol` currency. If there are no entries registered for either the base or quote symbols the function will return `nil`.\n\n### Fees\n\n[TBD]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fband-oracle-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonflow%2Fband-oracle-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonflow%2Fband-oracle-contracts/lists"}