Files
Funding_Rate/extended.ipynb

798 lines
22 KiB
Plaintext
Raw Permalink Normal View History

2026-04-22 05:24:40 +00:00
{
"cells": [
{
"cell_type": "code",
2026-04-25 23:47:07 +00:00
"execution_count": 1,
2026-04-23 03:11:52 +00:00
"id": "6c70a8c3",
"metadata": {},
"outputs": [],
"source": [
"\n",
"import asyncio\n",
"import requests\n",
"from x10.config import MAINNET_CONFIG, TESTNET_CONFIG\n",
"from x10.core.stark_account import StarkPerpetualAccount\n",
"from x10.perpetual.trading_client import PerpetualTradingClient\n",
"from x10.models.order import OrderSide, OrderType\n",
"import time\n",
"from dotenv import load_dotenv\n",
"import os\n",
"import uuid\n",
"import asyncio\n",
"import logging\n",
"from decimal import Decimal\n",
2026-04-23 06:39:51 +00:00
"import modules.extended_auth as extend_auth\n",
2026-04-23 03:11:52 +00:00
"\n"
]
},
{
"cell_type": "code",
2026-04-25 23:47:07 +00:00
"execution_count": 2,
2026-04-23 03:11:52 +00:00
"id": "ff971ca9",
2026-04-22 05:24:40 +00:00
"metadata": {},
"outputs": [],
"source": [
2026-04-23 03:11:52 +00:00
"load_dotenv()\n",
"\n",
"API_KEY = os.getenv('EXTENDED_API_KEY')\n",
"PUBLIC_KEY = os.getenv('EXTENDED_STARK_KEY_PUBLIC') # public Stark key (l2Key from account info)\n",
"PRIVATE_KEY = os.getenv('EXTENDED_STARK_KEY_PRIVATE') # private Stark key (hex)\n",
"VAULT = int(os.getenv('EXTENDED_VAULT_NUMBER')) # l2Vault from account info (integer)\n",
"\n",
"CONFIG = MAINNET_CONFIG\n",
"\n",
2026-04-24 07:29:26 +00:00
"ORDER_MARKET = \"ETH-USD\"\n",
2026-04-23 03:11:52 +00:00
"ORDER_SIDE = OrderSide.BUY\n",
2026-04-24 07:29:26 +00:00
"ORDER_QTY = Decimal(\"0.01\")\n",
"ORDER_PRICE = Decimal(\"2200\")"
2026-04-22 05:24:40 +00:00
]
},
2026-04-23 06:39:51 +00:00
{
"cell_type": "code",
2026-04-25 23:47:07 +00:00
"execution_count": 3,
2026-04-23 06:39:51 +00:00
"id": "fc2c6d2b",
"metadata": {},
"outputs": [],
"source": [
"client, trading_client = await extend_auth.create_auth_account_and_trading_client()"
]
},
2026-04-23 03:11:52 +00:00
{
"cell_type": "code",
2026-04-24 07:29:26 +00:00
"execution_count": 41,
2026-04-23 03:11:52 +00:00
"id": "c366706f",
"metadata": {},
"outputs": [],
"source": [
2026-04-24 07:29:26 +00:00
"placed_order = await trading_client.place_order(\n",
" market_name=ORDER_MARKET,\n",
" amount_of_synthetic=ORDER_QTY,\n",
" price=ORDER_PRICE,\n",
" side=ORDER_SIDE,\n",
" taker_fee=Decimal(\"0.00025\"),\n",
" previous_order_id='1295034892466447624365619416628580523728221205816494340545831832663414858661'\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"WrappedApiResponse[EmptyModel](status='OK', data=EmptyModel(), error=None, pagination=None)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"c = await trading_client.orders.mass_cancel(markets=['ETH-USD'])\n",
"c"
]
},
{
"cell_type": "code",
2026-04-25 23:47:07 +00:00
"execution_count": null,
"id": "03913674",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 6,
"id": "8dd8aa73",
2026-04-24 07:29:26 +00:00
"metadata": {},
"outputs": [],
"source": [
2026-04-25 23:47:07 +00:00
"d = await trading_client.account.get_positions_history()"
2026-04-24 07:29:26 +00:00
]
},
{
"cell_type": "code",
2026-04-25 23:47:07 +00:00
"execution_count": 12,
"id": "5f74f7cc",
2026-04-24 07:29:26 +00:00
"metadata": {},
"outputs": [
{
"data": {
2026-04-25 23:47:07 +00:00
"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>0</th>\n",
" <th>1</th>\n",
" <th>2</th>\n",
" <th>3</th>\n",
" <th>4</th>\n",
" <th>5</th>\n",
" <th>6</th>\n",
" <th>7</th>\n",
" <th>8</th>\n",
" <th>9</th>\n",
" <th>10</th>\n",
" <th>11</th>\n",
" <th>12</th>\n",
" <th>13</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>(id, 2047947640758337536)</td>\n",
" <td>(account_id, 270571)</td>\n",
" <td>(market, ETH-USD)</td>\n",
" <td>(side, SHORT)</td>\n",
" <td>(size, 0.2160000000000000)</td>\n",
" <td>(max_position_size, 0.2160000000000000)</td>\n",
" <td>(leverage, 50.0000000000000000)</td>\n",
" <td>(open_price, 2315.5000000000000000)</td>\n",
" <td>(exit_price, 2308.6000000000000000)</td>\n",
" <td>(realised_pnl, 1.4249250000000000)</td>\n",
" <td>(realised_pnl_breakdown, trade_pnl=Decimal('1....</td>\n",
" <td>(created_time, 1777103741241)</td>\n",
" <td>(exit_type, TRADE)</td>\n",
" <td>(closed_time, 1777133049026)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>(id, 2047512381621272576)</td>\n",
" <td>(account_id, 270571)</td>\n",
" <td>(market, ETH-USD)</td>\n",
" <td>(side, LONG)</td>\n",
" <td>(size, 0.2150000000000000)</td>\n",
" <td>(max_position_size, 0.2150000000000000)</td>\n",
" <td>(leverage, 50.0000000000000000)</td>\n",
" <td>(open_price, 2316.6000000000000000)</td>\n",
" <td>(exit_price, 2315.5000000000000000)</td>\n",
" <td>(realised_pnl, 0.0720660000000000)</td>\n",
" <td>(realised_pnl_breakdown, trade_pnl=Decimal('-0...</td>\n",
" <td>(created_time, 1776999967376)</td>\n",
" <td>(exit_type, TRADE)</td>\n",
" <td>(closed_time, 1777103741241)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>(id, 2047419314696355840)</td>\n",
" <td>(account_id, 270571)</td>\n",
" <td>(market, ETH-USD)</td>\n",
" <td>(side, LONG)</td>\n",
" <td>(size, 0.2150000000000000)</td>\n",
" <td>(max_position_size, 0.2150000000000000)</td>\n",
" <td>(leverage, 50.0000000000000000)</td>\n",
" <td>(open_price, 2321.7000000000000000)</td>\n",
" <td>(exit_price, 2327.3000000000000000)</td>\n",
" <td>(realised_pnl, 1.3196460000000000)</td>\n",
" <td>(realised_pnl_breakdown, trade_pnl=Decimal('1....</td>\n",
" <td>(created_time, 1776977778492)</td>\n",
" <td>(exit_type, TRADE)</td>\n",
" <td>(closed_time, 1776996621824)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
2026-04-24 07:29:26 +00:00
"text/plain": [
2026-04-25 23:47:07 +00:00
" 0 1 2 \\\n",
"0 (id, 2047947640758337536) (account_id, 270571) (market, ETH-USD) \n",
"1 (id, 2047512381621272576) (account_id, 270571) (market, ETH-USD) \n",
"2 (id, 2047419314696355840) (account_id, 270571) (market, ETH-USD) \n",
"\n",
" 3 4 \\\n",
"0 (side, SHORT) (size, 0.2160000000000000) \n",
"1 (side, LONG) (size, 0.2150000000000000) \n",
"2 (side, LONG) (size, 0.2150000000000000) \n",
"\n",
" 5 6 \\\n",
"0 (max_position_size, 0.2160000000000000) (leverage, 50.0000000000000000) \n",
"1 (max_position_size, 0.2150000000000000) (leverage, 50.0000000000000000) \n",
"2 (max_position_size, 0.2150000000000000) (leverage, 50.0000000000000000) \n",
"\n",
" 7 8 \\\n",
"0 (open_price, 2315.5000000000000000) (exit_price, 2308.6000000000000000) \n",
"1 (open_price, 2316.6000000000000000) (exit_price, 2315.5000000000000000) \n",
"2 (open_price, 2321.7000000000000000) (exit_price, 2327.3000000000000000) \n",
"\n",
" 9 \\\n",
"0 (realised_pnl, 1.4249250000000000) \n",
"1 (realised_pnl, 0.0720660000000000) \n",
"2 (realised_pnl, 1.3196460000000000) \n",
"\n",
" 10 \\\n",
"0 (realised_pnl_breakdown, trade_pnl=Decimal('1.... \n",
"1 (realised_pnl_breakdown, trade_pnl=Decimal('-0... \n",
"2 (realised_pnl_breakdown, trade_pnl=Decimal('1.... \n",
"\n",
" 11 12 \\\n",
"0 (created_time, 1777103741241) (exit_type, TRADE) \n",
"1 (created_time, 1776999967376) (exit_type, TRADE) \n",
"2 (created_time, 1776977778492) (exit_type, TRADE) \n",
"\n",
" 13 \n",
"0 (closed_time, 1777133049026) \n",
"1 (closed_time, 1777103741241) \n",
"2 (closed_time, 1776996621824) "
2026-04-24 07:29:26 +00:00
]
},
2026-04-25 23:47:07 +00:00
"execution_count": 12,
2026-04-24 07:29:26 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2026-04-25 23:47:07 +00:00
"import pandas as pd\n",
"pd.DataFrame(list(dict(d)['data']))"
2026-04-24 07:29:26 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
2026-04-25 23:47:07 +00:00
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "e119aaac",
"metadata": {},
"outputs": [],
"source": []
2026-04-24 07:29:26 +00:00
},
{
"cell_type": "code",
2026-04-25 23:47:07 +00:00
"execution_count": 17,
2026-04-24 07:29:26 +00:00
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
2026-04-25 23:47:07 +00:00
"Timestamp('2026-04-25 16:04:09.026000')"
2026-04-24 07:29:26 +00:00
]
},
2026-04-25 23:47:07 +00:00
"execution_count": 17,
2026-04-24 07:29:26 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
2026-04-25 23:47:07 +00:00
"pd.to_datetime(1777133049026, unit='ms')"
2026-04-23 03:11:52 +00:00
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2026-04-24 07:29:26 +00:00
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[PositionModel(id=2047419314696355840, account_id=270571, market='ETH-USD', status='OPENED', side='LONG', leverage=Decimal('50'), size=Decimal('0.215'), value=Decimal('500.247305'), open_price=Decimal('2321.7'), mark_price=Decimal('2326.731653474999'), liquidation_price=Decimal('2222.8'), unrealised_pnl=Decimal('1.081805'), realised_pnl=Decimal('0.065534'), tp_price=None, sl_price=None, adl=2, created_at=1776977778498, updated_at=1776986778819)]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d = dict(await trading_client.account.get_positions()).get('data')\n",
"d"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "b9ac87f2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'id': 2047419314696355840,\n",
" 'account_id': 270571,\n",
" 'market': 'ETH-USD',\n",
" 'status': 'OPENED',\n",
" 'side': 'LONG',\n",
" 'leverage': Decimal('50'),\n",
" 'size': Decimal('0.215'),\n",
" 'value': Decimal('500.247305'),\n",
" 'open_price': Decimal('2321.7'),\n",
" 'mark_price': Decimal('2326.731653474999'),\n",
" 'liquidation_price': Decimal('2222.8'),\n",
" 'unrealised_pnl': Decimal('1.081805'),\n",
" 'realised_pnl': Decimal('0.065534'),\n",
" 'tp_price': None,\n",
" 'sl_price': None,\n",
" 'adl': 2,\n",
" 'created_at': 1776977778498,\n",
" 'updated_at': 1776986778819}"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"dict(d[0])"
]
},
2026-04-23 03:11:52 +00:00
{
"cell_type": "code",
"execution_count": null,
2026-04-24 07:29:26 +00:00
"id": "62299776",
"metadata": {},
"outputs": [
{
"ename": "IndexError",
"evalue": "list index out of range",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mIndexError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[40]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m [j \u001b[38;5;28;01mfor\u001b[39;00m j \u001b[38;5;28;01min\u001b[39;00m d \u001b[38;5;28;01mif\u001b[39;00m j.get(\u001b[33m'market'\u001b[39m) == \u001b[33m'ETH-USD'\u001b[39m][\u001b[32m0\u001b[39m]\n",
"\u001b[31mIndexError\u001b[39m: list index out of range"
]
}
],
"source": [
"[j for j in d if j.get('market') == 'ETH-USD']"
]
},
{
"cell_type": "code",
"execution_count": 31,
2026-04-23 03:11:52 +00:00
"id": "7cd3413d",
"metadata": {},
"outputs": [],
2026-04-24 07:29:26 +00:00
"source": [
"balance = dict(dict(await trading_client.account.get_balance()).get('data', {}))"
]
2026-04-23 03:11:52 +00:00
},
{
"cell_type": "code",
"execution_count": null,
2026-04-24 07:29:26 +00:00
"id": "62632db3",
2026-04-23 03:11:52 +00:00
"metadata": {},
"outputs": [],
2026-04-24 07:29:26 +00:00
"source": [
"r = await trading_client.markets_info.get_pos"
]
2026-04-23 03:11:52 +00:00
},
{
"cell_type": "code",
2026-04-24 07:29:26 +00:00
"execution_count": 55,
"id": "e9c3fdc4",
2026-04-23 03:11:52 +00:00
"metadata": {},
"outputs": [],
2026-04-24 07:29:26 +00:00
"source": [
"d = r['ETH-USD'].trading_config"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.01"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"float(d.min_order_size)"
]
2026-04-23 03:11:52 +00:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
2026-04-22 05:24:40 +00:00
{
"cell_type": "code",
"execution_count": 1,
"id": "2b5d7d21",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'type': 'SNAPSHOT',\n",
" 'data': {'t': 'SNAPSHOT',\n",
" 'm': 'ETH-USD',\n",
" 'b': [{'q': '362.381', 'p': '2318.1'}],\n",
" 'a': [{'q': '70.572', 'p': '2318.2'}],\n",
" 'd': '1'},\n",
" 'ts': 1776822518279,\n",
" 'seq': 14}"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"{\"type\":\"SNAPSHOT\",\"data\":{\"t\":\"SNAPSHOT\",\"m\":\"ETH-USD\",\"b\":[{\"q\":\"362.381\",\"p\":\"2318.1\"}],\"a\":[{\"q\":\"70.572\",\"p\":\"2318.2\"}],\"d\":\"1\"},\"ts\":1776822518279,\"seq\":14}"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "19f51572",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'data': {'m': 'ETH-USD', 'f': '-0.000001', 'T': 1776823319595},\n",
" 'ts': 1776823319595,\n",
" 'seq': 2}"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"{'data': {'m': 'ETH-USD', 'f': '-0.000001', 'T': 1776823319595}, 'ts': 1776823319595, 'seq': 2}"
]
},
{
"cell_type": "code",
"execution_count": 41,
"id": "68006231",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Timestamp('2026-04-22 03:00:00')"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"\n",
"pd.to_datetime(1776826800000, unit='ms')"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "5561153b",
"metadata": {},
"outputs": [],
"source": [
"def time_round_down(dt, interval_mins=5) -> int: # returns timestamp in seconds\n",
" interval_secs = interval_mins * 60\n",
" seconds = dt.timestamp()\n",
" rounded_seconds = math.floor(seconds / interval_secs) * interval_secs\n",
" \n",
" return rounded_seconds"
]
},
{
"cell_type": "code",
"execution_count": 40,
"id": "bd83b59f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"1776826800000"
]
},
"execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"(time_round_down(dt=datetime.now(timezone.utc), interval_mins=60)+(60*60))*1000"
]
},
2026-04-23 03:11:52 +00:00
{
"cell_type": "code",
"execution_count": null,
"id": "086dbfb3",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "2d734f79",
"metadata": {},
"outputs": [],
"source": [
"\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "e6b59c51",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"\n",
"### USER DATA STREAM ###\n",
"order = json.loads('{\"type\":\"ORDER\",\"data\":{\"isSnapshot\":true,\"orders\":[]},\"ts\":1776839215443,\"seq\":1}')\n",
"position = json.loads('{\"type\":\"POSITION\",\"data\":{\"isSnapshot\":true,\"positions\":[]},\"ts\":1776839215443,\"seq\":2}')\n",
"balance = json.loads('{\"type\":\"BALANCE\",\"data\":{\"isSnapshot\":true,\"balance\":{\"collateralName\":\"USD\",\"balance\":\"25.979998\",\"status\":\"ACTIVE\",\"equity\":\"25.979998\",\"spotEquity\":\"0\",\"spotEquityForAvailableForTrade\":\"0\",\"availableForTrade\":\"25.979998\",\"availableForWithdrawal\":\"25.979998\",\"unrealisedPnl\":\"0\",\"initialMargin\":\"0.000000\",\"marginRatio\":\"0.0000\",\"updatedTime\":1776822250184,\"exposure\":\"0\",\"leverage\":\"0.0000\"}},\"ts\":1776839215443,\"seq\":3}')"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "ee8420c4",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'type': 'ORDER',\n",
" 'data': {'isSnapshot': True, 'orders': []},\n",
" 'ts': 1776839215443,\n",
" 'seq': 1}"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"order"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "e8d20d9f",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'type': 'POSITION',\n",
" 'data': {'isSnapshot': True, 'positions': []},\n",
" 'ts': 1776839215443,\n",
" 'seq': 2}"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"position"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'type': 'BALANCE',\n",
" 'data': {'isSnapshot': True,\n",
" 'balance': {'collateralName': 'USD',\n",
" 'balance': '25.979998',\n",
" 'status': 'ACTIVE',\n",
" 'equity': '25.979998',\n",
" 'spotEquity': '0',\n",
" 'spotEquityForAvailableForTrade': '0',\n",
" 'availableForTrade': '25.979998',\n",
" 'availableForWithdrawal': '25.979998',\n",
" 'unrealisedPnl': '0',\n",
" 'initialMargin': '0.000000',\n",
" 'marginRatio': '0.0000',\n",
" 'updatedTime': 1776822250184,\n",
" 'exposure': '0',\n",
" 'leverage': '0.0000'}},\n",
" 'ts': 1776839215443,\n",
" 'seq': 3}"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"balance"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fb16dfb9",
"metadata": {},
"outputs": [],
"source": []
},
2026-04-24 07:29:26 +00:00
{
"cell_type": "code",
"execution_count": 11,
"id": "b0388dc7",
"metadata": {},
"outputs": [],
"source": [
"import valkey\n",
"import json\n",
"VAL_KEY = valkey.Valkey(host='localhost', port=6379, db=0, decode_responses=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"b = json.loads(VAL_KEY.get('fund_rate_aster'))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"a = json.loads(VAL_KEY.get('fund_rate_aster'))"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "665377af",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'timestamp_arrival': 1776970338127,\n",
" 'timestamp_msg': 1776970338000,\n",
" 'symbol': 'ETHUSDT',\n",
" 'mark_price': '2310.59000000',\n",
" 'index_price': '2311.29372093',\n",
" 'estimated_settle_price': '2312.11380907',\n",
" 'funding_rate': '-0.00001108',\n",
" 'next_funding_time_ts_ms': 1776988800000}"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"json.loads(VAL_KEY.get('fund_rate_aster'))"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "f15dd3c7",
"metadata": {},
"outputs": [],
"source": [
"VAL_KEY.get('fr_aster_user_positions')"
]
},
2026-04-22 05:24:40 +00:00
{
"cell_type": "code",
"execution_count": null,
2026-04-24 07:29:26 +00:00
"id": "23f88a3e",
2026-04-22 05:24:40 +00:00
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "af5c751b",
"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
}