Files
Funding_Rate/mexc.ipynb

307 lines
7.1 KiB
Plaintext
Raw Normal View History

2026-04-06 20:26:16 +00:00
{
"cells": [
{
"cell_type": "code",
2026-04-21 20:22:33 +00:00
"execution_count": 15,
2026-04-06 20:26:16 +00:00
"id": "7a3f41bd",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
2026-04-21 20:22:33 +00:00
"import requests\n",
"from datetime import datetime"
2026-04-06 20:26:16 +00:00
]
},
{
"cell_type": "code",
2026-04-21 20:22:33 +00:00
"execution_count": 44,
2026-04-06 20:26:16 +00:00
"id": "3b48e1ce",
"metadata": {},
"outputs": [],
"source": [
2026-04-21 20:22:33 +00:00
"mexc_all_tickers = 'https://api.mexc.com/api/v1/contract/ticker'\n",
"edgex_all_tickers = 'https://pro.edgex.exchange/api/v1/public/quote/getTicker/?contractId=10000001'"
2026-04-06 20:26:16 +00:00
]
},
{
"cell_type": "code",
2026-04-21 20:22:33 +00:00
"execution_count": 34,
2026-04-06 20:26:16 +00:00
"id": "ab38d984",
"metadata": {},
"outputs": [],
"source": [
2026-04-21 20:22:33 +00:00
"r = requests.get(mexc_all_tickers)\n",
2026-04-06 20:26:16 +00:00
"data = r.json()['data']"
]
},
{
"cell_type": "code",
2026-04-21 20:22:33 +00:00
"execution_count": 49,
"id": "2976b377",
"metadata": {},
"outputs": [],
"source": [
"r = requests.get(edgex_all_tickers)\n",
"data = r.json()['data']"
]
},
{
"cell_type": "code",
"execution_count": 4,
2026-04-06 20:26:16 +00:00
"id": "1139b1a3",
"metadata": {},
"outputs": [],
"source": [
"df = pd.DataFrame(data)\n",
"df['fundingRate_pct'] = df['fundingRate']*100"
]
},
{
"cell_type": "code",
2026-04-21 20:22:33 +00:00
"execution_count": null,
2026-04-06 20:26:16 +00:00
"id": "b00512dc",
"metadata": {},
"outputs": [],
"source": [
"df_trim = df[['symbol','fundingRate_pct','volume24']].copy()\n",
2026-04-21 20:22:33 +00:00
"df_trim = df_trim.loc[df_trim['volume24'] > 10_000]"
2026-04-06 20:26:16 +00:00
]
},
{
"cell_type": "code",
2026-04-21 20:22:33 +00:00
"execution_count": 9,
"id": "f7b44068",
2026-04-06 20:26:16 +00:00
"metadata": {},
"outputs": [
{
"data": {
"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</th>\n",
" <th>fundingRate_pct</th>\n",
" <th>volume24</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>55</th>\n",
" <td>DRIFT_USDT</td>\n",
" <td>-1.1360</td>\n",
" <td>3308466</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>10</th>\n",
" <td>RED_USDT</td>\n",
" <td>-1.1138</td>\n",
" <td>105826673</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>157</th>\n",
" <td>PIXEL_USDT</td>\n",
" <td>-0.4059</td>\n",
" <td>12415472</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>105</th>\n",
" <td>NIL_USDT</td>\n",
" <td>-0.3846</td>\n",
" <td>31438005</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>33</th>\n",
" <td>SUPER_USDT</td>\n",
" <td>-0.3718</td>\n",
" <td>2469502</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>12</th>\n",
" <td>PLAY_USDT</td>\n",
" <td>0.0838</td>\n",
" <td>22168649</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>414</th>\n",
" <td>PUMPBTC_USDT</td>\n",
" <td>0.0913</td>\n",
" <td>745129</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>398</th>\n",
" <td>QQQSTOCK_USDT</td>\n",
" <td>0.0969</td>\n",
" <td>59485</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>222</th>\n",
" <td>GUA_USDT</td>\n",
" <td>0.0996</td>\n",
" <td>45623</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" <tr>\n",
2026-04-21 20:22:33 +00:00
" <th>265</th>\n",
" <td>BROCCOLIF3B_USDT</td>\n",
" <td>0.1647</td>\n",
" <td>3936939</td>\n",
2026-04-06 20:26:16 +00:00
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>837 rows × 3 columns</p>\n",
"</div>"
],
"text/plain": [
2026-04-21 20:22:33 +00:00
" symbol fundingRate_pct volume24\n",
"55 DRIFT_USDT -1.1360 3308466\n",
"10 RED_USDT -1.1138 105826673\n",
"157 PIXEL_USDT -0.4059 12415472\n",
"105 NIL_USDT -0.3846 31438005\n",
"33 SUPER_USDT -0.3718 2469502\n",
".. ... ... ...\n",
"12 PLAY_USDT 0.0838 22168649\n",
"414 PUMPBTC_USDT 0.0913 745129\n",
"398 QQQSTOCK_USDT 0.0969 59485\n",
"222 GUA_USDT 0.0996 45623\n",
"265 BROCCOLIF3B_USDT 0.1647 3936939\n",
2026-04-06 20:26:16 +00:00
"\n",
"[837 rows x 3 columns]"
]
},
2026-04-21 20:22:33 +00:00
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_trim.sort_values('fundingRate_pct', ascending=True)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "6775a03f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1775583908"
]
},
"execution_count": 4,
2026-04-06 20:26:16 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2026-04-21 20:22:33 +00:00
"round(datetime.now().timestamp())"
2026-04-06 20:26:16 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
2026-04-21 20:22:33 +00:00
"id": "edca3b9f",
"metadata": {},
"outputs": [],
"source": [
"### PRIVATE API ###\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "51e50e0d",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "21aabf30",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
2026-04-06 20:26:16 +00:00
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "f91b1c04",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "71e551f4",
"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.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}