Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bots/credentials/master_account/conf_client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ anonymized_metrics_mode:

# A source for rate oracle, currently ascend_ex, binance, coin_gecko, coin_cap, kucoin, gate_io
rate_oracle_source:
name: binance
name: gate_io

# A universal token which to display tokens values in, e.g. USD,EUR,BTC
global_token:
Expand Down
16 changes: 10 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def lifespan(app: FastAPI):

# Get rate_oracle_source configuration
rate_oracle_source_data = config_data.get("rate_oracle_source", {})
source_name = rate_oracle_source_data.get("name", "binance")
source_name = rate_oracle_source_data.get("name", "gate_io")

# Get global_token configuration
global_token_data = config_data.get("global_token", {})
Expand All @@ -147,21 +147,25 @@ async def lifespan(app: FastAPI):
rate_source = create_rate_source(source_name)
logging.info(f"Configured RateOracle with source: {source_name}, quote_token: {quote_token}")
else:
logging.warning(f"Unknown rate oracle source '{source_name}', defaulting to binance")
rate_source = create_rate_source("binance")
source_name = "binance"
logging.warning(f"Unknown rate oracle source '{source_name}', defaulting to gate_io")
rate_source = create_rate_source("gate_io")
source_name = "gate_io"

# Initialize RateOracle with configured source and quote token
rate_oracle = RateOracle.get_instance()
rate_oracle.source = rate_source
rate_oracle.quote_token = quote_token

except FileNotFoundError:
logging.warning("conf_client.yml not found, using default RateOracle configuration (binance, USDT)")
logging.warning("conf_client.yml not found, using default RateOracle configuration (gate_io, USDT)")
from routers.rate_oracle import create_rate_source
rate_oracle = RateOracle.get_instance()
rate_oracle.source = create_rate_source("gate_io")
except Exception as e:
logging.warning(f"Error reading conf_client.yml: {e}, using default RateOracle configuration")
logging.warning(f"Error reading conf_client.yml: {e}, using default RateOracle configuration (gate_io)")
from routers.rate_oracle import create_rate_source
rate_oracle = RateOracle.get_instance()
rate_oracle.source = create_rate_source("gate_io")

# =========================================================================
# 2. UnifiedConnectorService - Single source of truth for all connectors
Expand Down
2 changes: 1 addition & 1 deletion models/rate_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GlobalTokenConfig(BaseModel):
class RateOracleSourceConfig(BaseModel):
"""Rate oracle source configuration."""
name: str = Field(
default="binance",
default="gate_io",
description="The rate oracle source to use for price data"
)

Expand Down
4 changes: 2 additions & 2 deletions routers/rate_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def get_rate_oracle_config(request: Request):

# Extract rate_oracle_source
rate_oracle_source_data = config_data.get("rate_oracle_source", {})
source_name = rate_oracle_source_data.get("name", "binance")
source_name = rate_oracle_source_data.get("name", "gate_io")

# Extract global_token
global_token_data = config_data.get("global_token", {})
Expand Down Expand Up @@ -196,7 +196,7 @@ async def update_rate_oracle_config(
fs_util.dump_dict_to_yaml(CONF_CLIENT_PATH, config_data)

# Build response
current_source = config_data.get("rate_oracle_source", {}).get("name", "binance")
current_source = config_data.get("rate_oracle_source", {}).get("name", "gate_io")
current_global_token = config_data.get("global_token", {})

return RateOracleConfigUpdateResponse(
Expand Down
12 changes: 12 additions & 0 deletions services/accounts_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,18 @@ class AccountsService:
"hyperliquid_perpetual": "USD",
"xrpl": "RLUSD",
"kraken": "USD",
"backpack": "USDC",
"backpack_perpetual": "USDC",
"cube": "USDC",
"derive": "USDC",
"derive_perpetual": "USDC",
"dexalot": "USDC",
"vertex": "USDC",
"aevo_perpetual": "USDC",
"pacifica_perpetual": "USDC",
"dydx_v4_perpetual": "USD",
"decibel_perpetual": "USD",
"architect_perpetual": "USD",
}
potential_wrapped_tokens = ["ETH", "SOL", "BNB", "POL", "AVAX"]

Expand Down
Loading