909 lines
31 KiB
Plaintext
909 lines
31 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 28,
|
|
"id": "0b5ca901",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import requests\n",
|
|
"import pandas as pd\n",
|
|
"import numpy as np\n",
|
|
"from datetime import datetime\n",
|
|
"import time\n",
|
|
"import json\n",
|
|
"import valkey\n",
|
|
"from dataclasses import dataclass, field\n",
|
|
"\n",
|
|
"VAL_KEY = valkey.Valkey(host='localhost', port=6379, db=0, decode_responses=True)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 29,
|
|
"id": "20665e82",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"### ********** TODO: ADD IN VOLUME DATA TO FILTER MKTS ###"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 30,
|
|
"id": "53647b40",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# ### ASTER Historical FR ###\n",
|
|
"# params = {\n",
|
|
"# 'limit': 1000,\n",
|
|
"# }\n",
|
|
"# r = json.loads(requests.get('https://fapi.asterdex.com/fapi/v3/fundingRate', params=params).text)\n",
|
|
"# df_aster_hist_fr = pd.DataFrame(r)\n",
|
|
"# df_aster_hist_fr['funding_rate_ts_dt'] = pd.to_datetime(df_aster_hist_fr['fundingTime'], unit='ms')\n",
|
|
"# df_aster_hist_fr = df_aster_hist_fr.sort_values(by='fundingTime', ascending=True).drop_duplicates(subset=['symbol'], keep='last')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 31,
|
|
"id": "1f3b65ee",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# ### ASTER Current FR ###\n",
|
|
"# r = json.loads(requests.get('https://fapi.asterdex.com/fapi/v3/fundingInfo').text)\n",
|
|
"# df_aster_current_fr = pd.DataFrame(r)\n",
|
|
"# df_aster_current_fr['funding_rate_ts_dt'] = pd.to_datetime(df_aster_current_fr['time'], unit='ms')\n",
|
|
"# df_aster_current_fr['funding_rate'] = df_aster_current_fr['interestRate']\n"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 32,
|
|
"id": "e33ec721",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"### Extended Current FR ###\n",
|
|
"r = json.loads(requests.get('https://api.starknet.extended.exchange/api/v1/info/markets').text)\n",
|
|
"df_extend_current_mkt_stats = pd.DataFrame(r['data'])\n",
|
|
"\n",
|
|
"df_extend_current_mkt_stats['funding_rate'] = df_extend_current_mkt_stats['marketStats'].apply(lambda x: x.get('fundingRate',{}))\n",
|
|
"df_extend_current_mkt_stats['funding_rate_ts'] = df_extend_current_mkt_stats['marketStats'].apply(lambda x: x.get('nextFundingRate',{}))\n",
|
|
"df_extend_current_mkt_stats['min_order_size'] = df_extend_current_mkt_stats['tradingConfig'].apply(lambda x: x.get('minOrderSize',{}))\n",
|
|
"df_extend_current_mkt_stats['min_price_change'] = df_extend_current_mkt_stats['tradingConfig'].apply(lambda x: x.get('minPriceChange',{}))\n",
|
|
"df_extend_current_mkt_stats['max_leverage'] = df_extend_current_mkt_stats['tradingConfig'].apply(lambda x: x.get('maxLeverage',{}))\n",
|
|
"\n",
|
|
"\n",
|
|
"# df_extend_current_fr = df_extend_current_mkt_stats[['status','name','assetName','collateralAssetName','category','min_order_size','min_price_change','max_leverage','funding_rate','funding_rate_ts']]\n",
|
|
"# df_extend_current_fr['funding_rate_ts_dt'] = pd.to_datetime(df_extend_current_fr['funding_rate_ts'], unit='ms')\n",
|
|
"# df_extend_current_fr = df_extend_current_fr.loc[df_extend_current_fr['status']=='ACTIVE',:]"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 33,
|
|
"id": "782a5d56",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"@dataclass(kw_only=False)\n",
|
|
"class Asset_Leverage:\n",
|
|
" exchange: str\n",
|
|
" lh_asset: str\n",
|
|
" rh_asset: str\n",
|
|
" max_leverage: int\n",
|
|
" max_notional: float\n",
|
|
" # max_leverage_notional: list = field(default_factory=list)\n",
|
|
"\n",
|
|
"### MANUAL LEVERAGE DATA ###\n",
|
|
"LEVERAGE_BY_EXCH: list[Asset_Leverage] = [\n",
|
|
" Asset_Leverage('ASTER', 'ASTER', 'USDT', 75 , 20_000 ), Asset_Leverage('EXTEND', 'ASTER', 'USDT', 25, 400_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'AAVE' , 'USDT', 10 , 115_290), Asset_Leverage('EXTEND', 'AAVE' , 'USDT', 50, 500_000 ),\n",
|
|
" Asset_Leverage('ASTER', '4' , 'USDT', 50 , 5_000 ), Asset_Leverage('EXTEND', '4' , 'USDT', 5 , 100_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'BNB' , 'USDT', 100, 10_000 ), Asset_Leverage('EXTEND', 'BNB' , 'USDT', 50, 500_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'BTC' , 'USDT', 150, 300_000), Asset_Leverage('EXTEND', 'BTC' , 'USDT', 50, 4_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'CHIP' , 'USDT', 50 , 5_000 ), Asset_Leverage('EXTEND', 'CHIP' , 'USDT', 5 , 100_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'CLU' , 'USDT', 50 , 10_000 ), Asset_Leverage('EXTEND', 'WTI' , 'USDT', 5 , 1_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'DOGE' , 'USDT', 75 , 80_000 ), Asset_Leverage('EXTEND', 'DOGE' , 'USDT', 50, 500_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'ENA' , 'USDT', 25 , 30_473 ), Asset_Leverage('EXTEND', 'ENA' , 'USDT', 50, 500_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'ETH' , 'USDT', 150, 300_000), Asset_Leverage('EXTEND', 'ETH' , 'USDT', 50, 4_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'HYPE' , 'USDT', 300, 1_000 ), Asset_Leverage('EXTEND', 'HYPE' , 'USDT', 50, 1_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'INIT' , 'USDT', 50 , 5_000 ), Asset_Leverage('EXTEND', 'INIT' , 'USDT', 5 , 100_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'LIT' , 'USDT', 50 , 2_500 ), Asset_Leverage('EXTEND', 'LIT' , 'USDT', 25, 400_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'SOL' , 'USDT', 100, 50_000 ), Asset_Leverage('EXTEND', 'SOL' , 'USDT', 50, 1_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'SUI' , 'USDT', 75 , 5_416 ), Asset_Leverage('EXTEND', 'SUI' , 'USDT', 50, 500_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'TRUMP', 'USDT', 50 , 5_567 ), Asset_Leverage('EXTEND', 'TRUMP', 'USDT', 25, 400_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'WLFI' , 'USDT', 25 , 104_869), Asset_Leverage('EXTEND', 'WLFI' , 'USDT', 10, 250_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'XAG' , 'USDT', 100, 50_000 ), Asset_Leverage('EXTEND', 'XAG' , 'USDT', 10, 1_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'XAU' , 'USDT', 75 , 2_500 ), Asset_Leverage('EXTEND', 'XAU' , 'USDT', 25, 2_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'XMR' , 'USDT', 50 , 10_000 ), Asset_Leverage('EXTEND', 'XMR' , 'USDT', 25, 400_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'XPT' , 'USDT', 3 , 30_000 ), Asset_Leverage('EXTEND', 'XPT' , 'USDT', 5 , 1_000_000),\n",
|
|
" Asset_Leverage('ASTER', 'XRP' , 'USDT', 100, 40_000 ), Asset_Leverage('EXTEND', 'XRP' , 'USDT', 50, 500_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'ZEC' , 'USDT', 75 , 6_250 ), Asset_Leverage('EXTEND', 'ZEC' , 'USDT', 10, 250_000 ),\n",
|
|
" Asset_Leverage('ASTER', 'ZORA' , 'USDT', 5 , 100_000), Asset_Leverage('EXTEND', 'ZORA' , 'USDT', 5 , 100_000 ),\n",
|
|
"]\n",
|
|
"df_leverage_by_exch = pd.DataFrame(LEVERAGE_BY_EXCH)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 34,
|
|
"id": "62815940",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"### ASTER Current FR from Mark Price Req ###\n",
|
|
"# r = json.loads(requests.get('https://fapi.asterdex.com/fapi/v3/exchangeInfo').text)\n",
|
|
"# df_aster_current_mkt_stats = pd.DataFrame(r)\n",
|
|
"# ### ASTER Current FR from Mark Price Req ###\n",
|
|
"# r = json.loads(requests.get('https://fapi.asterdex.com/fapi/v3/premiumIndex').text)\n",
|
|
"# df_aster_current_mkt_stats = pd.DataFrame(r)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 35,
|
|
"id": "271a67c1",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"### ASTER CURRENT FR - WS ###\n",
|
|
"df_aster_current_fr = pd.DataFrame(json.loads(VAL_KEY.get('fund_rate_aster_all')))\n",
|
|
"df_aster_current_fr = df_aster_current_fr[['s','E','r','T']].rename({'s':'symbol','E':'funding_rate_updated_ts_ms','r':'funding_rate','T':'next_funding_ts'}, axis=1)\n",
|
|
"df_aster_current_fr['funding_rate_updated_dt'] = pd.to_datetime(df_aster_current_fr['funding_rate_updated_ts_ms'], unit='ms')\n",
|
|
"df_aster_current_fr['funding_rate'] = df_aster_current_fr['funding_rate'].astype(float)\n",
|
|
"df_aster_current_fr['time_delta_to_next_funding'] = pd.to_datetime(df_aster_current_fr['next_funding_ts'], unit='ms') - pd.Timestamp.now()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 36,
|
|
"id": "1ce2fde4",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"### EXTEND CURRENT FR - WS ###\n",
|
|
"df_extended_current_fr = pd.DataFrame(json.loads(VAL_KEY.get('fund_rate_extended_all')))\n",
|
|
"df_extended_current_fr = df_extended_current_fr[['symbol','funding_rate_updated_ts_ms','funding_rate']]\n",
|
|
"df_extended_current_fr['funding_rate_updated_dt'] = pd.to_datetime(df_extended_current_fr['funding_rate_updated_ts_ms'], unit='ms')\n",
|
|
"df_extended_current_fr['funding_rate'] = df_extended_current_fr['funding_rate'].astype(float)\n",
|
|
"\n",
|
|
"# df_extended_current_fr = df_extended_current_fr.merge(df_extend_current_mkt_stats[['name','assetName','status', 'funding_rate_ts','max_leverage']].rename({'name':'symbol','funding_rate_ts':'next_funding_ts'}, axis=1), on='symbol', how='left')\n",
|
|
"df_extended_current_fr = df_extended_current_fr.merge(df_extend_current_mkt_stats[['name','assetName','status', 'funding_rate_ts']].rename({'name':'symbol','funding_rate_ts':'next_funding_ts'}, axis=1), on='symbol', how='left')\n",
|
|
"df_extended_current_fr = df_extended_current_fr.loc[df_extended_current_fr['status']=='ACTIVE',:]\n",
|
|
"df_extended_current_fr['USDT_Symbol'] = df_extended_current_fr['assetName'] + 'USDT'\n",
|
|
"df_extended_current_fr['time_delta_to_next_funding'] = pd.to_datetime(df_extended_current_fr['next_funding_ts'], unit='ms') - pd.Timestamp.now()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 37,
|
|
"id": "ff88b413",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"### COMBINED CURRENT FR - WS ###\n",
|
|
"df_comb_current_fr = df_extended_current_fr.merge(df_aster_current_fr, left_on='USDT_Symbol', right_on='symbol', how='inner', suffixes=('_ext', '_ast'))\n",
|
|
"df_comb_current_fr['next_funding_at_same_time'] = (abs(df_comb_current_fr['time_delta_to_next_funding_ext'].dt.total_seconds() - df_comb_current_fr['time_delta_to_next_funding_ast'].dt.total_seconds()) / 60) < 1\n",
|
|
"df_comb_current_fr['net_funding_rate'] = (df_comb_current_fr[['funding_rate_ext', 'funding_rate_ast']].max(axis=1) - df_comb_current_fr[['funding_rate_ext', 'funding_rate_ast']].min(axis=1)).where(df_comb_current_fr['next_funding_at_same_time'], df_comb_current_fr['funding_rate_ext'])\n",
|
|
"df_comb_current_fr['net_funding_rate_abs'] = df_comb_current_fr['net_funding_rate'].abs()\n",
|
|
"\n",
|
|
"### NET MULT ###\n",
|
|
"df_comb_current_fr = df_comb_current_fr.merge(df_leverage_by_exch.loc[df_leverage_by_exch['exchange']=='EXTEND'], left_on='assetName', right_on='lh_asset').merge(df_leverage_by_exch.loc[df_leverage_by_exch['exchange']=='ASTER'], left_on='assetName', right_on='lh_asset', suffixes=('_ext', '_ast'))\n",
|
|
"df_comb_current_fr['net_mult'] = 1 / ( ( 0.5 / df_comb_current_fr['max_leverage_ext'] ) + ( 0.5 / df_comb_current_fr['max_leverage_ast'] ) )\n",
|
|
"df_comb_current_fr['net_mult'] = df_comb_current_fr['net_mult'].round(2)\n",
|
|
"df_comb_current_fr['net_mult_x_net_fr_abs'] = df_comb_current_fr['net_funding_rate_abs'] * df_comb_current_fr['net_mult']"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 38,
|
|
"id": "f5ade993",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"text/plain": [
|
|
"{'symbol_ast': 'CHIPUSDT', 'symbol_extended': 'CHIP-USD'}"
|
|
]
|
|
},
|
|
"execution_count": 38,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"df_best_fr_rate = df_comb_current_fr[['symbol_ext','symbol_ast','net_mult_x_net_fr_abs','net_funding_rate_abs','net_funding_rate','next_funding_at_same_time']].sort_values(by='net_mult_x_net_fr_abs', ascending=False).reset_index(drop=True)\n",
|
|
"df_best_fr_rate['hourly_dollars_per_1k'] = df_best_fr_rate['net_mult_x_net_fr_abs'] * 1000\n",
|
|
"df_best_fr_rate['hourly_dollars_per_1k'] = df_best_fr_rate['hourly_dollars_per_1k'].round(2)\n",
|
|
"\n",
|
|
"best_next_funding_pair = {'symbol_ast':df_best_fr_rate['symbol_ast'][0],'symbol_extended':df_best_fr_rate['symbol_ext'][0]}\n",
|
|
"best_next_funding_pair"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 39,
|
|
"id": "0972d5f4",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"data": {
|
|
"application/vnd.microsoft.datawrangler.viewer.v0+json": {
|
|
"columns": [
|
|
{
|
|
"name": "index",
|
|
"rawType": "int64",
|
|
"type": "integer"
|
|
},
|
|
{
|
|
"name": "symbol_ext",
|
|
"rawType": "str",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "symbol_ast",
|
|
"rawType": "str",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "net_mult_x_net_fr_abs",
|
|
"rawType": "float64",
|
|
"type": "float"
|
|
},
|
|
{
|
|
"name": "net_funding_rate_abs",
|
|
"rawType": "float64",
|
|
"type": "float"
|
|
},
|
|
{
|
|
"name": "net_funding_rate",
|
|
"rawType": "float64",
|
|
"type": "float"
|
|
},
|
|
{
|
|
"name": "next_funding_at_same_time",
|
|
"rawType": "bool",
|
|
"type": "boolean"
|
|
},
|
|
{
|
|
"name": "hourly_dollars_per_1k",
|
|
"rawType": "float64",
|
|
"type": "float"
|
|
}
|
|
],
|
|
"ref": "33130419-3234-458e-82da-43648a261793",
|
|
"rows": [
|
|
[
|
|
"0",
|
|
"CHIP-USD",
|
|
"CHIPUSDT",
|
|
"0.00352692",
|
|
"0.000388",
|
|
"-0.000388",
|
|
"False",
|
|
"3.53"
|
|
],
|
|
[
|
|
"1",
|
|
"HYPE-USD",
|
|
"HYPEUSDT",
|
|
"0.00111423",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"1.11"
|
|
],
|
|
[
|
|
"2",
|
|
"BTC-USD",
|
|
"BTCUSDT",
|
|
"0.000975",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.98"
|
|
],
|
|
[
|
|
"3",
|
|
"ETH-USD",
|
|
"ETHUSDT",
|
|
"0.000975",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.98"
|
|
],
|
|
[
|
|
"4",
|
|
"BNB-USD",
|
|
"BNBUSDT",
|
|
"0.0008667099999999999",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.87"
|
|
],
|
|
[
|
|
"5",
|
|
"XAU-USD",
|
|
"XAUUSDT",
|
|
"0.0008625",
|
|
"2.3e-05",
|
|
"2.3e-05",
|
|
"False",
|
|
"0.86"
|
|
],
|
|
[
|
|
"6",
|
|
"DOGE-USD",
|
|
"DOGEUSDT",
|
|
"0.00078",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.78"
|
|
],
|
|
[
|
|
"7",
|
|
"XMR-USD",
|
|
"XMRUSDT",
|
|
"0.0007332599999999999",
|
|
"2.2e-05",
|
|
"2.2e-05",
|
|
"False",
|
|
"0.73"
|
|
],
|
|
[
|
|
"8",
|
|
"XPT-USD",
|
|
"XPTUSDT",
|
|
"0.0006299999999999999",
|
|
"0.000168",
|
|
"0.000168",
|
|
"False",
|
|
"0.63"
|
|
],
|
|
[
|
|
"9",
|
|
"SUI-USD",
|
|
"SUIUSDT",
|
|
"0.00054",
|
|
"9e-06",
|
|
"-9e-06",
|
|
"False",
|
|
"0.54"
|
|
],
|
|
[
|
|
"10",
|
|
"ASTER-USD",
|
|
"ASTERUSDT",
|
|
"0.0004875",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.49"
|
|
],
|
|
[
|
|
"11",
|
|
"ENA-USD",
|
|
"ENAUSDT",
|
|
"0.00043328999999999997",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.43"
|
|
],
|
|
[
|
|
"12",
|
|
"LIT-USD",
|
|
"LITUSDT",
|
|
"0.00043328999999999997",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.43"
|
|
],
|
|
[
|
|
"13",
|
|
"ZEC-USD",
|
|
"ZECUSDT",
|
|
"0.00038829999999999995",
|
|
"2.2e-05",
|
|
"-2.2e-05",
|
|
"False",
|
|
"0.39"
|
|
],
|
|
[
|
|
"14",
|
|
"SOL-USD",
|
|
"SOLUSDT",
|
|
"0.00033335000000000005",
|
|
"5e-06",
|
|
"-5e-06",
|
|
"False",
|
|
"0.33"
|
|
],
|
|
[
|
|
"15",
|
|
"WLFI-USD",
|
|
"WLFIUSDT",
|
|
"0.00018576999999999998",
|
|
"1.3e-05",
|
|
"-1.3e-05",
|
|
"False",
|
|
"0.19"
|
|
],
|
|
[
|
|
"16",
|
|
"XRP-USD",
|
|
"XRPUSDT",
|
|
"0.00013334",
|
|
"2e-06",
|
|
"2e-06",
|
|
"False",
|
|
"0.13"
|
|
],
|
|
[
|
|
"17",
|
|
"INIT-USD",
|
|
"INITUSDT",
|
|
"0.00011816999999999999",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.12"
|
|
],
|
|
[
|
|
"18",
|
|
"4-USD",
|
|
"4USDT",
|
|
"0.00011816999999999999",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.12"
|
|
],
|
|
[
|
|
"19",
|
|
"AAVE-USD",
|
|
"AAVEUSDT",
|
|
"0.00010002000000000001",
|
|
"6e-06",
|
|
"6e-06",
|
|
"False",
|
|
"0.1"
|
|
],
|
|
[
|
|
"20",
|
|
"ZORA-USD",
|
|
"ZORAUSDT",
|
|
"6.5e-05",
|
|
"1.3e-05",
|
|
"1.3e-05",
|
|
"False",
|
|
"0.06"
|
|
],
|
|
[
|
|
"21",
|
|
"XAG-USD",
|
|
"XAGUSDT",
|
|
"5.454e-05",
|
|
"3e-06",
|
|
"3e-06",
|
|
"False",
|
|
"0.05"
|
|
],
|
|
[
|
|
"22",
|
|
"TRUMP-USD",
|
|
"TRUMPUSDT",
|
|
"3.3329999999999994e-05",
|
|
"1e-06",
|
|
"-1e-06",
|
|
"False",
|
|
"0.03"
|
|
]
|
|
],
|
|
"shape": {
|
|
"columns": 7,
|
|
"rows": 23
|
|
}
|
|
},
|
|
"text/html": [
|
|
"<div>\n",
|
|
"<style scoped>\n",
|
|
" .dataframe tbody tr th:only-of-type {\n",
|
|
" vertical-align: middle;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe tbody tr th {\n",
|
|
" vertical-align: top;\n",
|
|
" }\n",
|
|
"\n",
|
|
" .dataframe thead th {\n",
|
|
" text-align: right;\n",
|
|
" }\n",
|
|
"</style>\n",
|
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|
" <thead>\n",
|
|
" <tr style=\"text-align: right;\">\n",
|
|
" <th></th>\n",
|
|
" <th>symbol_ext</th>\n",
|
|
" <th>symbol_ast</th>\n",
|
|
" <th>net_mult_x_net_fr_abs</th>\n",
|
|
" <th>net_funding_rate_abs</th>\n",
|
|
" <th>net_funding_rate</th>\n",
|
|
" <th>next_funding_at_same_time</th>\n",
|
|
" <th>hourly_dollars_per_1k</th>\n",
|
|
" </tr>\n",
|
|
" </thead>\n",
|
|
" <tbody>\n",
|
|
" <tr>\n",
|
|
" <th>0</th>\n",
|
|
" <td>CHIP-USD</td>\n",
|
|
" <td>CHIPUSDT</td>\n",
|
|
" <td>0.003527</td>\n",
|
|
" <td>0.000388</td>\n",
|
|
" <td>-0.000388</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>3.53</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>1</th>\n",
|
|
" <td>HYPE-USD</td>\n",
|
|
" <td>HYPEUSDT</td>\n",
|
|
" <td>0.001114</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>1.11</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>2</th>\n",
|
|
" <td>BTC-USD</td>\n",
|
|
" <td>BTCUSDT</td>\n",
|
|
" <td>0.000975</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.98</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>3</th>\n",
|
|
" <td>ETH-USD</td>\n",
|
|
" <td>ETHUSDT</td>\n",
|
|
" <td>0.000975</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.98</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>4</th>\n",
|
|
" <td>BNB-USD</td>\n",
|
|
" <td>BNBUSDT</td>\n",
|
|
" <td>0.000867</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.87</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>5</th>\n",
|
|
" <td>XAU-USD</td>\n",
|
|
" <td>XAUUSDT</td>\n",
|
|
" <td>0.000862</td>\n",
|
|
" <td>0.000023</td>\n",
|
|
" <td>0.000023</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.86</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>6</th>\n",
|
|
" <td>DOGE-USD</td>\n",
|
|
" <td>DOGEUSDT</td>\n",
|
|
" <td>0.000780</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.78</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>7</th>\n",
|
|
" <td>XMR-USD</td>\n",
|
|
" <td>XMRUSDT</td>\n",
|
|
" <td>0.000733</td>\n",
|
|
" <td>0.000022</td>\n",
|
|
" <td>0.000022</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.73</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>8</th>\n",
|
|
" <td>XPT-USD</td>\n",
|
|
" <td>XPTUSDT</td>\n",
|
|
" <td>0.000630</td>\n",
|
|
" <td>0.000168</td>\n",
|
|
" <td>0.000168</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.63</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>9</th>\n",
|
|
" <td>SUI-USD</td>\n",
|
|
" <td>SUIUSDT</td>\n",
|
|
" <td>0.000540</td>\n",
|
|
" <td>0.000009</td>\n",
|
|
" <td>-0.000009</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.54</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>10</th>\n",
|
|
" <td>ASTER-USD</td>\n",
|
|
" <td>ASTERUSDT</td>\n",
|
|
" <td>0.000487</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.49</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>11</th>\n",
|
|
" <td>ENA-USD</td>\n",
|
|
" <td>ENAUSDT</td>\n",
|
|
" <td>0.000433</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.43</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>12</th>\n",
|
|
" <td>LIT-USD</td>\n",
|
|
" <td>LITUSDT</td>\n",
|
|
" <td>0.000433</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.43</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>13</th>\n",
|
|
" <td>ZEC-USD</td>\n",
|
|
" <td>ZECUSDT</td>\n",
|
|
" <td>0.000388</td>\n",
|
|
" <td>0.000022</td>\n",
|
|
" <td>-0.000022</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.39</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>14</th>\n",
|
|
" <td>SOL-USD</td>\n",
|
|
" <td>SOLUSDT</td>\n",
|
|
" <td>0.000333</td>\n",
|
|
" <td>0.000005</td>\n",
|
|
" <td>-0.000005</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.33</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>15</th>\n",
|
|
" <td>WLFI-USD</td>\n",
|
|
" <td>WLFIUSDT</td>\n",
|
|
" <td>0.000186</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>-0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.19</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>16</th>\n",
|
|
" <td>XRP-USD</td>\n",
|
|
" <td>XRPUSDT</td>\n",
|
|
" <td>0.000133</td>\n",
|
|
" <td>0.000002</td>\n",
|
|
" <td>0.000002</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.13</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>17</th>\n",
|
|
" <td>INIT-USD</td>\n",
|
|
" <td>INITUSDT</td>\n",
|
|
" <td>0.000118</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.12</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>18</th>\n",
|
|
" <td>4-USD</td>\n",
|
|
" <td>4USDT</td>\n",
|
|
" <td>0.000118</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.12</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>19</th>\n",
|
|
" <td>AAVE-USD</td>\n",
|
|
" <td>AAVEUSDT</td>\n",
|
|
" <td>0.000100</td>\n",
|
|
" <td>0.000006</td>\n",
|
|
" <td>0.000006</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.10</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>20</th>\n",
|
|
" <td>ZORA-USD</td>\n",
|
|
" <td>ZORAUSDT</td>\n",
|
|
" <td>0.000065</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>0.000013</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.06</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>21</th>\n",
|
|
" <td>XAG-USD</td>\n",
|
|
" <td>XAGUSDT</td>\n",
|
|
" <td>0.000055</td>\n",
|
|
" <td>0.000003</td>\n",
|
|
" <td>0.000003</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.05</td>\n",
|
|
" </tr>\n",
|
|
" <tr>\n",
|
|
" <th>22</th>\n",
|
|
" <td>TRUMP-USD</td>\n",
|
|
" <td>TRUMPUSDT</td>\n",
|
|
" <td>0.000033</td>\n",
|
|
" <td>0.000001</td>\n",
|
|
" <td>-0.000001</td>\n",
|
|
" <td>False</td>\n",
|
|
" <td>0.03</td>\n",
|
|
" </tr>\n",
|
|
" </tbody>\n",
|
|
"</table>\n",
|
|
"</div>"
|
|
],
|
|
"text/plain": [
|
|
" symbol_ext symbol_ast net_mult_x_net_fr_abs net_funding_rate_abs \\\n",
|
|
"0 CHIP-USD CHIPUSDT 0.003527 0.000388 \n",
|
|
"1 HYPE-USD HYPEUSDT 0.001114 0.000013 \n",
|
|
"2 BTC-USD BTCUSDT 0.000975 0.000013 \n",
|
|
"3 ETH-USD ETHUSDT 0.000975 0.000013 \n",
|
|
"4 BNB-USD BNBUSDT 0.000867 0.000013 \n",
|
|
"5 XAU-USD XAUUSDT 0.000862 0.000023 \n",
|
|
"6 DOGE-USD DOGEUSDT 0.000780 0.000013 \n",
|
|
"7 XMR-USD XMRUSDT 0.000733 0.000022 \n",
|
|
"8 XPT-USD XPTUSDT 0.000630 0.000168 \n",
|
|
"9 SUI-USD SUIUSDT 0.000540 0.000009 \n",
|
|
"10 ASTER-USD ASTERUSDT 0.000487 0.000013 \n",
|
|
"11 ENA-USD ENAUSDT 0.000433 0.000013 \n",
|
|
"12 LIT-USD LITUSDT 0.000433 0.000013 \n",
|
|
"13 ZEC-USD ZECUSDT 0.000388 0.000022 \n",
|
|
"14 SOL-USD SOLUSDT 0.000333 0.000005 \n",
|
|
"15 WLFI-USD WLFIUSDT 0.000186 0.000013 \n",
|
|
"16 XRP-USD XRPUSDT 0.000133 0.000002 \n",
|
|
"17 INIT-USD INITUSDT 0.000118 0.000013 \n",
|
|
"18 4-USD 4USDT 0.000118 0.000013 \n",
|
|
"19 AAVE-USD AAVEUSDT 0.000100 0.000006 \n",
|
|
"20 ZORA-USD ZORAUSDT 0.000065 0.000013 \n",
|
|
"21 XAG-USD XAGUSDT 0.000055 0.000003 \n",
|
|
"22 TRUMP-USD TRUMPUSDT 0.000033 0.000001 \n",
|
|
"\n",
|
|
" net_funding_rate next_funding_at_same_time hourly_dollars_per_1k \n",
|
|
"0 -0.000388 False 3.53 \n",
|
|
"1 0.000013 False 1.11 \n",
|
|
"2 0.000013 False 0.98 \n",
|
|
"3 0.000013 False 0.98 \n",
|
|
"4 0.000013 False 0.87 \n",
|
|
"5 0.000023 False 0.86 \n",
|
|
"6 0.000013 False 0.78 \n",
|
|
"7 0.000022 False 0.73 \n",
|
|
"8 0.000168 False 0.63 \n",
|
|
"9 -0.000009 False 0.54 \n",
|
|
"10 0.000013 False 0.49 \n",
|
|
"11 0.000013 False 0.43 \n",
|
|
"12 0.000013 False 0.43 \n",
|
|
"13 -0.000022 False 0.39 \n",
|
|
"14 -0.000005 False 0.33 \n",
|
|
"15 -0.000013 False 0.19 \n",
|
|
"16 0.000002 False 0.13 \n",
|
|
"17 0.000013 False 0.12 \n",
|
|
"18 0.000013 False 0.12 \n",
|
|
"19 0.000006 False 0.10 \n",
|
|
"20 0.000013 False 0.06 \n",
|
|
"21 0.000003 False 0.05 \n",
|
|
"22 -0.000001 False 0.03 "
|
|
]
|
|
},
|
|
"execution_count": 39,
|
|
"metadata": {},
|
|
"output_type": "execute_result"
|
|
}
|
|
],
|
|
"source": [
|
|
"df_best_fr_rate"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "73db21ae",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "125ee5ed",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "cdcda9a8",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "py_313",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.13.13"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|