Skip to content

Commit

Permalink
docs: update config documentation + note about Binance US (#378) (#379)
Browse files Browse the repository at this point in the history
* docs: update config documentation + note about Binance US (#378)

* docs: update config documentation + note about Binance US

* lint

* cleanup
  • Loading branch information
robert-zaremba authored Apr 25, 2024
1 parent 1439f73 commit 2ec3d92
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ core differences are as follows:

## Forks - Other Projects that use the Ojo Price Feeder

* [Kujira](https://github.com/team-kujira/oracle-price-feeder)
* [Sei](https://github.com/sei-protocol/sei-chain/tree/master/oracle/price-feeder)
- [Kujira](https://github.com/team-kujira/oracle-price-feeder)
- [Sei](https://github.com/sei-protocol/sei-chain/tree/master/oracle/price-feeder)

## Background

Expand Down Expand Up @@ -71,28 +71,35 @@ Chain rules for checking the free oracle transactions are:
So, 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.
The easiest is to just set constant gas. We recommend 10k below the `MaxMsgGasUsage`.

Note that either `gas_adjustment` or `gas` can be used. Both can not be set.
In the PF config file you can set either:

- `gas_adjustment`
- or `gas_prevote` and `gas_vote` - fixed amount of gas used for `MsgAggregateExchangeRatePrevote` and `MsgAggregateExchangeRateVote` transactions respectively.

## Configuration

### `telemetry`
Copy the `price-feeder.example.toml` file to `price-feeder.toml` and update accordingly.

A 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).
### `config_dir`

### `deviation`
Price 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`:

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.
- `currencty-pairs.toml`
- `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.
- `endpoints.toml`: enables validators to setup their own API endpoints for a given provider.

### `provider_endpoints`
Depending where you run your validator node, certain locations may block some endpoints. Make sure you read through the comments in the config file.

The provider_endpoints option enables validators to setup their own API endpoints for a given provider.
### `telemetry`

A 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).

### `server`

The `server` section contains configuration pertaining to the API served by the
`price-feeder` process such the listening address and various HTTP timeouts.

### `currency_pairs`
### `currency_pairs.toml` file

The `currency_pairs` sections contains one or more exchange rates along with the
providers from which to get market data from. It is important to note that the
Expand Down
5 changes: 5 additions & 0 deletions ojo-provider-config/endpoints.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
name = "binance"
rest = "https://api1.binance.com"
websocket = "stream.binance.com:9443"

## If you observe the following error: "ERR failed to initialize binance provider" then most likely
## someone is blocking your connection. In such case, try to use the Binance US API instead:
# rest = "https://api.binance.us"
# websocket = "stream.binance.us:9443"

0 comments on commit 2ec3d92

Please sign in to comment.