Skip to content

Commit

Permalink
Merge tag 'v0.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
tombeynon committed Oct 5, 2023
2 parents 74c6179 + 2c87920 commit ccddd88
Show file tree
Hide file tree
Showing 7 changed files with 635 additions and 78 deletions.
37 changes: 28 additions & 9 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
# v0.6.x
# Upgrade

## Breaking Changes
## v0.7.x

### derivative
### Breaking Changes

#### osmosisv2

This provider has been reworked to support all available Osmosis pools. Therefore it is necessary to provide a map of the pairs and their corresponfing pool id in `config.toml`:

Example:

```toml
[contract_addresses.osmosisv2]
STATOMATOM = "1136"
STOSMOOSMO = "833"
MNTAOSMO = "1215"
```

## v0.6.x

### Breaking Changes

#### derivative

The derivative `tvwap` has been renamed to `twap`. Please replace all occurances of `derivative = "tvwap"` with `derivative = "twap"` in the config.

# v0.5.x
## v0.5.x

## Breaking Changes
### Breaking Changes

### provider_min_override
#### provider_min_override

This option has been replaced by `provider_min_overrides` (plural). Please remove `provider_min_override` from your config, if set.

### provider_min_overrides
#### provider_min_overrides

This option defines how many different sources need to provide a valid price in order to use it for price conversions and to be submitted to the chain. The default value for every asset is `3`. Please set it to `1` for every asset with only one available source:

```
```toml
[[provider_min_overrides]]
denoms = ["KUJI", "MNTA", "STATOM", "STOSMO", "USK", "WINK"]
providers = 1
```
```
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ var (
provider.ProviderBkex: {},
provider.ProviderBitmart: {},
provider.ProviderBitstamp: {},
provider.ProviderCamelotV2: {},
provider.ProviderCamelotV3: {},
provider.ProviderFin: {},
provider.ProviderFinV2: {},
provider.ProviderPoloniex: {},
Expand Down
5 changes: 2 additions & 3 deletions oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ func (o *Oracle) SetPrices(ctx context.Context) error {
telemetry.IncrCounter(1, "failure", "provider", "type", "ticker")
errCh <- err
}

}()

select {
Expand Down Expand Up @@ -315,7 +314,6 @@ func (o *Oracle) SetPrices(ctx context.Context) error {
for _, pair := range pairs {
symbol := pair.String()
tickerPrices, err := o.derivatives[name].GetPrices(symbol)

if err != nil {
// o.logger.Err(err).Msg("failed to get derivative price")
continue
Expand Down Expand Up @@ -380,7 +378,6 @@ func GetComputedPrices(
deviations map[string]sdk.Dec,
providerMinOverrides map[string]int,
) (prices map[string]sdk.Dec, err error) {

rates, err := convertTickersToUSD(
logger,
providerPrices,
Expand Down Expand Up @@ -465,6 +462,8 @@ func NewProvider(
return provider.NewBitmartProvider(ctx, providerLogger, endpoint, providerPairs...)
case provider.ProviderBybit:
return provider.NewBybitProvider(ctx, providerLogger, endpoint, providerPairs...)
case provider.ProviderCamelotV2, provider.ProviderCamelotV3:
return provider.NewCamelotProvider(ctx, providerLogger, endpoint, providerPairs...)
case provider.ProviderCoinbase:
return provider.NewCoinbaseProvider(ctx, providerLogger, endpoint, providerPairs...)
case provider.ProviderCrypto:
Expand Down
Loading

0 comments on commit ccddd88

Please sign in to comment.