diff --git a/cmd/types.go b/cmd/types.go index 48c6d1a..5a7a7e9 100644 --- a/cmd/types.go +++ b/cmd/types.go @@ -14,10 +14,7 @@ import ( sdktx "github.com/cosmos/cosmos-sdk/types/tx" ) -const ( - loggerTagPrefix = "feed_%s_%d" - baseCurrency = "USDT" -) +const loggerTagPrefix = "feed_%s_%d" type priceFetcher interface { GetLatestPrice(source, token string) (fetchertypes.PriceInfo, error) diff --git a/fetcher/chainlink/chainlink.go b/fetcher/chainlink/chainlink.go index fccbbcf..903affb 100644 --- a/fetcher/chainlink/chainlink.go +++ b/fetcher/chainlink/chainlink.go @@ -16,7 +16,12 @@ import ( "github.com/ethereum/go-ethereum/ethclient" ) +const baseCurrency = "usdt" + func (s *source) fetch(token string) (*fetchertypes.PriceInfo, error) { + if !strings.HasSuffix(token, baseCurrency) { + token += baseCurrency + } chainlinkPriceFeedProxy, ok := s.chainlinkProxy.get(token) if !ok { return nil, feedertypes.ErrSourceTokenNotConfigured.Wrap(fmt.Sprintf("chainlinkProxy not configured for token: %s", token))