Skip to content

Commit

Permalink
Merge branch 'main' into adam/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
toteki authored Aug 30, 2022
2 parents f19ad73 + cdb582c commit d69a209
Show file tree
Hide file tree
Showing 11 changed files with 470 additions and 13 deletions.
1 change: 1 addition & 0 deletions price-feeder/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- [#1175](https://github.com/umee-network/umee/pull/1175) Add ProviderName type to facilitate the reading of maps.
- [#1215](https://github.com/umee-network/umee/pull/1215) Moved ProviderName to Name in provider package.
- [#1274](https://github.com/umee-network/umee/pull/1274) Add option to set config by env variables.
- [#1299](https://github.com/umee-network/umee/pull/1299) Add FTX as a provider.

## [v0.2.5](https://github.com/umee-network/umee/releases/tag/price-feeder%2Fv0.2.5) - 2022-07-28

Expand Down
1 change: 1 addition & 0 deletions price-feeder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ The list of current supported providers:

- [Binance](https://www.binance.com/en)
- [Coinbase](https://www.coinbase.com/)
- [FTX](https://ftx.com/)
- [Gate](https://www.gate.io/)
- [Huobi](https://www.huobi.com/en-us/)
- [Kraken](https://www.kraken.com/en-us/)
Expand Down
1 change: 1 addition & 0 deletions price-feeder/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (
provider.ProviderHuobi: {},
provider.ProviderGate: {},
provider.ProviderCoinbase: {},
provider.ProviderFTX: {},
provider.ProviderMock: {},
}

Expand Down
4 changes: 3 additions & 1 deletion price-feeder/oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ func GetComputedPrices(
providerPairs map[provider.Name][]types.CurrencyPair,
deviations map[string]sdk.Dec,
) (prices map[string]sdk.Dec, err error) {

// convert any non-USD denominated candles into USD
convertedCandles, err := convertCandlesToUSD(
logger,
Expand Down Expand Up @@ -467,6 +466,9 @@ func NewProvider(
case provider.ProviderGate:
return provider.NewGateProvider(ctx, logger, endpoint, providerPairs...)

case provider.ProviderFTX:
return provider.NewFTXProvider(ctx, logger, endpoint, providerPairs...), nil

case provider.ProviderMock:
return provider.NewMockProvider(), nil
}
Expand Down
4 changes: 2 additions & 2 deletions price-feeder/oracle/provider/coinbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
coinbasePingCheck = time.Second * 28 // should be < 30
coinbaseRestHost = "https://api.exchange.coinbase.com"
coinbaseRestPath = "/products"
timeLayout = "2006-01-02T15:04:05.000000Z"
coinbaseTimeFmt = "2006-01-02T15:04:05.000000Z"
unixMinute = 60000
)

Expand Down Expand Up @@ -408,7 +408,7 @@ func (p *CoinbaseProvider) messageReceived(messageType int, bz []byte) {

// timeToUnix converts a Time in format "2006-01-02T15:04:05.000000Z" to unix
func (tr CoinbaseTradeResponse) timeToUnix() int64 {
t, err := time.Parse(timeLayout, tr.Time)
t, err := time.Parse(coinbaseTimeFmt, tr.Time)
if err != nil {
return 0
}
Expand Down
Loading

0 comments on commit d69a209

Please sign in to comment.