{ "cells": [ { "cell_type": "code", "execution_count": 10, "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", "import modules.extended_auth as extend_auth\n", "\n" ] }, { "cell_type": "code", "execution_count": 11, "id": "ff971ca9", "metadata": {}, "outputs": [], "source": [ "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", "ORDER_MARKET = \"LIT-USD\"\n", "ORDER_QTY = Decimal(\"1\")\n", "ORDER_PRICE = Decimal(\"0.9000\")\n", "ORDER_SIDE = OrderSide.SELL" ] }, { "cell_type": "code", "execution_count": 12, "id": "fc2c6d2b", "metadata": {}, "outputs": [], "source": [ "client, trading_client = await extend_auth.create_auth_account_and_trading_client()" ] }, { "cell_type": "code", "execution_count": 13, "id": "32ed5ff1", "metadata": {}, "outputs": [], "source": [ "def symbol_to_aster_fmt(symbol: str) -> str:\n", " return (symbol+'T' if symbol[-1].upper()!='T' else symbol).replace('-','').upper()\n", "\n", "def symbol_to_extend_fmt(symbol: str) -> str:\n", " return (symbol[0:-1] if symbol[-1].upper()=='T' else symbol).replace('-','').upper().split('USD')[0]+'-'+'USD'" ] }, { "cell_type": "code", "execution_count": 32, "id": "13c77a09", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "WrappedApiResponse[PlacedOrderModel](status='OK', data=PlacedOrderModel(id=2051770708505657344, external_id='2340464894308509827608947727447767756843769945398481824754838465475567294613'), error=None, pagination=None)" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "symbol = 'HYPE-USD'\n", "qty = 11.2\n", "price = 45.455\n", "side = 'SELL'\n", "taker_fee = 0.00025\n", "post_only = False\n", "reduce_only = False\n", "\n", "order_resp = await trading_client.place_order(\n", " market_name=symbol,\n", " amount_of_synthetic=Decimal(str(qty)),\n", " price=Decimal(str(price)),\n", " side=side,\n", " taker_fee=Decimal(str(taker_fee)),\n", " post_only=post_only,\n", " reduce_only=reduce_only\n", ")\n", "order_resp" ] }, { "cell_type": "code", "execution_count": 29, "id": "d751e661", "metadata": {}, "outputs": [ { "ename": "_IncompleteInputError", "evalue": "incomplete input (2582004791.py, line 1)", "output_type": "error", "traceback": [ " \u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[29]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[31m \u001b[39m\u001b[31mtaker_fee = str(0.00025\u001b[39m\n ^\n\u001b[31m_IncompleteInputError\u001b[39m\u001b[31m:\u001b[39m incomplete input\n" ] } ], "source": [ "taker_fee = str(0.00025" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "taker_fee" ] }, { "cell_type": "code", "execution_count": null, "id": "8af88032", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 17, "id": "1b25fa6a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "WrappedApiResponse[PlacedOrderModel](status='OK', data=PlacedOrderModel(id=2050691261405106176, external_id='2086693366017286885389519438339814648744553778933279076626766785755625256374'), error=None, pagination=None)" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "order_resp" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "resp_invalid_order_params = {\"status\":\"ERROR\",\"error\":{\"code\":1133,\"message\":\"Invalid order parameters\"}}\n", "resp_cant_find_replace_id = {\"status\":\"ERROR\",\"error\":{\"code\":1142,\"message\":\"Edit order not found\"}}\n", "resp_trading_fees_invalid = {\"status\":\"ERROR\",\"error\":{\"code\":1128,\"message\":\"Trading fees are invalid\"}}\n", "resp_invalid_px_precision = {\"status\":\"ERROR\",\"error\":{\"code\":1125,\"message\":\"Invalid price precision\"}}" ] }, { "cell_type": "code", "execution_count": 8, "id": "07887649", "metadata": {}, "outputs": [], "source": [ "### Figure out how to flatten small residuals - market order with reduce only?)" ] }, { "cell_type": "code", "execution_count": 9, "id": "4b39754d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'status': 'OK', 'data': EmptyModel(), 'error': None, 'pagination': None}" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dict(await trading_client.orders.cancel_order(order_id='123'))" ] }, { "cell_type": "code", "execution_count": null, "id": "976ca20d", "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": "c366706f", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Error response from https://api.starknet.extended.exchange/api/v1/user/order: {\"status\":\"ERROR\",\"error\":{\"code\":1120,\"message\":\"Order quantity less than min trade size\"}}\n" ] }, { "ename": "ValueError", "evalue": "Error response from https://api.starknet.extended.exchange/api/v1/user/order: code 400 - {\"status\":\"ERROR\",\"error\":{\"code\":1120,\"message\":\"Order quantity less than min trade size\"}}", "output_type": "error", "traceback": [ "\u001b[31m---------------------------------------------------------------------------\u001b[39m", "\u001b[31mValueError\u001b[39m Traceback (most recent call last)", "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[10]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m placed_order = await trading_client.place_order(\n\u001b[32m 2\u001b[39m market_name=ORDER_MARKET,\n\u001b[32m 3\u001b[39m amount_of_synthetic=ORDER_QTY,\n\u001b[32m 4\u001b[39m price=ORDER_PRICE,\n", "\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/py_313/lib/python3.13/site-packages/x10/perpetual/trading_client/trading_client.py:101\u001b[39m, in \u001b[36mPerpetualTradingClient.place_order\u001b[39m\u001b[34m(self, market_name, amount_of_synthetic, price, side, taker_fee, post_only, previous_order_id, expire_time, time_in_force, self_trade_protection_level, external_id, builder_fee, builder_id, reduce_only, tp_sl_type, take_profit, stop_loss)\u001b[39m\n\u001b[32m 78\u001b[39m expire_time = utc_now() + timedelta(hours=\u001b[32m1\u001b[39m)\n\u001b[32m 80\u001b[39m order = create_order_object(\n\u001b[32m 81\u001b[39m account=\u001b[38;5;28mself\u001b[39m.__stark_account,\n\u001b[32m 82\u001b[39m market=market,\n\u001b[32m (...)\u001b[39m\u001b[32m 99\u001b[39m stop_loss=stop_loss,\n\u001b[32m 100\u001b[39m )\n\u001b[32m--> \u001b[39m\u001b[32m101\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m.__order_management_module.place_order(order)\n", "\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/py_313/lib/python3.13/site-packages/x10/perpetual/trading_client/order_management_module.py:31\u001b[39m, in \u001b[36mOrderManagementModule.place_order\u001b[39m\u001b[34m(self, order)\u001b[39m\n\u001b[32m 28\u001b[39m LOGGER.debug(\u001b[33m\"\u001b[39m\u001b[33mPlacing an order: id=\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m, order.id)\n\u001b[32m 30\u001b[39m url = \u001b[38;5;28mself\u001b[39m._get_url(\u001b[33m\"\u001b[39m\u001b[33m/user/order\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m---> \u001b[39m\u001b[32m31\u001b[39m response = \u001b[38;5;28;01mawait\u001b[39;00m send_post_request(\n\u001b[32m 32\u001b[39m \u001b[38;5;28;01mawait\u001b[39;00m \u001b[38;5;28mself\u001b[39m.get_session(),\n\u001b[32m 33\u001b[39m url,\n\u001b[32m 34\u001b[39m PlacedOrderModel,\n\u001b[32m 35\u001b[39m json=order.to_api_request_json(exclude_none=\u001b[38;5;28;01mTrue\u001b[39;00m),\n\u001b[32m 36\u001b[39m api_key=\u001b[38;5;28mself\u001b[39m._get_api_key(),\n\u001b[32m 37\u001b[39m )\n\u001b[32m 38\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m response\n", "\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/py_313/lib/python3.13/site-packages/x10/utils/http.py:173\u001b[39m, in \u001b[36msend_post_request\u001b[39m\u001b[34m(session, url, model_class, json, api_key, request_headers, response_code_to_exception)\u001b[39m\n\u001b[32m 171\u001b[39m \u001b[38;5;28;01masync\u001b[39;00m \u001b[38;5;28;01mwith\u001b[39;00m session.post(url, json=json, headers=headers) \u001b[38;5;28;01mas\u001b[39;00m response:\n\u001b[32m 172\u001b[39m response_text = \u001b[38;5;28;01mawait\u001b[39;00m response.text()\n\u001b[32m--> \u001b[39m\u001b[32m173\u001b[39m \u001b[30;43mhandle_known_errors\u001b[39;49m\u001b[30;43m(\u001b[39;49m\u001b[30;43murl\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43mresponse_code_to_exception\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43mresponse\u001b[39;49m\u001b[30;43m,\u001b[39;49m\u001b[30;43m \u001b[39;49m\u001b[30;43mresponse_text\u001b[39;49m\u001b[30;43m)\u001b[39;49m\n\u001b[32m 174\u001b[39m response_model = parse_response_to_model(response_text, model_class)\n\u001b[32m 176\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m (response_model.status != ResponseStatus.OK) \u001b[38;5;129;01mor\u001b[39;00m (response_model.error \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m):\n", "\u001b[36mFile \u001b[39m\u001b[32m~/miniconda3/envs/py_313/lib/python3.13/site-packages/x10/utils/http.py:243\u001b[39m, in \u001b[36mhandle_known_errors\u001b[39m\u001b[34m(url, response_code_handler, response, response_text)\u001b[39m\n\u001b[32m 241\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m response.status > \u001b[32m299\u001b[39m:\n\u001b[32m 242\u001b[39m LOGGER.error(\u001b[33m\"\u001b[39m\u001b[33mError response from \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[33m\"\u001b[39m, url, response_text)\n\u001b[32m--> \u001b[39m\u001b[32m243\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mValueError\u001b[39;00m(\u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33mError response from \u001b[39m\u001b[38;5;132;01m{\u001b[39;00murl\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m: code \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mresponse.status\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m - \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mresponse_text\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m\"\u001b[39m)\n", "\u001b[31mValueError\u001b[39m: Error response from https://api.starknet.extended.exchange/api/v1/user/order: code 400 - {\"status\":\"ERROR\",\"error\":{\"code\":1120,\"message\":\"Order quantity less than min trade size\"}}" ] } ], "source": [ "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", " post_only=True,\n", " reduce_only=True\n", " # previous_order_id='1295034892466447624365619416628580523728221205816494340545831832663414858661'\n", ")" ] }, { "cell_type": "code", "execution_count": 15, "id": "ba85f1e9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "WrappedApiResponse[PlacedOrderModel](status='OK', data=PlacedOrderModel(id=2049239831434784768, external_id='359148168147219671570709517544221313286652228166698232409514334035033828578'), error=None, pagination=None)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "placed_order" ] }, { "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", "execution_count": null, "id": "03913674", "metadata": {}, "outputs": [], "source": [ "trading_client.orders." ] }, { "cell_type": "code", "execution_count": 59, "id": "8dd8aa73", "metadata": {}, "outputs": [], "source": [ "d = await trading_client.markets_info.get_candles_history(\n", " market_name='BTC-USD',\n", " candle_type = 'trades',\n", " interval='PT1M',\n", " limit=1_440\n", ")" ] }, { "cell_type": "code", "execution_count": 60, "id": "5c8a6ad1", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "df = pd.DataFrame([dict(x) for x in d.data])" ] }, { "cell_type": "code", "execution_count": 61, "id": "962bb6d6", "metadata": {}, "outputs": [], "source": [ "df['timestamp_dt'] = pd.to_datetime(df['timestamp'], unit='ms')" ] }, { "cell_type": "code", "execution_count": 62, "id": "517355b0", "metadata": {}, "outputs": [ { "data": { "application/vnd.microsoft.datawrangler.viewer.v0+json": { "columns": [ { "name": "index", "rawType": "int64", "type": "integer" }, { "name": "open", "rawType": "object", "type": "unknown" }, { "name": "low", "rawType": "object", "type": "unknown" }, { "name": "high", "rawType": "object", "type": "unknown" }, { "name": "close", "rawType": "object", "type": "unknown" }, { "name": "volume", "rawType": "object", "type": "unknown" }, { "name": "timestamp", "rawType": "int64", "type": "integer" }, { "name": "timestamp_dt", "rawType": "datetime64[ms]", "type": "datetime" } ], "ref": "63978fcf-477d-437c-8547-a031ebf66676", "rows": [ [ "0", "78645", "78645", "78646", "78645.5", "0.0533", "1777827360000", "2026-05-03 16:56:00" ], [ "1", "78645.5", "78645", "78646", "78645", "1.15176", "1777827300000", "2026-05-03 16:55:00" ], [ "2", "78648.5", "78645", "78649", "78645.5", "1.50552", "1777827240000", "2026-05-03 16:54:00" ], [ "3", "78648.5", "78648", "78649", "78648.5", "0.65464", "1777827180000", "2026-05-03 16:53:00" ], [ "4", "78654.5", "78648", "78655", "78648.5", "0.20882", "1777827120000", "2026-05-03 16:52:00" ], [ "5", "78654.5", "78654.5", "78655", "78654.5", "0.20028", "1777827060000", "2026-05-03 16:51:00" ], [ "6", "78652.5", "78652.5", "78655", "78654.5", "0.43716", "1777827000000", "2026-05-03 16:50:00" ], [ "7", "78652.5", "78652", "78653", "78652.5", "0.18946", "1777826940000", "2026-05-03 16:49:00" ], [ "8", "78662.5", "78652.5", "78663", "78652.5", "0.68504", "1777826880000", "2026-05-03 16:48:00" ], [ "9", "78662.5", "78662", "78663", "78662.5", "0.01284", "1777826820000", "2026-05-03 16:47:00" ], [ "10", "78662.5", "78662", "78663", "78662.5", "0.0097", "1777826760000", "2026-05-03 16:46:00" ], [ "11", "78662.5", "78662.5", "78663", "78662.5", "0.00028", "1777826700000", "2026-05-03 16:45:00" ], [ "12", "78662.5", "78662", "78663", "78662.5", "0.01378", "1777826640000", "2026-05-03 16:44:00" ], [ "13", "78662.5", "78662", "78663", "78662.5", "0.00534", "1777826580000", "2026-05-03 16:43:00" ], [ "14", "78658.5", "78658.5", "78663", "78662.5", "0.58", "1777826520000", "2026-05-03 16:42:00" ], [ "15", "78658.5", "78658", "78659", "78658.5", "0.00186", "1777826460000", "2026-05-03 16:41:00" ], [ "16", "78663.5", "78658.5", "78664", "78658.5", "0.04362", "1777826400000", "2026-05-03 16:40:00" ], [ "17", "78645.5", "78645.5", "78663.5", "78663.5", "1.02718", "1777826340000", "2026-05-03 16:39:00" ], [ "18", "78676.5", "78645", "78677", "78645.5", "10.10844", "1777826280000", "2026-05-03 16:38:00" ], [ "19", "78676.5", "78676", "78677", "78676.5", "0.89886", "1777826220000", "2026-05-03 16:37:00" ], [ "20", "78676.5", "78676", "78677", "78676.5", "0.00216", "1777826160000", "2026-05-03 16:36:00" ], [ "21", "78658.5", "78658.5", "78704.5", "78676.5", "3.2846", "1777826100000", "2026-05-03 16:35:00" ], [ "22", "78629.5", "78629", "78658.5", "78658.5", "1.50806", "1777826040000", "2026-05-03 16:34:00" ], [ "23", "78621.5", "78621.5", "78629.5", "78629.5", "2.52248", "1777825980000", "2026-05-03 16:33:00" ], [ "24", "78609.5", "78609", "78622", "78621.5", "0.5831", "1777825920000", "2026-05-03 16:32:00" ], [ "25", "78609.5", "78609", "78610", "78609.5", "0.08858", "1777825860000", "2026-05-03 16:31:00" ], [ "26", "78588.5", "78588", "78612", "78609.5", "3.58532", "1777825800000", "2026-05-03 16:30:00" ], [ "27", "78588.5", "78588", "78589", "78588.5", "0.04806", "1777825740000", "2026-05-03 16:29:00" ], [ "28", "78588.5", "78588", "78589", "78588.5", "0.869", "1777825680000", "2026-05-03 16:28:00" ], [ "29", "78588.5", "78588", "78589", "78588.5", "2.13648", "1777825620000", "2026-05-03 16:27:00" ], [ "30", "78588.5", "78588", "78589", "78588.5", "2.58448", "1777825560000", "2026-05-03 16:26:00" ], [ "31", "78577", "78576.5", "78589", "78588.5", "6.09502", "1777825500000", "2026-05-03 16:25:00" ], [ "32", "78554.5", "78554", "78577", "78577", "17.75576", "1777825440000", "2026-05-03 16:24:00" ], [ "33", "78543.5", "78543.5", "78555", "78554.5", "8.98054", "1777825380000", "2026-05-03 16:23:00" ], [ "34", "78526.5", "78526.5", "78543.5", "78543.5", "1.08446", "1777825320000", "2026-05-03 16:22:00" ], [ "35", "78526.5", "78526.5", "78527", "78526.5", "0.00028", "1777825260000", "2026-05-03 16:21:00" ], [ "36", "78546.5", "78526.5", "78547", "78526.5", "1.67966", "1777825200000", "2026-05-03 16:20:00" ], [ "37", "78558.5", "78546.5", "78559", "78546.5", "9.70932", "1777825140000", "2026-05-03 16:19:00" ], [ "38", "78558.5", "78558.5", "78559", "78558.5", "0.25694", "1777825080000", "2026-05-03 16:18:00" ], [ "39", "78543.5", "78543", "78558.5", "78558.5", "0.73562", "1777825020000", "2026-05-03 16:17:00" ], [ "40", "78544.5", "78543.5", "78545", "78543.5", "0.0081", "1777824960000", "2026-05-03 16:16:00" ], [ "41", "78545.5", "78544.5", "78546", "78544.5", "0.11054", "1777824900000", "2026-05-03 16:15:00" ], [ "42", "78545.5", "78545", "78546", "78545.5", "0.09854", "1777824840000", "2026-05-03 16:14:00" ], [ "43", "78545.5", "78545.5", "78546", "78545.5", "0.00152", "1777824780000", "2026-05-03 16:13:00" ], [ "44", "78545.5", "78545.5", "78546", "78545.5", "0.50052", "1777824720000", "2026-05-03 16:12:00" ], [ "45", "78545.5", "78545", "78546", "78545.5", "0.33716", "1777824660000", "2026-05-03 16:11:00" ], [ "46", "78549.5", "78545", "78550", "78545.5", "0.08204", "1777824600000", "2026-05-03 16:10:00" ], [ "47", "78549.5", "78549", "78550", "78549.5", "0.08698", "1777824540000", "2026-05-03 16:09:00" ], [ "48", "78566.5", "78549", "78567", "78549.5", "1.53434", "1777824480000", "2026-05-03 16:08:00" ], [ "49", "78586.5", "78566.5", "78587", "78566.5", "0.42562", "1777824420000", "2026-05-03 16:07:00" ] ], "shape": { "columns": 7, "rows": 1439 } }, "text/html": [ "
| \n", " | open | \n", "low | \n", "high | \n", "close | \n", "volume | \n", "timestamp | \n", "timestamp_dt | \n", "
|---|---|---|---|---|---|---|---|
| 0 | \n", "78645 | \n", "78645 | \n", "78646 | \n", "78645.5 | \n", "0.0533 | \n", "1777827360000 | \n", "2026-05-03 16:56:00 | \n", "
| 1 | \n", "78645.5 | \n", "78645 | \n", "78646 | \n", "78645 | \n", "1.15176 | \n", "1777827300000 | \n", "2026-05-03 16:55:00 | \n", "
| 2 | \n", "78648.5 | \n", "78645 | \n", "78649 | \n", "78645.5 | \n", "1.50552 | \n", "1777827240000 | \n", "2026-05-03 16:54:00 | \n", "
| 3 | \n", "78648.5 | \n", "78648 | \n", "78649 | \n", "78648.5 | \n", "0.65464 | \n", "1777827180000 | \n", "2026-05-03 16:53:00 | \n", "
| 4 | \n", "78654.5 | \n", "78648 | \n", "78655 | \n", "78648.5 | \n", "0.20882 | \n", "1777827120000 | \n", "2026-05-03 16:52:00 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 1434 | \n", "78408.5 | \n", "78408.5 | \n", "78408.5 | \n", "78408.5 | \n", "0 | \n", "1777741320000 | \n", "2026-05-02 17:02:00 | \n", "
| 1435 | \n", "78408.5 | \n", "78408.5 | \n", "78408.5 | \n", "78408.5 | \n", "0 | \n", "1777741260000 | \n", "2026-05-02 17:01:00 | \n", "
| 1436 | \n", "78411.5 | \n", "78402 | \n", "78412 | \n", "78408.5 | \n", "0.39216 | \n", "1777741200000 | \n", "2026-05-02 17:00:00 | \n", "
| 1437 | \n", "78411.5 | \n", "78411.5 | \n", "78411.5 | \n", "78411.5 | \n", "0 | \n", "1777741140000 | \n", "2026-05-02 16:59:00 | \n", "
| 1438 | \n", "78419.5 | \n", "78411.5 | \n", "78420 | \n", "78411.5 | \n", "0.17484 | \n", "1777741080000 | \n", "2026-05-02 16:58:00 | \n", "
1439 rows × 7 columns
\n", "| \n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "4 | \n", "5 | \n", "6 | \n", "7 | \n", "8 | \n", "9 | \n", "10 | \n", "11 | \n", "12 | \n", "13 | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "(id, 2047947640758337536) | \n", "(account_id, 270571) | \n", "(market, ETH-USD) | \n", "(side, SHORT) | \n", "(size, 0.2160000000000000) | \n", "(max_position_size, 0.2160000000000000) | \n", "(leverage, 50.0000000000000000) | \n", "(open_price, 2315.5000000000000000) | \n", "(exit_price, 2308.6000000000000000) | \n", "(realised_pnl, 1.4249250000000000) | \n", "(realised_pnl_breakdown, trade_pnl=Decimal('1.... | \n", "(created_time, 1777103741241) | \n", "(exit_type, TRADE) | \n", "(closed_time, 1777133049026) | \n", "
| 1 | \n", "(id, 2047512381621272576) | \n", "(account_id, 270571) | \n", "(market, ETH-USD) | \n", "(side, LONG) | \n", "(size, 0.2150000000000000) | \n", "(max_position_size, 0.2150000000000000) | \n", "(leverage, 50.0000000000000000) | \n", "(open_price, 2316.6000000000000000) | \n", "(exit_price, 2315.5000000000000000) | \n", "(realised_pnl, 0.0720660000000000) | \n", "(realised_pnl_breakdown, trade_pnl=Decimal('-0... | \n", "(created_time, 1776999967376) | \n", "(exit_type, TRADE) | \n", "(closed_time, 1777103741241) | \n", "
| 2 | \n", "(id, 2047419314696355840) | \n", "(account_id, 270571) | \n", "(market, ETH-USD) | \n", "(side, LONG) | \n", "(size, 0.2150000000000000) | \n", "(max_position_size, 0.2150000000000000) | \n", "(leverage, 50.0000000000000000) | \n", "(open_price, 2321.7000000000000000) | \n", "(exit_price, 2327.3000000000000000) | \n", "(realised_pnl, 1.3196460000000000) | \n", "(realised_pnl_breakdown, trade_pnl=Decimal('1.... | \n", "(created_time, 1776977778492) | \n", "(exit_type, TRADE) | \n", "(closed_time, 1776996621824) | \n", "