From f1c10f9048c3aa299460f98d1adacbd0bcc71eb2 Mon Sep 17 00:00:00 2001 From: Starsquid <108214377+starsquidnodes@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:41:35 +0200 Subject: [PATCH 1/2] Remove USDC rewrite --- oracle/provider/fin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oracle/provider/fin.go b/oracle/provider/fin.go index 0591dcd..d571a72 100644 --- a/oracle/provider/fin.go +++ b/oracle/provider/fin.go @@ -37,8 +37,8 @@ type ( BaseVolume string `json:"base_volume"` // ex.: "4875.4890980000" QuoteVolume string `json:"target_volume"` // ex.: "4875.4890980000" Base string `json:"base_currency"` // ex.: "LUNA" - Quote string `json:"target_currency"` // ex.: "axlUSDC" - Symbol string `json:"ticker_id"` // ex.: "LUNA_axlUSDC" + Quote string `json:"target_currency"` // ex.: "USDC" + Symbol string `json:"ticker_id"` // ex.: "LUNA_USDC" } ) @@ -123,8 +123,8 @@ func (p *FinProvider) GetAvailablePairs() (map[string]struct{}, error) { func currencyPairToFinSymbol(pair types.CurrencyPair) string { mapping := map[string]string{ - "USDC": "axlUSDC", "USDT": "axlUSDT", + "DYM": "ADYM", } base, found := mapping[pair.Base] From 547d49e0ff572a5899464be4d76b4231bd6b40b0 Mon Sep 17 00:00:00 2001 From: Starsquid <108214377+starsquidnodes@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:35:23 +0200 Subject: [PATCH 2/2] Use uppercase symbols --- oracle/provider/fin.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/oracle/provider/fin.go b/oracle/provider/fin.go index d571a72..2991465 100644 --- a/oracle/provider/fin.go +++ b/oracle/provider/fin.go @@ -3,6 +3,7 @@ package provider import ( "context" "encoding/json" + "strings" "time" "price-feeder/oracle/types" @@ -77,6 +78,10 @@ func (p *FinProvider) getTickers() (FinTickersResponse, error) { return FinTickersResponse{}, err } + for i, ticker := range tickersResponse.Tickers { + tickersResponse.Tickers[i].Symbol = strings.ToUpper(ticker.Symbol) + } + return tickersResponse, nil } @@ -123,7 +128,7 @@ func (p *FinProvider) GetAvailablePairs() (map[string]struct{}, error) { func currencyPairToFinSymbol(pair types.CurrencyPair) string { mapping := map[string]string{ - "USDT": "axlUSDT", + "USDT": "AXLUSDT", "DYM": "ADYM", }