Skip to content

Commit c7665d6

Browse files
committed
Update delist recommender configuration and scoring logic
- Added CoinMarketCap API for bandaid deployment - Updated Drift Score Boost Amount to adjust the lower bound for scoring, refining the recommendation criteria SCORE_LB 5x to 31. - Removed 'xt' from the list of reference futures exchanges due to connection failures.
1 parent 96fbb1e commit c7665d6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

backend/api/delist_recommender.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@
3434
STABLE_COINS = {"USDC", 'FDUSD', "USDT", 'DAI', 'USDB', 'USDE', 'TUSD', 'USR'}
3535
DAYS_TO_CONSIDER = 30
3636

37-
# Drift API configuration
37+
# --- CoinMarketCap API Configuration ---
38+
CMC_API_KEY = "973f2ad5-6b18-4f01-a8d9-c1d50460ae3a"
39+
40+
# --- Drift API Configuration ---
3841
DRIFT_DATA_API_BASE_URL = "https://y7n4m4tnpb.execute-api.eu-west-1.amazonaws.com"
3942
DRIFT_DATA_API_HEADERS = {"X-Origin-Verify": "AolCE35uXby9TJHHgoz6"}
4043
API_RATE_LIMIT_INTERVAL = 0.1 # seconds between requests
4144

4245
# Drift Score Boost - These are symbols that get a score boost in the delist recommender
4346
DRIFT_SCORE_BOOST_SYMBOLS = {
44-
"DRIFT-PERP",
4547
}
4648

4749
# Drift Score Boost Amount - The amount of score boost to apply to the symbols in DRIFT_SCORE_BOOST_SYMBOLS
@@ -95,15 +97,15 @@
9597

9698
# Score boundaries for delist recommendations
9799
SCORE_UB = {0: 62, 3: 75, 5: 85, 10: 101} # Upper Bound: If score >= this, consider increasing leverage
98-
SCORE_LB = {0: 0, 5: 37, 10: 48, 20: 60} # Lower Bound: If score < this, consider decreasing leverage/delisting
100+
SCORE_LB = {0: 0, 5: 31, 10: 48, 20: 60} # Lower Bound: If score < this, consider decreasing leverage/delisting
99101

100102
# Reference exchanges for market data
101103
REFERENCE_SPOT_EXCH = {
102104
'coinbase', 'okx', 'gate', 'kucoin', 'mexc', 'kraken', 'htx'
103105
}
104106

105107
REFERENCE_FUT_EXCH = {
106-
'okx', 'gate', 'mexc', 'htx', 'bitmex', 'bingx', 'xt'
108+
'okx', 'gate', 'mexc', 'htx', 'bitmex', 'bingx'
107109
}
108110

109111
# Add a known decimals mapping before the get_drift_data function
@@ -811,7 +813,7 @@ def dl_cmc_data():
811813
logger.info("==> Fetching market cap data from CoinMarketCap")
812814

813815
# Get API key from environment variables
814-
cmc_api_key = os.environ.get("CMC_API_KEY")
816+
cmc_api_key = CMC_API_KEY # TODO: os.environ.get("CMC_API_KEY")
815817
if not cmc_api_key:
816818
logger.error("==> CoinMarketCap API key is not set in .env file. Market cap data will not be available.")
817819
return None

0 commit comments

Comments
 (0)