Skip to content

Commit

Permalink
Merge pull request #99 from terra-money/feat/refact/osmo
Browse files Browse the repository at this point in the history
feat: refact osmo
  • Loading branch information
javiersuweijie authored Feb 28, 2024
2 parents 3e623a1 + 3a558d9 commit f1572b0
Show file tree
Hide file tree
Showing 4 changed files with 215 additions and 174 deletions.
31 changes: 17 additions & 14 deletions config/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var DefaultPriceServerConfig = Config{
Port: 8532,
MetricsPort: 8533,
Sentry: "",
ProviderPriority: []string{"astroport", "binance", "huobi", "coingecko", "kucoin", "bitfinex", "kraken", "okx", "osmosis" /*"bitstamp", */, "bybit" /*"bittrex",*/, "exchangerate", "frankfurter", "fer"},
ProviderPriority: []string{"astroport", "binance", "huobi", "kucoin", "bitfinex", "kraken", "okx", "coingecko", "osmosis", "bitstamp", "bybit" /*"bittrex",*/, "exchangerate", "frankfurter", "fer"},
Providers: map[string]ProviderConfig{
"astroport": {
Interval: 30,
Expand Down Expand Up @@ -1189,9 +1189,10 @@ var DefaultPriceServerConfig = Config{
},
},
"coingecko": {
Interval: 6,
Interval: 30,
Timeout: 10,
Symbols: []string{
"osmosis",
"bitcoin",
"ethereum",
"binancecoin",
Expand All @@ -1211,26 +1212,28 @@ var DefaultPriceServerConfig = Config{
"stargaze",
"akash-network",
"white-whale",
"eris-amplified-whale",
"switcheo",
"stafi-staked-swth",
"stride-staked-luna",
},
},
"osmosis": {
Interval: 6,
Interval: 30,
Symbols: []string{
"ATOM/USDC",
"AKT/USDC",
"JUNO/USDC",
"SCRT/USDC",
"STARS/USDC",
"ATOM/OSMO",
"AKT/OSMO",
"JUNO/OSMO",
"SCRT/OSMO",
"STARS/OSMO",
"USDC/OSMO",
"INJ/OSMO",
"LUNA/OSMO",
"KAVA/OSMO",
"LINK/OSMO",
"LUNC/OSMO",
"ASH/USDC",
"OSMO/USDC",
"INJ/USDC",
"LUNA/USDC",
"KAVA/USDC",
"LINK/USDC",
"DOT/USDC",
"LUNC/USDC",
},
},
"coinbase": {
Expand Down
46 changes: 24 additions & 22 deletions internal/parser/internal/coingecko/coingecko.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,30 @@ import (

// symbol to base coin mapping
var COIN_GECKO_MAPPING = map[string]string{
"bitcoin": "BTC",
"ethereum": "ETH",
"binancecoin": "BNB",
"tether": "USDT",
"usd-coin": "USDC",
"binance-usd": "BUSD",
"dai": "DAI",
"okb": "OKB",
"solana": "SOL",
"cosmos": "ATOM",
"terra-luna-2": "LUNA",
"terra-luna": "LUNC",
"terrausd": "USTC",
"injective-protocol": "INJ",
"secret": "SCRT",
"juno-network": "JUNO",
"stargaze": "STARS",
"akash-network": "AKT",
"white-whale": "WHALE", // White Whale chain
"switcheo": "SWTH", // Carbon chain
"stafi-staked-swth": "rSWTH", // stafi-staked-swth
"stride-staked-luna": "STLUNA", // Stride chain
"bitcoin": "BTC",
"ethereum": "ETH",
"binancecoin": "BNB",
"tether": "USDT",
"usd-coin": "USDC",
"binance-usd": "BUSD",
"dai": "DAI",
"okb": "OKB",
"solana": "SOL",
"cosmos": "ATOM",
"terra-luna-2": "LUNA",
"terra-luna": "LUNC",
"terrausd": "USTC",
"injective-protocol": "INJ",
"eris-amplified-whale": "AMPWHALE",
"secret": "SCRT",
"juno-network": "JUNO",
"stargaze": "STARS",
"akash-network": "AKT",
"white-whale": "WHALE", // White Whale chain
"switcheo": "SWTH", // Carbon chain
"stride-staked-luna": "STLUNA", // Stride chain
"stafi-staked-swth": "rSWTH", // stafi-staked-swth
"osmosis": "OSMO",
}

func ParseSymbol(symbol string) (string, string, error) {
Expand Down
Loading

0 comments on commit f1572b0

Please sign in to comment.