{"id":13564268,"url":"https://github.com/ojo-network/price-feeder","last_synced_at":"2026-01-14T10:58:00.349Z","repository":{"id":64683683,"uuid":"574665722","full_name":"ojo-network/price-feeder","owner":"ojo-network","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-23T13:21:11.000Z","size":1428,"stargazers_count":30,"open_issues_count":38,"forks_count":28,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-23T15:29:09.057Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/ojo-network.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"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":"2022-12-05T20:14:02.000Z","updated_at":"2024-09-13T16:21:02.000Z","dependencies_parsed_at":"2023-02-13T03:31:56.904Z","dependency_job_id":"22b097d5-e525-4a7b-bdc9-f27bd22545c4","html_url":"https://github.com/ojo-network/price-feeder","commit_stats":null,"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/ojo-network/price-feeder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojo-network%2Fprice-feeder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojo-network%2Fprice-feeder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojo-network%2Fprice-feeder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojo-network%2Fprice-feeder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ojo-network","download_url":"https://codeload.github.com/ojo-network/price-feeder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ojo-network%2Fprice-feeder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"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":[],"created_at":"2024-08-01T13:01:28.962Z","updated_at":"2026-01-14T10:58:00.321Z","avatar_url":"https://github.com/ojo-network.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Oracle Price Feeder\n\nThe `price-feeder` tool is an extension of Ojo's `x/oracle` module, both of\nwhich are based on Terra's [x/oracle](https://github.com/terra-money/classic-core/tree/main/x/oracle)\nmodule and [oracle-feeder](https://github.com/terra-money/oracle-feeder). The\ncore differences are as follows:\n\n- All exchange rates must be quoted in USD or USD stablecoins.\n- No need or use of reference exchange rates (e.g. Luna).\n- No need or use of Tobin tax.\n- The `price-feeder` combines both `feeder` and `price-server` into a single\n  Golang-based application for better UX, testability, and integration.\n\n## Forks - Other Projects that use the Ojo Price Feeder\n\n- [Kujira](https://github.com/team-kujira/oracle-price-feeder)\n- [Sei](https://github.com/sei-protocol/sei-chain/tree/master/oracle/price-feeder)\n\n## Background\n\nThe `price-feeder` tool is responsible for performing the following:\n\n1. Fetching and aggregating exchange rate price data from various providers, e.g.\n   Binance and Osmosis, based on operator configuration. These exchange rates\n   are exposed via an API and are used to feed into the main oracle process.\n2. Taking aggregated exchange rate price data and submitting those exchange rates\n   on-chain to Ojo's `x/oracle` module following Ojo's [Oracle](https://github.com/ojo-network/ojo/tree/main/x/oracle#readme)\n   specification.\n\n\u003c!-- markdown-link-check-disable --\u003e\n\n## Providers\n\nThe list of current supported providers:\n\n- [Binance](https://www.binance.com/en)\n- [Bitget](https://www.bitget.com/)\n- [Coinbase](https://www.coinbase.com/)\n- [Crescent](https://github.com/ojo-network/crescent-api)\n- [Crypto](https://crypto.com/)\n- [Gate](https://www.gate.io/)\n- [Huobi](https://www.huobi.com/en-us/)\n- [Kraken](https://www.kraken.com/en-us/)\n- [Kujira](https://github.com/ojo-network/kujira-api)\n- [Mexc](https://www.mexc.com/)\n- [Okx](https://www.okx.com/)\n- [Osmosis](https://github.com/ojo-network/osmosis-api)\n- [Polygon](https://api.polygon.io)\n\u003c!-- markdown-link-check-enable --\u003e\n\n## Usage\n\nThe `price-feeder` tool runs off of one or many configuration files.\n\nThe node-config contains the oracle's keyring and feeder account information.\nThe keyring's password is defined via environment variables or user input.\nMore information on the keyring can be found [here](#keyring)\nPlease see the [example configuration](price-feeder.example.toml) for more details. The path to the node-config is required as the first argument. You can optionally add all configuration options to the node-config file or use the config-dir flag to point to a directory containing the other configuration files.\n\nThe files in the provider-config folder define what exchange rates to fetch and what providers to get them from. They also contain deviation thresholds and API endpoints. Please see the [example configuration](ojo-provider-config) for more details.\n\n```shell\n$ price-feeder /path/to/price_feeder_config.toml\n```\n\nChain rules for checking the free oracle transactions are:\n\n- must be only prevote or vote\n- gas is limited to [`MaxMsgGasUsage`](https://github.com/ojo-network/ojo/blob/main/ante/fee.go#L13) constant.\n\nSo, if you don't want to pay for gas, TX must be below `MaxMsgGasUsage`. If you set too much gas (which is what is happening when when you set `gas_adjustment` to 2), then the tx will allocate 2x gas, and hence will go above the free quota, so you would need to attach fee to pay for that gas.\nThe easiest is to just set constant gas. We recommend 10k below the `MaxMsgGasUsage`.\n\nIn the PF config file you can set either:\n\n- `gas_adjustment`\n- or `gas_prevote` and `gas_vote` - fixed amount of gas used for `MsgAggregateExchangeRatePrevote` and `MsgAggregateExchangeRateVote` transactions respectively.\n\n## Configuration\n\nCopy the `price-feeder.example.toml` file to `price-feeder.toml` and update accordingly.\n\n### `config_dir`\n\nPrice Feeder requires instructions what endpoints to use and which currencies to track. The following files must be present in the directory specified by `config_dir`:\n\n- `currencty-pairs.toml`\n- `deviation-thresholds.toml`: Deviation allows validators to set a custom amount of standard deviations around the median which is helpful if any providers become faulty. It should be noted that the default for this option is 1 standard deviation.\n- `endpoints.toml`: enables validators to setup their own API endpoints for a given provider.\n\nDepending where you run your validator node, certain locations may block some endpoints. Make sure you read through the comments in the config file.\n\n### `telemetry`\n\nA set of options for the application's telemetry, which is disabled by default. An in-memory sink is the default, but Prometheus is also supported. We use the [cosmos sdk telemetry package](https://github.com/cosmos/cosmos-sdk/blob/3689d6f41ad8afa6e0f9b4ecb03b4d7f2d3a9e94/docs/docs/core/09-telemetry.md).\n\n### `server`\n\nThe `server` section contains configuration pertaining to the API served by the\n`price-feeder` process such the listening address and various HTTP timeouts.\n\n### `currency_pairs.toml` file\n\nThe `currency_pairs` sections contains one or more exchange rates along with the\nproviders from which to get market data from. It is important to note that the\nproviders supplied in each `currency_pairs` must support the given exchange rate.\n\nFor example, to get multiple price points on ATOM, you could define `currency_pairs`\nas follows:\n\n```toml\n[[currency_pairs]]\nbase = \"ATOM\"\nproviders = [\n  \"binance\",\n]\nquote = \"USDT\"\n\n[[currency_pairs]]\nbase = \"ATOM\"\nproviders = [\n  \"kraken\",\n  \"osmosis\",\n]\nquote = \"USD\"\n```\n\nProviding multiple providers is beneficial in case any provider fails to return\nmarket data. Prices per exchange rate are submitted on-chain via pre-vote and\nvote messages using a time-weighted average price (TVWAP).\n\n### `provider_min_override`\n\nAt startup the amount of possible providers for a currency is checked by querying the\nCoinGecko API to enforce an acceptable minimum providers for a given currency pair. If\nthis request fails and `provider_min_override` is set to true, the minimum is not enforced\nand the `price-feeder` is allowed to run irrespective of how many providers are provided\nfor a given currency pair. `provider_min_override` will not take effect if CoinGecko\nrequests are successful.\n\n### `account`\n\nThe `account` section contains the oracle's feeder and validator account information.\nThese are used to sign and populate data in pre-vote and vote oracle messages.\n\n### `keyring`\n\nThe `keyring` section contains Keyring related material used to fetch the key pair\nassociated with the oracle account that signs pre-vote and vote oracle messages.\n\n### `rpc`\n\nThe `rpc` section contains the Tendermint and Cosmos application gRPC endpoints.\nThese endpoints are used to query for on-chain data that pertain to oracle\nfunctionality and for broadcasting signed pre-vote and vote oracle messages.\n\n## Keyring\n\nOur keyring must be set up to sign transactions before running the price feeder.\nAdditional info on the different keyring modes is available [here](https://docs.cosmos.network/v0.46/run-node/keyring.html).\n**Please note that the `test` and `memory` modes are only for testing purposes.**\n**Do not use these modes for running the price feeder against mainnet.**\n\n### Setup\n\nThe keyring `dir` and `backend` are defined in the config file.\nYou may use the `PRICE_FEEDER_PASS` environment variable to set up the keyring password.\n\nEx :\n`export PRICE_FEEDER_PASS=keyringPassword`\n\nIf this environment variable is not set, the price feeder will prompt the user for input.\n\n## Integration tests\n\nIn order to run the integration price test you need to add the coinmarketcap api environment variable.\nSign up for a free account [here](https://coinmarketcap.com/api/) and export the api key.\n\nEx :\n`export COINMARKETCAP_API_KEY=yourApiKey`\n`make test-integration`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojo-network%2Fprice-feeder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fojo-network%2Fprice-feeder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fojo-network%2Fprice-feeder/lists"}