From 4e159c417823a56c8592a7132b18c33112ec99a1 Mon Sep 17 00:00:00 2001 From: David Terpay Date: Tue, 9 Apr 2024 19:23:09 -0400 Subject: [PATCH] remove GetProvider --- cmd/slinky-config/main.go | 5 +- oracle/oracle_test.go | 6 +- oracle/orchestrator/helpers_test.go | 8 +- oracle/types/market.go | 5 +- oracle/types/market_test.go | 2 - oracle/types/provider.go | 11 +-- providers/apis/binance/utils.go | 74 ------------------- providers/apis/coinbase/utils.go | 56 -------------- providers/apis/coingecko/utils.go | 8 -- .../apis/defi/raydium/price_fetcher_test.go | 4 - providers/apis/defi/uniswapv3/fetcher_test.go | 12 +-- providers/apis/defi/uniswapv3/helper_test.go | 2 +- providers/apis/geckoterminal/utils.go | 2 - providers/apis/kraken/utils.go | 51 ------------- providers/volatile/api_handler_test.go | 4 +- providers/websockets/bitfinex/utils.go | 5 -- providers/websockets/bitstamp/utils.go | 9 --- providers/websockets/bybit/utils.go | 29 -------- providers/websockets/coinbase/utils.go | 46 ------------ providers/websockets/cryptodotcom/utils.go | 17 ----- providers/websockets/gate/utils.go | 33 --------- providers/websockets/huobi/utils.go | 26 ------- providers/websockets/kraken/utils.go | 37 ---------- providers/websockets/kucoin/utils.go | 43 ----------- providers/websockets/mexc/utils.go | 41 ---------- providers/websockets/okx/utils.go | 54 -------------- 26 files changed, 21 insertions(+), 569 deletions(-) diff --git a/cmd/slinky-config/main.go b/cmd/slinky-config/main.go index 03ca613ac..49e8e50df 100644 --- a/cmd/slinky-config/main.go +++ b/cmd/slinky-config/main.go @@ -449,7 +449,7 @@ func createMarketMap() error { // Iterate through all of the provider ticker configurations and update the // tickers and tickers to providers maps. - for _, providerConfig := range ProviderToMarkets { + for provider, providerConfig := range ProviderToMarkets { for cp, config := range providerConfig { ticker := mmtypes.Ticker{ CurrencyPair: cp, @@ -467,7 +467,7 @@ func createMarketMap() error { market := marketMap.Markets[ticker.String()] market.ProviderConfigs = append(market.ProviderConfigs, mmtypes.ProviderConfig{ - Name: config.Name, + Name: provider, OffChainTicker: config.OffChainTicker, Metadata_JSON: config.JSON, }) @@ -541,7 +541,6 @@ func addRaydiumMarkets(providerToMarkets map[string]types.CurrencyPairsToProvide providerToMarkets[raydium.Name] = make(types.CurrencyPairsToProviderTickers) for _, pair := range raydiumPairs { providerToMarkets[raydium.Name][pair.Cp] = types.DefaultProviderTicker{ - Name: raydium.Name, OffChainTicker: pair.Cp.String(), JSON: marshalToJSONString(pair.TickerMetaData), } diff --git a/oracle/oracle_test.go b/oracle/oracle_test.go index dedf76698..d48a1df47 100644 --- a/oracle/oracle_test.go +++ b/oracle/oracle_test.go @@ -66,8 +66,8 @@ func (s *OracleTestSuite) SetupTest() { s.logger = zap.NewExample() s.currencyPairs = []types.ProviderTicker{ - types.NewProviderTicker("test", "BTC/USD", "{}"), - types.NewProviderTicker("test", "ETH/USD", "{}"), - types.NewProviderTicker("test", "ATOM/USD", "{}"), + types.NewProviderTicker("BTC/USD", "{}"), + types.NewProviderTicker("ETH/USD", "{}"), + types.NewProviderTicker("ATOM/USD", "{}"), } } diff --git a/oracle/orchestrator/helpers_test.go b/oracle/orchestrator/helpers_test.go index a7bd75014..baa930eba 100644 --- a/oracle/orchestrator/helpers_test.go +++ b/oracle/orchestrator/helpers_test.go @@ -163,8 +163,8 @@ var ( Decimals: 8, }, ProviderConfigs: []mmtypes.ProviderConfig{ - coinbase.DefaultMarketConfig.MustGetProviderConfig(constants.BITCOIN_USD), - okx.DefaultMarketConfig.MustGetProviderConfig(constants.BITCOIN_USD), + coinbase.DefaultMarketConfig.MustGetProviderConfig(coinbase.Name, constants.BITCOIN_USD), + okx.DefaultMarketConfig.MustGetProviderConfig(okx.Name, constants.BITCOIN_USD), }, }, constants.ETHEREUM_USD.String(): { @@ -174,8 +174,8 @@ var ( Decimals: 8, }, ProviderConfigs: []mmtypes.ProviderConfig{ - coinbase.DefaultMarketConfig.MustGetProviderConfig(constants.ETHEREUM_USD), - okx.DefaultMarketConfig.MustGetProviderConfig(constants.ETHEREUM_USD), + coinbase.DefaultMarketConfig.MustGetProviderConfig(coinbase.Name, constants.ETHEREUM_USD), + okx.DefaultMarketConfig.MustGetProviderConfig(okx.Name, constants.ETHEREUM_USD), }, }, }, diff --git a/oracle/types/market.go b/oracle/types/market.go index c32ab85ac..9153f92d7 100644 --- a/oracle/types/market.go +++ b/oracle/types/market.go @@ -37,7 +37,6 @@ func ProviderTickersFromMarketMap( } providerTicker := NewProviderTicker( - cfg.Name, cfg.OffChainTicker, cfg.Metadata_JSON, ) @@ -78,10 +77,10 @@ func (tpt CurrencyPairsToProviderTickers) MustGetProviderTicker(cp pkgtypes.Curr // MustGetProviderConfig returns the provider config for the given currency pair. // This function is mostly used for testing. -func (tpt CurrencyPairsToProviderTickers) MustGetProviderConfig(cp pkgtypes.CurrencyPair) mmtypes.ProviderConfig { +func (tpt CurrencyPairsToProviderTickers) MustGetProviderConfig(name string, cp pkgtypes.CurrencyPair) mmtypes.ProviderConfig { providerTicker := tpt.MustGetProviderTicker(cp) return mmtypes.ProviderConfig{ - Name: providerTicker.GetProvider(), + Name: name, OffChainTicker: providerTicker.GetOffChainTicker(), Metadata_JSON: providerTicker.GetJSON(), } diff --git a/oracle/types/market_test.go b/oracle/types/market_test.go index fd90844ce..d870aed4f 100644 --- a/oracle/types/market_test.go +++ b/oracle/types/market_test.go @@ -55,7 +55,6 @@ func TestProviderTickersFromMarketMap(t *testing.T) { }, expected: []types.ProviderTicker{ types.NewProviderTicker( - "test", "BTC/USDT", "{}", ), @@ -120,7 +119,6 @@ func TestProviderTickersFromMarketMap(t *testing.T) { }, expected: []types.ProviderTicker{ types.NewProviderTicker( - "test", "ETH/USDT", "{}", ), diff --git a/oracle/types/provider.go b/oracle/types/provider.go index e4c3f4d19..c0d30af60 100644 --- a/oracle/types/provider.go +++ b/oracle/types/provider.go @@ -10,8 +10,6 @@ type ( ProviderTicker interface { fmt.Stringer - // GetProvider returns the provider for the ticker. - GetProvider() string // GetOffChainTicker returns the off-chain representation for the ticker. GetOffChainTicker() string // GetJSON returns additional JSON data for the ticker. @@ -22,7 +20,6 @@ type ( // Provider's that utilize this implementation should be able to easily configure // custom json data for their tickers. DefaultProviderTicker struct { - Name string OffChainTicker string JSON string } @@ -37,20 +34,14 @@ type ( // NewProviderTicker returns a new provider ticker. func NewProviderTicker( - provider, offChain, json string, + offChain, json string, ) ProviderTicker { return DefaultProviderTicker{ - Name: provider, OffChainTicker: offChain, JSON: json, } } -// Provider returns the provider for the ticker. -func (t DefaultProviderTicker) GetProvider() string { - return t.Name -} - // OffChainTicker returns the off-chain representation for the ticker. func (t DefaultProviderTicker) GetOffChainTicker() string { return t.OffChainTicker diff --git a/providers/apis/binance/utils.go b/providers/apis/binance/utils.go index b0254a2c6..aec9449e7 100644 --- a/providers/apis/binance/utils.go +++ b/providers/apis/binance/utils.go @@ -63,143 +63,108 @@ var ( // DefaultUSMarketConfig is the default US market configuration for Binance. DefaultUSMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USDT: { - Name: Name, OffChainTicker: "APEUSDT", }, constants.APTOS_USDT: { - Name: Name, OffChainTicker: "APTUSDT", }, constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "ARBUSDT", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOMUSDT", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAXUSDT", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCHUSDT", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "BTCUSDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTCUSDT", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADAUSDT", }, constants.CHAINLINK_USDT: { - Name: Name, OffChainTicker: "LINKUSDT", }, constants.COMPOUND_USDT: { - Name: Name, OffChainTicker: "COMPUSDT", }, constants.CURVE_USDT: { - Name: Name, OffChainTicker: "CRVUSDT", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "DOGEUSDT", }, constants.ETC_USDT: { - Name: Name, OffChainTicker: "ETCUSDT", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETHBTC", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETHUSDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETHUSDT", }, constants.FILECOIN_USDT: { - Name: Name, OffChainTicker: "FILUSDT", }, constants.LIDO_USDT: { - Name: Name, OffChainTicker: "LDOUSDT", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "LTCUSDT", }, constants.MAKER_USDT: { - Name: Name, OffChainTicker: "MKRUSDT", }, constants.NEAR_USDT: { - Name: Name, OffChainTicker: "NEARUSDT", }, constants.OPTIMISM_USDT: { - Name: Name, OffChainTicker: "OPUSDT", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOTUSDT", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRPUSDT", }, constants.SEI_USDT: { - Name: Name, OffChainTicker: "SEIUSDT", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIBUSDT", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOLUSDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOLUSDT", }, constants.STELLAR_USDT: { - Name: Name, OffChainTicker: "XLMUSDT", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "SUIUSDT", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "TRXUSDT", }, constants.UNISWAP_USDT: { - Name: Name, OffChainTicker: "UNIUSDT", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDCUSDT", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "WLDUSDT", }, } @@ -207,159 +172,120 @@ var ( // DefaultNonUSMarketConfig is the default market configuration for Binance. DefaultNonUSMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USDT: { - Name: Name, OffChainTicker: "APEUSDT", }, constants.APTOS_USDT: { - Name: Name, OffChainTicker: "APTUSDT", }, constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "ARBUSDT", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOMUSDT", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAXUSDT", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCHUSDT", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "BTCUSDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTCUSDT", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADAUSDT", }, constants.CHAINLINK_USDT: { - Name: Name, OffChainTicker: "LINKUSDT", }, constants.COMPOUND_USDT: { - Name: Name, OffChainTicker: "COMPUSDT", }, constants.CURVE_USDT: { - Name: Name, OffChainTicker: "CRVUSDT", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "DOGEUSDT", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDXUSDT", }, constants.ETC_USDT: { - Name: Name, OffChainTicker: "ETCUSDT", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETHBTC", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETHUSDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETHUSDT", }, constants.FILECOIN_USDT: { - Name: Name, OffChainTicker: "FILUSDT", }, constants.LIDO_USDT: { - Name: Name, OffChainTicker: "LDOUSDT", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "LTCUSDT", }, constants.MAKER_USDT: { - Name: Name, OffChainTicker: "MKRUSDT", }, constants.NEAR_USDT: { - Name: Name, OffChainTicker: "NEARUSDT", }, constants.OPTIMISM_USDT: { - Name: Name, OffChainTicker: "OPUSDT", }, constants.PEPE_USDT: { - Name: Name, OffChainTicker: "PEPEUSDT", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOTUSDT", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "MATICUSDT", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRPUSDT", }, constants.SEI_USDT: { - Name: Name, OffChainTicker: "SEIUSDT", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIBUSDT", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOLUSDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOLUSDT", }, constants.STELLAR_USDT: { - Name: Name, OffChainTicker: "XLMUSDT", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "SUIUSDT", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "TRXUSDT", }, constants.UNISWAP_USDT: { - Name: Name, OffChainTicker: "UNIUSDT", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDCUSDT", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "USDTUSD", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "WLDUSDT", }, } diff --git a/providers/apis/coinbase/utils.go b/providers/apis/coinbase/utils.go index 9f29d1a1a..360dd78f8 100644 --- a/providers/apis/coinbase/utils.go +++ b/providers/apis/coinbase/utils.go @@ -37,227 +37,171 @@ var ( // DefaultMarketConfig is the default market configuration for Coinbase. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USD: { - Name: Name, OffChainTicker: "APE-USD", }, constants.APE_USDC: { - Name: Name, OffChainTicker: "APE-USDC", }, constants.APE_USDT: { - Name: Name, OffChainTicker: "APE-USDT", }, constants.APTOS_USD: { - Name: Name, OffChainTicker: "APT-USD", }, constants.ARBITRUM_USD: { - Name: Name, OffChainTicker: "ARB-USD", }, constants.ATOM_USD: { - Name: Name, OffChainTicker: "ATOM-USD", }, constants.ATOM_USDC: { - Name: Name, OffChainTicker: "ATOM-USDC", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOM-USDT", }, constants.AVAX_USD: { - Name: Name, OffChainTicker: "AVAX-USD", }, constants.AVAX_USDC: { - Name: Name, OffChainTicker: "AVAX-USDC", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAX-USDT", }, constants.BCH_USD: { - Name: Name, OffChainTicker: "BCH-USD", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "BTC-USD", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTC-USDT", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "BTC-USDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTC-USDT", }, constants.BLUR_USD: { - Name: Name, OffChainTicker: "BLUR-USD", }, constants.CARDANO_USD: { - Name: Name, OffChainTicker: "ADA-USD", }, constants.CELESTIA_USD: { - Name: Name, OffChainTicker: "TIA-USD", }, constants.CELESTIA_USDC: { - Name: Name, OffChainTicker: "TIA-USDC", }, constants.CELESTIA_USDT: { - Name: Name, OffChainTicker: "TIA-USDT", }, constants.CHAINLINK_USD: { - Name: Name, OffChainTicker: "LINK-USD", }, constants.COMPOUND_USD: { - Name: Name, OffChainTicker: "COMP-USD", }, constants.CURVE_USD: { - Name: Name, OffChainTicker: "CRV-USD", }, constants.DOGE_USD: { - Name: Name, OffChainTicker: "DOGE-USD", }, constants.DYDX_USD: { - Name: Name, OffChainTicker: "DYDX-USD", }, constants.DYDX_USDC: { - Name: Name, OffChainTicker: "DYDX-USDC", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDX-USDT", }, constants.ETC_USD: { - Name: Name, OffChainTicker: "ETC-USD", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETH-BTC", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ETH-USD", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETH-USDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETH-USDT", }, constants.FILECOIN_USD: { - Name: Name, OffChainTicker: "FIL-USD", }, constants.LIDO_USD: { - Name: Name, OffChainTicker: "LDO-USD", }, constants.LITECOIN_USD: { - Name: Name, OffChainTicker: "LTC-USD", }, constants.MAKER_USD: { - Name: Name, OffChainTicker: "MKR-USD", }, constants.NEAR_USD: { - Name: Name, OffChainTicker: "NEAR-USD", }, constants.OPTIMISM_USD: { - Name: Name, OffChainTicker: "OP-USD", }, constants.OSMOSIS_USD: { - Name: Name, OffChainTicker: "OSMO-USD", }, constants.OSMOSIS_USDC: { - Name: Name, OffChainTicker: "OSMO-USDC", }, constants.OSMOSIS_USDT: { - Name: Name, OffChainTicker: "OSMO-USDT", }, constants.POLKADOT_USD: { - Name: Name, OffChainTicker: "DOT-USD", }, constants.POLYGON_USD: { - Name: Name, OffChainTicker: "MATIC-USD", }, constants.RIPPLE_USD: { - Name: Name, OffChainTicker: "XRP-USD", }, constants.SEI_USD: { - Name: Name, OffChainTicker: "SEI-USD", }, constants.SHIBA_USD: { - Name: Name, OffChainTicker: "SHIB-USD", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "SOL-USD", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOL-USDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOL-USDT", }, constants.STELLAR_USD: { - Name: Name, OffChainTicker: "XLM-USD", }, constants.SUI_USD: { - Name: Name, OffChainTicker: "SUI-USD", }, constants.UNISWAP_USD: { - Name: Name, OffChainTicker: "UNI-USD", }, constants.USDC_USD: { - Name: Name, OffChainTicker: "USDC-USD", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDC-USDT", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "USDT-USD", }, } diff --git a/providers/apis/coingecko/utils.go b/providers/apis/coingecko/utils.go index 622dfba26..9a73f4156 100644 --- a/providers/apis/coingecko/utils.go +++ b/providers/apis/coingecko/utils.go @@ -55,35 +55,27 @@ var ( // DefaultMarketConfig is the default market configuration for CoinGecko. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.ATOM_USD: { - Name: Name, OffChainTicker: "cosmos/usd", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "bitcoin/usd", }, constants.CELESTIA_USD: { - Name: Name, OffChainTicker: "celestia/usd", }, constants.DYDX_USD: { - Name: Name, OffChainTicker: "dydx-chain/usd", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ethereum/btc", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ethereum/usd", }, constants.OSMOSIS_USD: { - Name: Name, OffChainTicker: "osmosis/usd", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "solana/usd", }, } diff --git a/providers/apis/defi/raydium/price_fetcher_test.go b/providers/apis/defi/raydium/price_fetcher_test.go index 97c59f67e..9a366438a 100644 --- a/providers/apis/defi/raydium/price_fetcher_test.go +++ b/providers/apis/defi/raydium/price_fetcher_test.go @@ -182,17 +182,14 @@ func TestProviderFetch(t *testing.T) { tickers := []types.DefaultProviderTicker{ { - Name: raydium.Name, OffChainTicker: "BTC/USDC", JSON: marshalDataToJSON(btcUSDCMetadata), }, { - Name: raydium.Name, OffChainTicker: "ETH/USDT", JSON: marshalDataToJSON(ethUSDTMetadata), }, { - Name: raydium.Name, OffChainTicker: "MOG/SOL", JSON: marshalDataToJSON(mogSOLMetadata), }, @@ -257,7 +254,6 @@ func TestProviderFetch(t *testing.T) { ctx := context.Background() mogtia := types.DefaultProviderTicker{ - Name: raydium.Name, OffChainTicker: "MOG/TIA", JSON: "{}", } diff --git a/providers/apis/defi/uniswapv3/fetcher_test.go b/providers/apis/defi/uniswapv3/fetcher_test.go index 513ba405f..34e5ba836 100644 --- a/providers/apis/defi/uniswapv3/fetcher_test.go +++ b/providers/apis/defi/uniswapv3/fetcher_test.go @@ -38,7 +38,7 @@ func TestFetch(t *testing.T) { { name: "fails to retrieve pool for an empty ticker", tickers: []types.ProviderTicker{ - types.NewProviderTicker(uniswapv3.Name, "WETH/USDC", ""), + types.NewProviderTicker("WETH/USDC", ""), }, client: func() uniswapv3.EVMClient { return mocks.NewEVMClient(t) @@ -46,7 +46,7 @@ func TestFetch(t *testing.T) { expected: types.PriceResponse{ Resolved: map[types.ProviderTicker]providertypes.ResolvedResult[*big.Float]{}, UnResolved: map[types.ProviderTicker]providertypes.UnresolvedResult{ - types.NewProviderTicker(uniswapv3.Name, "WETH/USDC", ""): {}, + types.NewProviderTicker("WETH/USDC", ""): {}, }, }, }, @@ -156,7 +156,7 @@ func TestGetPool(t *testing.T) { fetcher := createPriceFetcher(t) t.Run("ticker is empty", func(t *testing.T) { - ticker := types.NewProviderTicker(uniswapv3.Name, "", "") + ticker := types.NewProviderTicker("", "") _, err := fetcher.GetPool(ticker) require.Error(t, err) }) @@ -165,13 +165,13 @@ func TestGetPool(t *testing.T) { expected := uniswapv3.PoolConfig{ Address: "0x1234", } - ticker := types.NewProviderTicker(uniswapv3.Name, "WETH/USDC", expected.MustToJSON()) + ticker := types.NewProviderTicker("WETH/USDC", expected.MustToJSON()) _, err := fetcher.GetPool(ticker) require.Error(t, err) }) t.Run("ticker is not json formatted", func(t *testing.T) { - ticker := types.NewProviderTicker(uniswapv3.Name, "WETH/USDC", "not json, something else") + ticker := types.NewProviderTicker("WETH/USDC", "not json, something else") _, err := fetcher.GetPool(ticker) require.Error(t, err) }) @@ -183,7 +183,7 @@ func TestGetPool(t *testing.T) { QuoteDecimals: 6, Invert: true, } - ticker := types.NewProviderTicker(uniswapv3.Name, "WETH/USDC", expected.MustToJSON()) + ticker := types.NewProviderTicker("WETH/USDC", expected.MustToJSON()) pool, err := fetcher.GetPool(ticker) require.NoError(t, err) require.Equal(t, expected, pool) diff --git a/providers/apis/defi/uniswapv3/helper_test.go b/providers/apis/defi/uniswapv3/helper_test.go index 302d8b903..96d9e6c95 100644 --- a/providers/apis/defi/uniswapv3/helper_test.go +++ b/providers/apis/defi/uniswapv3/helper_test.go @@ -25,7 +25,7 @@ var ( } // Tickers used for testing. - wethusdcTicker = types.NewProviderTicker(uniswapv3.Name, "WETH/USDC", wethusdcCfg.MustToJSON()) + wethusdcTicker = types.NewProviderTicker("WETH/USDC", wethusdcCfg.MustToJSON()) ) func createPriceFetcher( diff --git a/providers/apis/geckoterminal/utils.go b/providers/apis/geckoterminal/utils.go index 4fd797ef0..f76b8a6aa 100644 --- a/providers/apis/geckoterminal/utils.go +++ b/providers/apis/geckoterminal/utils.go @@ -44,11 +44,9 @@ var ( // Ethereum mainnet. DefaultETHMarketConfig = types.CurrencyPairsToProviderTickers{ constants.MOG_USD: { - Name: Name, OffChainTicker: "0xaaee1a9723aadb7afa2810263653a34ba2c21c7a", }, constants.PEPE_USD: { - Name: Name, OffChainTicker: "0x6982508145454Ce325dDbE47a25d4ec3d2311933", }, } diff --git a/providers/apis/kraken/utils.go b/providers/apis/kraken/utils.go index 8be4a9f0f..fc7b05227 100644 --- a/providers/apis/kraken/utils.go +++ b/providers/apis/kraken/utils.go @@ -42,207 +42,156 @@ var ( // DefaultMarketConfig is the default market configuration for Kraken. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USDT: { - Name: Name, OffChainTicker: "APEUSDT", }, constants.APTOS_USD: { - Name: Name, OffChainTicker: "APTUSD", }, constants.ARBITRUM_USD: { - Name: Name, OffChainTicker: "ARBUSD", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOMUSDT", }, constants.ATOM_USD: { - Name: Name, OffChainTicker: "ATOMUSD", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAXUSDT", }, constants.AVAX_USD: { - Name: Name, OffChainTicker: "AVAXUSD", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCHUSDT", }, constants.BCH_USD: { - Name: Name, OffChainTicker: "BCHUSD", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "XBTUSDC", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "XXBTZUSD", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "XBTUSDT", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADAUSDT", }, constants.CARDANO_USD: { - Name: Name, OffChainTicker: "ADAUSD", }, constants.CHAINLINK_USDT: { - Name: Name, OffChainTicker: "LINKUSDT", }, constants.CHAINLINK_USD: { - Name: Name, OffChainTicker: "LINKUSD", }, constants.COMPOUND_USD: { - Name: Name, OffChainTicker: "COMPUSD", }, constants.CURVE_USD: { - Name: Name, OffChainTicker: "CRVUSD", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "XDGUSDT", }, constants.DOGE_USD: { - Name: Name, OffChainTicker: "XDGUSD", }, constants.DYDX_USD: { - Name: Name, OffChainTicker: "DYDXUSD", }, constants.ETC_USD: { - Name: Name, OffChainTicker: "ETCUSD", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "XETHXXBT", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETHUSDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETHUSDT", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "XETHZUSD", }, constants.FILECOIN_USD: { - Name: Name, OffChainTicker: "FILUSD", }, constants.LIDO_USD: { - Name: Name, OffChainTicker: "LDOUSD", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "LTCUSDT", }, constants.LITECOIN_USD: { - Name: Name, OffChainTicker: "XLTCZUSD", }, constants.MAKER_USD: { - Name: Name, OffChainTicker: "MKRUSD", }, constants.NEAR_USD: { - Name: Name, OffChainTicker: "NEARUSD", }, constants.OPTIMISM_USD: { - Name: Name, OffChainTicker: "OPUSD", }, constants.PEPE_USD: { - Name: Name, OffChainTicker: "PEPEUSD", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOTUSDT", }, constants.POLKADOT_USD: { - Name: Name, OffChainTicker: "DOTUSD", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "MATICUSDT", }, constants.POLYGON_USD: { - Name: Name, OffChainTicker: "MATICUSD", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRPUSDT", }, constants.RIPPLE_USD: { - Name: Name, OffChainTicker: "XXRPZUSD", }, constants.SEI_USD: { - Name: Name, OffChainTicker: "SEIUSD", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIBUSDT", }, constants.SHIBA_USD: { - Name: Name, OffChainTicker: "SHIBUSD", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOLUSDT", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "SOLUSD", }, constants.STELLAR_USD: { - Name: Name, OffChainTicker: "XXLMZUSD", }, constants.SUI_USD: { - Name: Name, OffChainTicker: "SUIUSD", }, constants.TRON_USD: { - Name: Name, OffChainTicker: "TRXUSD", }, constants.UNISWAP_USD: { - Name: Name, OffChainTicker: "UNIUSD", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDCUSDT", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "USDTZUSD", }, } diff --git a/providers/volatile/api_handler_test.go b/providers/volatile/api_handler_test.go index fe9d3caff..888c7c024 100644 --- a/providers/volatile/api_handler_test.go +++ b/providers/volatile/api_handler_test.go @@ -10,8 +10,8 @@ import ( ) var ( - ticker1 = types.NewProviderTicker("volatile-exchange-url", "foo/bar", "{}") - ticker2 = types.NewProviderTicker("volatile-exchange-url", "foo/baz", "{}") + ticker1 = types.NewProviderTicker("foo/bar", "{}") + ticker2 = types.NewProviderTicker("foo/baz", "{}") ) func setupTest(t *testing.T) types.PriceAPIDataHandler { diff --git a/providers/websockets/bitfinex/utils.go b/providers/websockets/bitfinex/utils.go index 3d3b348c4..5b13ee23b 100644 --- a/providers/websockets/bitfinex/utils.go +++ b/providers/websockets/bitfinex/utils.go @@ -38,23 +38,18 @@ var ( // DefaultMarketConfig is the default market configuration for BitFinex. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "BTCUSD", }, constants.CELESTIA_USD: { - Name: Name, OffChainTicker: "TIAUSD", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETHBTC", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ETHUSD", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "SOLUSD", }, } diff --git a/providers/websockets/bitstamp/utils.go b/providers/websockets/bitstamp/utils.go index 401092c87..cd8f3e651 100644 --- a/providers/websockets/bitstamp/utils.go +++ b/providers/websockets/bitstamp/utils.go @@ -41,39 +41,30 @@ var ( // DefaultMarketConfig returns the default market config for bitstamp. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.AVAX_USD: { - Name: Name, OffChainTicker: "avaxusd", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "btcusd", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "btcusdc", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "btcusdt", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ethbtc", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ethusd", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "solusd", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "usdcusdt", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "usdtusd", }, } diff --git a/providers/websockets/bybit/utils.go b/providers/websockets/bybit/utils.go index 7b4f3df1d..9658e0b13 100644 --- a/providers/websockets/bybit/utils.go +++ b/providers/websockets/bybit/utils.go @@ -48,119 +48,90 @@ var ( // DefaultMarketConfig is the default market configuration for ByBit. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APTOS_USDT: { - Name: Name, OffChainTicker: "APTUSDT", }, constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "ARBUSDT", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOMUSDT", }, constants.AVAX_USDC: { - Name: Name, OffChainTicker: "AVAXUSDC", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAXUSDT", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCHUSDT", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "BTCUSDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTCUSDT", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADAUSDT", }, constants.CHAINLINK_USDT: { - Name: Name, OffChainTicker: "LINKUSDT", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "DOGEUSDT", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDXUSDT", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETHUSDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETHUSDT", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "LTCUSDT", }, constants.PEPE_USDT: { - Name: Name, OffChainTicker: "PEPEUSDT", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOTUSDT", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "MATICUSDT", }, constants.SEI_USDT: { - Name: Name, OffChainTicker: "SEIUSDT", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIBUSDT", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOLUSDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOLUSDT", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "SUIUSDT", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "TRXUSDT", }, constants.UNISWAP_USDT: { - Name: Name, OffChainTicker: "UNIUSDT", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "WLDUSDT", }, constants.STELLAR_USDT: { - Name: Name, OffChainTicker: "XLMUSDT", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRPUSDT", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDCUSDT", }, } diff --git a/providers/websockets/coinbase/utils.go b/providers/websockets/coinbase/utils.go index aa401a9a7..387253dfb 100644 --- a/providers/websockets/coinbase/utils.go +++ b/providers/websockets/coinbase/utils.go @@ -57,187 +57,141 @@ var ( // DefaultMarketConfig is the default market configuration for Coinbase. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USD: { - Name: Name, OffChainTicker: "APE-USD", }, constants.APE_USDT: { - Name: Name, OffChainTicker: "APE-USDT", }, constants.APTOS_USD: { - Name: Name, OffChainTicker: "APT-USD", }, constants.ARBITRUM_USD: { - Name: Name, OffChainTicker: "ARB-USD", }, constants.ATOM_USD: { - Name: Name, OffChainTicker: "ATOM-USD", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOM-USDT", }, constants.AVAX_USD: { - Name: Name, OffChainTicker: "AVAX-USD", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAX-USDT", }, constants.BCH_USD: { - Name: Name, OffChainTicker: "BCH-USD", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "BTC-USD", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTC-USDT", }, constants.BLUR_USD: { - Name: Name, OffChainTicker: "BLUR-USD", }, constants.CARDANO_USD: { - Name: Name, OffChainTicker: "ADA-USD", }, constants.CELESTIA_USD: { - Name: Name, OffChainTicker: "TIA-USD", }, constants.CELESTIA_USDC: { - Name: Name, OffChainTicker: "TIA-USDC", }, constants.CELESTIA_USDT: { - Name: Name, OffChainTicker: "TIA-USDT", }, constants.CHAINLINK_USD: { - Name: Name, OffChainTicker: "LINK-USD", }, constants.COMPOUND_USD: { - Name: Name, OffChainTicker: "COMP-USD", }, constants.CURVE_USD: { - Name: Name, OffChainTicker: "CRV-USD", }, constants.DOGE_USD: { - Name: Name, OffChainTicker: "DOGE-USD", }, constants.ETC_USD: { - Name: Name, OffChainTicker: "ETC-USD", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETH-BTC", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ETH-USD", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETH-USDT", }, constants.FILECOIN_USD: { - Name: Name, OffChainTicker: "FIL-USD", }, constants.LIDO_USD: { - Name: Name, OffChainTicker: "LDO-USD", }, constants.LITECOIN_USD: { - Name: Name, OffChainTicker: "LTC-USD", }, constants.MAKER_USD: { - Name: Name, OffChainTicker: "MKR-USD", }, constants.NEAR_USD: { - Name: Name, OffChainTicker: "NEAR-USD", }, constants.OPTIMISM_USD: { - Name: Name, OffChainTicker: "OP-USD", }, constants.OSMOSIS_USD: { - Name: Name, OffChainTicker: "OSMO-USD", }, constants.OSMOSIS_USDC: { - Name: Name, OffChainTicker: "OSMO-USDC", }, constants.OSMOSIS_USDT: { - Name: Name, OffChainTicker: "OSMO-USDT", }, constants.POLKADOT_USD: { - Name: Name, OffChainTicker: "DOT-USD", }, constants.POLYGON_USD: { - Name: Name, OffChainTicker: "MATIC-USD", }, constants.RIPPLE_USD: { - Name: Name, OffChainTicker: "XRP-USD", }, constants.SEI_USD: { - Name: Name, OffChainTicker: "SEI-USD", }, constants.SHIBA_USD: { - Name: Name, OffChainTicker: "SHIB-USD", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "SOL-USD", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOL-USDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOL-USDT", }, constants.STELLAR_USD: { - Name: Name, OffChainTicker: "XLM-USD", }, constants.SUI_USD: { - Name: Name, OffChainTicker: "SUI-USD", }, constants.UNISWAP_USD: { - Name: Name, OffChainTicker: "UNI-USD", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDC-USDT", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "USDT-USD", }, } diff --git a/providers/websockets/cryptodotcom/utils.go b/providers/websockets/cryptodotcom/utils.go index 71764acd5..c7034f294 100644 --- a/providers/websockets/cryptodotcom/utils.go +++ b/providers/websockets/cryptodotcom/utils.go @@ -44,71 +44,54 @@ var ( // DefaultMarketConfig is the default market configuration for Crypto.com. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.ATOM_USD: { - Name: Name, OffChainTicker: "ATOMUSD-PERP", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOM_USDT", }, constants.AVAX_USD: { - Name: Name, OffChainTicker: "AVAXUSD-PERP", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAX_USDT", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "BTCUSD-PERP", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTC_USDT", }, constants.CELESTIA_USD: { - Name: Name, OffChainTicker: "TIAUSD-PERP", }, constants.CELESTIA_USDT: { - Name: Name, OffChainTicker: "TIA_USDT", }, constants.DYDX_USD: { - Name: Name, OffChainTicker: "DYDXUSD-PERP", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDX_USDT", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETH_BTC", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ETHUSD-PERP", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETH_USDT", }, constants.OSMOSIS_USD: { - Name: Name, OffChainTicker: "OSMO_USD", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "SOLUSD-PERP", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOL_USDT", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "USDT_USD", }, } diff --git a/providers/websockets/gate/utils.go b/providers/websockets/gate/utils.go index 273ef335e..ddc7d21a3 100644 --- a/providers/websockets/gate/utils.go +++ b/providers/websockets/gate/utils.go @@ -37,135 +37,102 @@ var ( // DefaultMarketConfig is the default market configuration for Gate.io. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "ARB_USDT", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOM_USDT", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAX_USDT", }, constants.APE_USDT: { - Name: Name, OffChainTicker: "APE_USDT", }, constants.APTOS_USDT: { - Name: Name, OffChainTicker: "APT_USDT", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCH_USDT", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTC_USDT", }, constants.BLUR_USDT: { - Name: Name, OffChainTicker: "BLUR_USDT", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADA_USDT", }, constants.CELESTIA_USDT: { - Name: Name, OffChainTicker: "TIA_USDT", }, constants.COMPOUND_USDT: { - Name: Name, OffChainTicker: "COMP_USDT", }, constants.CURVE_USDT: { - Name: Name, OffChainTicker: "CRV_USDT", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "DOGE_USDT", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDX_USDT", }, constants.ETC_USDT: { - Name: Name, OffChainTicker: "ETC_USDT", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETH_BTC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETH_USDT", }, constants.FILECOIN_USDT: { - Name: Name, OffChainTicker: "FIL_USDT", }, constants.NEAR_USDT: { - Name: Name, OffChainTicker: "NEAR_USDT", }, constants.OPTIMISM_USDT: { - Name: Name, OffChainTicker: "OP_USDT", }, constants.PEPE_USDT: { - Name: Name, OffChainTicker: "PEPE_USDT", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOT_USDT", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "MATIC_USDT", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRP_USDT", }, constants.SEI_USDT: { - Name: Name, OffChainTicker: "SEI_USDT", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIB_USDT", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOL_USDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOL_USDT", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "SUI_USDT", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "TRX_USDT", }, constants.UNISWAP_USDT: { - Name: Name, OffChainTicker: "UNI_USDT", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDC_USDT", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "WLD_USDT", }, } diff --git a/providers/websockets/huobi/utils.go b/providers/websockets/huobi/utils.go index ff160a5e8..cb34890b1 100644 --- a/providers/websockets/huobi/utils.go +++ b/providers/websockets/huobi/utils.go @@ -42,107 +42,81 @@ var ( // DefaultMarketConfig is the default market configuration for the Huobi Websocket. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "arbusdt", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "atomusdt", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "avaxusdt", }, constants.APTOS_USDT: { - Name: Name, OffChainTicker: "aptusdt", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "bchusdt", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "btcusdc", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "btcusdt", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "adausdt", }, constants.CELESTIA_USDT: { - Name: Name, OffChainTicker: "tiausdt", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "dogeusdt", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "dydxusdt", }, constants.ETC_USDT: { - Name: Name, OffChainTicker: "etcusdt", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ethbtc", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ethusdc", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ethusdt", }, constants.FILECOIN_USDT: { - Name: Name, OffChainTicker: "filusdt", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "ltcusdt", }, constants.NEAR_USDT: { - Name: Name, OffChainTicker: "nearusdt", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "maticusdt", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "xrpusdt", }, constants.SEI_USDT: { - Name: Name, OffChainTicker: "seiusdt", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "solusdt", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "suiusdt", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "trxusdt", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "usdcusdt", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "wldusdt", }, } diff --git a/providers/websockets/kraken/utils.go b/providers/websockets/kraken/utils.go index 09a4fe306..6eea928db 100644 --- a/providers/websockets/kraken/utils.go +++ b/providers/websockets/kraken/utils.go @@ -45,151 +45,114 @@ var ( // DefaultMarketConfig is the default market configuration for Kraken. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USD: { - Name: Name, OffChainTicker: "APE/USD", }, constants.ATOM_USD: { - Name: Name, OffChainTicker: "ATOM/USD", }, constants.AVAX_USD: { - Name: Name, OffChainTicker: "AVAX/USD", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAX/USDT", }, constants.BCH_USD: { - Name: Name, OffChainTicker: "BCH/USD", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "XBT/USD", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "XBT/USDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "XBT/USDT", }, constants.BLUR_USD: { - Name: Name, OffChainTicker: "BLUR/USD", }, constants.CARDANO_USD: { - Name: Name, OffChainTicker: "ADA/USD", }, constants.CELESTIA_USD: { - Name: Name, OffChainTicker: "TIA/USD", }, constants.CHAINLINK_USD: { - Name: Name, OffChainTicker: "LINK/USD", }, constants.COMPOUND_USD: { - Name: Name, OffChainTicker: "COMP/USD", }, constants.CURVE_USD: { - Name: Name, OffChainTicker: "CRV/USD", }, constants.DOGE_USD: { - Name: Name, OffChainTicker: "XDG/USD", }, constants.DYDX_USD: { - Name: Name, OffChainTicker: "DYDX/USD", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETH/XBT", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ETH/USD", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETH/USDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETH/USDT", }, constants.FILECOIN_USD: { - Name: Name, OffChainTicker: "FIL/USD", }, constants.LIDO_USD: { - Name: Name, OffChainTicker: "LDO/USD", }, constants.LITECOIN_USD: { - Name: Name, OffChainTicker: "XLTCZ/USD", }, constants.MAKER_USD: { - Name: Name, OffChainTicker: "MKR/USD", }, constants.PEPE_USD: { - Name: Name, OffChainTicker: "PEPE/USD", }, constants.POLKADOT_USD: { - Name: Name, OffChainTicker: "DOT/USD", }, constants.POLYGON_USD: { - Name: Name, OffChainTicker: "MATIC/USD", }, constants.RIPPLE_USD: { - Name: Name, OffChainTicker: "XXRPZ/USD", }, constants.SHIBA_USD: { - Name: Name, OffChainTicker: "SHIB/USD", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "SOL/USD", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOL/USDT", }, constants.STELLAR_USD: { - Name: Name, OffChainTicker: "XXLMZ/USD", }, constants.TRON_USD: { - Name: Name, OffChainTicker: "TRX/USD", }, constants.UNISWAP_USD: { - Name: Name, OffChainTicker: "UNI/USD", }, constants.USDC_USD: { - Name: Name, OffChainTicker: "USDC/USD", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDC/USDT", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "USDT/USD", }, } diff --git a/providers/websockets/kucoin/utils.go b/providers/websockets/kucoin/utils.go index 5cf9e98ec..81e7fda21 100644 --- a/providers/websockets/kucoin/utils.go +++ b/providers/websockets/kucoin/utils.go @@ -61,175 +61,132 @@ var ( // DefaultMarketConfig defines the default market config for Kucoin. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USDC: { - Name: Name, OffChainTicker: "APE-USDC", }, constants.APE_USDT: { - Name: Name, OffChainTicker: "APE-USDT", }, constants.APTOS_USDT: { - Name: Name, OffChainTicker: "APT-USDT", }, constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "ARB-USDT", }, constants.ATOM_USDC: { - Name: Name, OffChainTicker: "ATOM-USDC", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOM-USDT", }, constants.AVAX_USDC: { - Name: Name, OffChainTicker: "AVAX-USDC", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAX-USDT", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCH-USDT", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "BTC-USDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTC-USDT", }, constants.BLUR_USDT: { - Name: Name, OffChainTicker: "BLUR-USDT", }, constants.CARDANO_USDC: { - Name: Name, OffChainTicker: "ADA-USDC", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADA-USDT", }, constants.CELESTIA_USDT: { - Name: Name, OffChainTicker: "TIA-USDT", }, constants.CHAINLINK_USDT: { - Name: Name, OffChainTicker: "LINK-USDT", }, constants.CURVE_USDT: { - Name: Name, OffChainTicker: "CRV-USDT", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "DOGE-USDT", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDX-USDT", }, constants.ETC_USDT: { - Name: Name, OffChainTicker: "ETC-USDT", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETH-BTC", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETH-USDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETH-USDT", }, constants.LIDO_USDT: { - Name: Name, OffChainTicker: "LDO-USDT", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "LTC-USDT", }, constants.MAKER_USDT: { - Name: Name, OffChainTicker: "MKR-USDT", }, constants.NEAR_USDT: { - Name: Name, OffChainTicker: "NEAR-USDT", }, constants.OPTIMISM_USDT: { - Name: Name, OffChainTicker: "OP-USDT", }, constants.OSMOSIS_USDT: { - Name: Name, OffChainTicker: "OSMO-USDT", }, constants.PEPE_USDT: { - Name: Name, OffChainTicker: "PEPE-USDT", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOT-USDT", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "MATIC-USDT", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRP-USDT", }, constants.SEI_USDT: { - Name: Name, OffChainTicker: "SEI-USDT", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIB-USDT", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOL-USDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOL-USDT", }, constants.STELLAR_USDT: { - Name: Name, OffChainTicker: "XLM-USDT", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "SUI-USDT", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "TRX-USDT", }, constants.UNISWAP_USDT: { - Name: Name, OffChainTicker: "UNI-USDT", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDC-USDT", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "WLD-USDT", }, } diff --git a/providers/websockets/mexc/utils.go b/providers/websockets/mexc/utils.go index 7c0687617..db921f4ee 100644 --- a/providers/websockets/mexc/utils.go +++ b/providers/websockets/mexc/utils.go @@ -52,167 +52,126 @@ var ( // DefaultMarketConfig is the default market configuration for the MEXC Websocket. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USDT: { - Name: Name, OffChainTicker: "APEUSDT", }, constants.APTOS_USDT: { - Name: Name, OffChainTicker: "APTUSDT", }, constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "ARBUSDT", }, constants.ATOM_USDC: { - Name: Name, OffChainTicker: "ATOMUSDC", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOMUSDT", }, constants.AVAX_USDC: { - Name: Name, OffChainTicker: "AVAXUSDC", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAXUSDT", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCHUSDT", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "BTCUSDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTCUSDT", }, constants.BLUR_USDT: { - Name: Name, OffChainTicker: "BLURUSDT", }, constants.CARDANO_USDC: { - Name: Name, OffChainTicker: "ADAUSDC", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADAUSDT", }, constants.CHAINLINK_USDT: { - Name: Name, OffChainTicker: "LINKUSDT", }, constants.COMPOUND_USDT: { - Name: Name, OffChainTicker: "COMPUSDT", }, constants.CURVE_USDT: { - Name: Name, OffChainTicker: "CRVUSDT", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "DOGEUSDT", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDXUSDT", }, constants.ETC_USDT: { - Name: Name, OffChainTicker: "ETCUSDT", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETHBTC", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETHUSDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETHUSDT", }, constants.FILECOIN_USDT: { - Name: Name, OffChainTicker: "FILUSDT", }, constants.LIDO_USDT: { - Name: Name, OffChainTicker: "LDOUSDT", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "LTCUSDT", }, constants.MAKER_USDT: { - Name: Name, OffChainTicker: "MKRUSDT", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOTUSDT", }, constants.NEAR_USDT: { - Name: Name, OffChainTicker: "NEARUSDT", }, constants.OPTIMISM_USDT: { - Name: Name, OffChainTicker: "OPUSDT", }, constants.PEPE_USDT: { - Name: Name, OffChainTicker: "PEPEUSDT", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "MATICUSDT", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRPUSDT", }, constants.SEI_USDT: { - Name: Name, OffChainTicker: "SEIUSDT", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIBUSDT", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOLUSDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOLUSDT", }, constants.STELLAR_USDT: { - Name: Name, OffChainTicker: "XLMUSDT", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "SUIUSDT", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "TRXUSDT", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDCUSDT", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "WLDUSDT", }, } diff --git a/providers/websockets/okx/utils.go b/providers/websockets/okx/utils.go index 47550ca2e..7b2fa08a9 100644 --- a/providers/websockets/okx/utils.go +++ b/providers/websockets/okx/utils.go @@ -45,219 +45,165 @@ var ( // DefaultMarketConfig is the default market configuration for OKX. DefaultMarketConfig = types.CurrencyPairsToProviderTickers{ constants.APE_USDC: { - Name: Name, OffChainTicker: "APE-USDC", }, constants.APE_USDT: { - Name: Name, OffChainTicker: "APE-USDT", }, constants.APTOS_USDC: { - Name: Name, OffChainTicker: "APT-USDC", }, constants.APTOS_USDT: { - Name: Name, OffChainTicker: "APT-USDT", }, constants.ARBITRUM_USDT: { - Name: Name, OffChainTicker: "ARB-USDT", }, constants.ATOM_USD: { - Name: Name, OffChainTicker: "ATOM-USD", }, constants.ATOM_USDC: { - Name: Name, OffChainTicker: "ATOM-USDC", }, constants.ATOM_USDT: { - Name: Name, OffChainTicker: "ATOM-USDT", }, constants.AVAX_USD: { - Name: Name, OffChainTicker: "AVAX-USD", }, constants.AVAX_USDC: { - Name: Name, OffChainTicker: "AVAX-USDC", }, constants.AVAX_USDT: { - Name: Name, OffChainTicker: "AVAX-USDT", }, constants.BCH_USDT: { - Name: Name, OffChainTicker: "BCH-USDT", }, constants.BITCOIN_USD: { - Name: Name, OffChainTicker: "BTC-USD", }, constants.BITCOIN_USDC: { - Name: Name, OffChainTicker: "BTC-USDC", }, constants.BITCOIN_USDT: { - Name: Name, OffChainTicker: "BTC-USDT", }, constants.BLUR_USDT: { - Name: Name, OffChainTicker: "BLUR-USDT", }, constants.CARDANO_USD: { - Name: Name, OffChainTicker: "ADA-USD", }, constants.CARDANO_USDC: { - Name: Name, OffChainTicker: "ADA-USDC", }, constants.CARDANO_USDT: { - Name: Name, OffChainTicker: "ADA-USDT", }, constants.CELESTIA_USD: { - Name: Name, OffChainTicker: "TIA-USD", }, constants.CELESTIA_USDT: { - Name: Name, OffChainTicker: "TIA-USDT", }, constants.CHAINLINK_USDT: { - Name: Name, OffChainTicker: "LINK-USDT", }, constants.COMPOUND_USDT: { - Name: Name, OffChainTicker: "COMP-USDT", }, constants.CURVE_USDT: { - Name: Name, OffChainTicker: "CRV-USDT", }, constants.DOGE_USDT: { - Name: Name, OffChainTicker: "DOGE-USDT", }, constants.DYDX_USD: { - Name: Name, OffChainTicker: "DYDX-USD", }, constants.DYDX_USDT: { - Name: Name, OffChainTicker: "DYDX-USDT", }, constants.ETC_USDT: { - Name: Name, OffChainTicker: "ETC-USDT", }, constants.ETHEREUM_BITCOIN: { - Name: Name, OffChainTicker: "ETH-BTC", }, constants.ETHEREUM_USD: { - Name: Name, OffChainTicker: "ETH-USD", }, constants.ETHEREUM_USDC: { - Name: Name, OffChainTicker: "ETH-USDC", }, constants.ETHEREUM_USDT: { - Name: Name, OffChainTicker: "ETH-USDT", }, constants.FILECOIN_USDT: { - Name: Name, OffChainTicker: "FIL-USDT", }, constants.LIDO_USDT: { - Name: Name, OffChainTicker: "LDO-USDT", }, constants.LITECOIN_USDT: { - Name: Name, OffChainTicker: "LTC-USDT", }, constants.MAKER_USDT: { - Name: Name, OffChainTicker: "MKR-USDT", }, constants.POLKADOT_USDT: { - Name: Name, OffChainTicker: "DOT-USDT", }, constants.POLYGON_USDT: { - Name: Name, OffChainTicker: "MATIC-USDT", }, constants.NEAR_USDT: { - Name: Name, OffChainTicker: "NEAR-USDT", }, constants.OPTIMISM_USDT: { - Name: Name, OffChainTicker: "OP-USDT", }, constants.PEPE_USDT: { - Name: Name, OffChainTicker: "PEPE-USDT", }, constants.RIPPLE_USDT: { - Name: Name, OffChainTicker: "XRP-USDT", }, constants.SHIBA_USDT: { - Name: Name, OffChainTicker: "SHIB-USDT", }, constants.SOLANA_USD: { - Name: Name, OffChainTicker: "SOL-USD", }, constants.SOLANA_USDC: { - Name: Name, OffChainTicker: "SOL-USDC", }, constants.SOLANA_USDT: { - Name: Name, OffChainTicker: "SOL-USDT", }, constants.STELLAR_USDT: { - Name: Name, OffChainTicker: "XLM-USDT", }, constants.SUI_USDT: { - Name: Name, OffChainTicker: "SUI-USDT", }, constants.TRON_USDT: { - Name: Name, OffChainTicker: "TRX-USDT", }, constants.UNISWAP_USDT: { - Name: Name, OffChainTicker: "UNI-USDT", }, constants.USDC_USD: { - Name: Name, OffChainTicker: "USDC-USD", }, constants.USDC_USDT: { - Name: Name, OffChainTicker: "USDC-USDT", }, constants.USDT_USD: { - Name: Name, OffChainTicker: "USDT-USD", }, constants.WORLD_USDT: { - Name: Name, OffChainTicker: "WLD-USDT", }, }