@0xmonaco/types 0.8.7-develop.5d0e403 → 0.8.7-develop.a107b34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -713,7 +713,7 @@ export interface paths {
713
713
  };
714
714
  get: operations["list_margin_accounts"];
715
715
  put?: never;
716
- post: operations["ensure_parent_margin_account"];
716
+ post?: never;
717
717
  delete?: never;
718
718
  options?: never;
719
719
  head?: never;
@@ -816,7 +816,71 @@ export interface paths {
816
816
  patch?: never;
817
817
  trace?: never;
818
818
  };
819
- "/api/v1/margin/collateral/transfer-in": {
819
+ "/api/v1/margin/parent-margin-account": {
820
+ parameters: {
821
+ query?: never;
822
+ header?: never;
823
+ path?: never;
824
+ cookie?: never;
825
+ };
826
+ get: operations["get_parent_margin_account_summary"];
827
+ put?: never;
828
+ post?: never;
829
+ delete?: never;
830
+ options?: never;
831
+ head?: never;
832
+ patch?: never;
833
+ trace?: never;
834
+ };
835
+ "/api/v1/margin/parent-margin-account/collateral/transfer-in": {
836
+ parameters: {
837
+ query?: never;
838
+ header?: never;
839
+ path?: never;
840
+ cookie?: never;
841
+ };
842
+ get?: never;
843
+ put?: never;
844
+ post: operations["transfer_collateral_to_parent_margin_account"];
845
+ delete?: never;
846
+ options?: never;
847
+ head?: never;
848
+ patch?: never;
849
+ trace?: never;
850
+ };
851
+ "/api/v1/margin/parent-margin-account/collateral/transfer-out": {
852
+ parameters: {
853
+ query?: never;
854
+ header?: never;
855
+ path?: never;
856
+ cookie?: never;
857
+ };
858
+ get?: never;
859
+ put?: never;
860
+ post: operations["transfer_collateral_from_parent_margin_account"];
861
+ delete?: never;
862
+ options?: never;
863
+ head?: never;
864
+ patch?: never;
865
+ trace?: never;
866
+ };
867
+ "/api/v1/margin/parent-margin-account/movements": {
868
+ parameters: {
869
+ query?: never;
870
+ header?: never;
871
+ path?: never;
872
+ cookie?: never;
873
+ };
874
+ get: operations["get_parent_margin_account_movements"];
875
+ put?: never;
876
+ post?: never;
877
+ delete?: never;
878
+ options?: never;
879
+ head?: never;
880
+ patch?: never;
881
+ trace?: never;
882
+ };
883
+ "/api/v1/margin/parent-margin-account/simulate-order-risk": {
820
884
  parameters: {
821
885
  query?: never;
822
886
  header?: never;
@@ -825,14 +889,14 @@ export interface paths {
825
889
  };
826
890
  get?: never;
827
891
  put?: never;
828
- post: operations["transfer_collateral_to_auto_margin_account"];
892
+ post: operations["simulate_parent_margin_order_risk"];
829
893
  delete?: never;
830
894
  options?: never;
831
895
  head?: never;
832
896
  patch?: never;
833
897
  trace?: never;
834
898
  };
835
- "/api/v1/margin/simulate-order-risk": {
899
+ "/api/v1/margin/risk-buckets/collateral/transfer-in": {
836
900
  parameters: {
837
901
  query?: never;
838
902
  header?: never;
@@ -841,7 +905,23 @@ export interface paths {
841
905
  };
842
906
  get?: never;
843
907
  put?: never;
844
- post: operations["simulate_auto_margin_order_risk"];
908
+ post: operations["transfer_collateral_to_risk_bucket"];
909
+ delete?: never;
910
+ options?: never;
911
+ head?: never;
912
+ patch?: never;
913
+ trace?: never;
914
+ };
915
+ "/api/v1/margin/risk-buckets/simulate-order-risk": {
916
+ parameters: {
917
+ query?: never;
918
+ header?: never;
919
+ path?: never;
920
+ cookie?: never;
921
+ };
922
+ get?: never;
923
+ put?: never;
924
+ post: operations["simulate_risk_bucket_order_risk"];
845
925
  delete?: never;
846
926
  options?: never;
847
927
  head?: never;
@@ -1089,6 +1169,30 @@ export interface paths {
1089
1169
  patch?: never;
1090
1170
  trace?: never;
1091
1171
  };
1172
+ "/api/v1/market/stats": {
1173
+ parameters: {
1174
+ query?: never;
1175
+ header?: never;
1176
+ path?: never;
1177
+ cookie?: never;
1178
+ };
1179
+ /**
1180
+ * Market Stats
1181
+ * @description Market Stats
1182
+ *
1183
+ * Exchange-wide life-to-date (since-inception) cumulative totals across all
1184
+ * trading pairs: total quote-token volume and total number of trades. No
1185
+ * auth required.
1186
+ */
1187
+ get: operations["get_market_stats"];
1188
+ put?: never;
1189
+ post?: never;
1190
+ delete?: never;
1191
+ options?: never;
1192
+ head?: never;
1193
+ patch?: never;
1194
+ trace?: never;
1195
+ };
1092
1196
  "/api/v1/orderbook/{trading_pair_id}": {
1093
1197
  parameters: {
1094
1198
  query?: never;
@@ -1291,8 +1395,7 @@ export interface paths {
1291
1395
  /** @description List conditional TP/SL orders for the authenticated user. */
1292
1396
  get: operations["list_conditional_orders"];
1293
1397
  put?: never;
1294
- /** @description Create conditional TP/SL order. */
1295
- post: operations["create_conditional_order"];
1398
+ post?: never;
1296
1399
  delete?: never;
1297
1400
  options?: never;
1298
1401
  head?: never;
@@ -1362,6 +1465,30 @@ export interface paths {
1362
1465
  patch?: never;
1363
1466
  trace?: never;
1364
1467
  };
1468
+ "/api/v1/positions/batch-close-all": {
1469
+ parameters: {
1470
+ query?: never;
1471
+ header?: never;
1472
+ path?: never;
1473
+ cookie?: never;
1474
+ };
1475
+ get?: never;
1476
+ put?: never;
1477
+ /**
1478
+ * @description Close all open positions in a single batch ("panic close").
1479
+ *
1480
+ * Submits a MARKET reduce-only close for every open position owned by the
1481
+ * caller, optionally filtered to a single trading pair. Best-effort and
1482
+ * partial: each position closes independently and per-position failures are
1483
+ * reported in `results` rather than aborting the batch.
1484
+ */
1485
+ post: operations["batch_close_all_positions"];
1486
+ delete?: never;
1487
+ options?: never;
1488
+ head?: never;
1489
+ patch?: never;
1490
+ trace?: never;
1491
+ };
1365
1492
  "/api/v1/positions/history": {
1366
1493
  parameters: {
1367
1494
  query?: never;
@@ -1496,23 +1623,6 @@ export interface paths {
1496
1623
  patch?: never;
1497
1624
  trace?: never;
1498
1625
  };
1499
- "/api/v1/trades/user": {
1500
- parameters: {
1501
- query?: never;
1502
- header?: never;
1503
- path?: never;
1504
- cookie?: never;
1505
- };
1506
- /** @description Authenticated user's perp/spot trade history. */
1507
- get: operations["list_user_trades"];
1508
- put?: never;
1509
- post?: never;
1510
- delete?: never;
1511
- options?: never;
1512
- head?: never;
1513
- patch?: never;
1514
- trace?: never;
1515
- };
1516
1626
  "/api/v1/trades/{trading_pair_id}": {
1517
1627
  parameters: {
1518
1628
  query?: never;
@@ -1573,9 +1683,10 @@ export interface paths {
1573
1683
  *
1574
1684
  * Master accounts with the withdraw permission only. Routes through the
1575
1685
  * matching engine to debit the balance and allocate a `withdrawal_index`,
1576
- * then returns the target vault address and the signed
1577
- * `executeSignedWithdrawal` calldata the caller submits on-chain. No further
1578
- * server-side signing is required.
1686
+ * then returns it plus the target vault address. The `calldata` field is
1687
+ * empty: `executeWithdrawal` requires the merkle proof, which only exists
1688
+ * after the withdrawal's root is confirmed on-chain. Poll GetWithdrawal to
1689
+ * obtain the calldata once it is ready.
1579
1690
  */
1580
1691
  post: operations["initiate_withdrawal"];
1581
1692
  delete?: never;
@@ -1593,13 +1704,15 @@ export interface paths {
1593
1704
  };
1594
1705
  /**
1595
1706
  * Get withdrawal
1596
- * @description Re-fetch a withdrawal's signed calldata.
1707
+ * @description Fetch a withdrawal's executable calldata by index.
1597
1708
  *
1598
- * Public lookup — no auth. Returns the same response shape as
1599
- * InitiateWithdrawal for a previously-initiated `withdrawal_index`. The
1600
- * calldata is signed against a fixed (index, metadata, destination, token,
1601
- * amount) tuple, so re-fetching it cannot redirect funds: resubmitting it
1602
- * on-chain always pays the original destination.
1709
+ * Public lookup — no auth. Returns the vault address and ABI-encoded
1710
+ * `executeWithdrawal(...)` calldata for a previously-initiated
1711
+ * `withdrawal_index`. The calldata is bound to the fixed
1712
+ * (index, metadata, owner, destination, token, amount) tuple persisted for
1713
+ * the withdrawal, so re-fetching it cannot redirect funds. Returns 409 while
1714
+ * the withdrawal's root has not been confirmed on-chain yet (proof not
1715
+ * available) — clients poll this endpoint until it succeeds.
1603
1716
  */
1604
1717
  get: operations["get_withdrawal"];
1605
1718
  put?: never;
@@ -1682,6 +1795,11 @@ export interface components {
1682
1795
  * @example 123e4567-e89b-12d3-a456-426614174000
1683
1796
  */
1684
1797
  asset_id?: string | null;
1798
+ /**
1799
+ * @description Raw total balance (available + locked) in smallest token unit
1800
+ * @example 1050750000
1801
+ */
1802
+ total_balance_raw?: string | null;
1685
1803
  };
1686
1804
  AddPositionMarginRequest: {
1687
1805
  /** @description Collateral asset to move into the isolated bucket. USDC is the current v1 path. */
@@ -2025,6 +2143,60 @@ export interface components {
2025
2143
  cancelled_at?: string | null;
2026
2144
  error?: components["schemas"]["BatchCancelError"];
2027
2145
  };
2146
+ BatchCloseAllRequest: {
2147
+ /**
2148
+ * Format: uuid
2149
+ * @description Optional trading-pair filter. When set, only open positions on this
2150
+ * trading pair are closed; otherwise every open position is closed.
2151
+ */
2152
+ trading_pair_id?: string | null;
2153
+ /**
2154
+ * Format: int32
2155
+ * @description Optional slippage tolerance (basis points) applied to each MARKET close.
2156
+ */
2157
+ slippage_tolerance_bps?: number | null;
2158
+ };
2159
+ BatchCloseAllResponse: {
2160
+ /**
2161
+ * Format: int32
2162
+ * @description Number of open positions the batch attempted to close.
2163
+ */
2164
+ total_requested?: number | null;
2165
+ /**
2166
+ * Format: int32
2167
+ * @description Number of positions whose close order was accepted by the matching engine
2168
+ * (SUCCESS, PARTIAL, or PENDING).
2169
+ */
2170
+ total_closed?: number | null;
2171
+ /**
2172
+ * Format: int32
2173
+ * @description Number of positions whose close failed (validation, lookup, or a rejected
2174
+ * close order).
2175
+ */
2176
+ total_failed?: number | null;
2177
+ results?: components["schemas"]["BatchCloseResult"][] | null;
2178
+ };
2179
+ BatchCloseError: {
2180
+ /**
2181
+ * @description Machine-readable error code (e.g. POSITION_NOT_FOUND, INVALID_REQUEST,
2182
+ * MATCHING_ENGINE_ERROR).
2183
+ */
2184
+ code?: string | null;
2185
+ /** @description Human-readable error message. */
2186
+ message?: string | null;
2187
+ };
2188
+ BatchCloseResult: {
2189
+ /** @description Position UUID this result is for. */
2190
+ position_id?: string | null;
2191
+ /** @description Close order UUID. Present when the close order was accepted. */
2192
+ close_order_id?: string | null;
2193
+ /** @description Close outcome: SUCCESS, PARTIAL, or PENDING. Present when accepted. */
2194
+ status?: string | null;
2195
+ /** @description Quantity submitted on the close order. Present when accepted. */
2196
+ submitted_quantity?: string | null;
2197
+ /** @description Failure detail. Present when this position could not be closed. */
2198
+ error?: components["schemas"]["BatchCloseError"] | null;
2199
+ };
2028
2200
  BatchCreateError: {
2029
2201
  /**
2030
2202
  * @description Machine-readable error code
@@ -2098,15 +2270,15 @@ export interface components {
2098
2270
  margin_account_id?: string | null;
2099
2271
  /**
2100
2272
  * Format: uuid
2101
- * @description Existing isolated margin bucket UUID for bucket-scoped margin orders
2273
+ * @description Existing isolated risk bucket UUID for risk-bucket-scoped margin orders
2102
2274
  * @example 123e4567-e89b-12d3-a456-426614174001
2103
2275
  */
2104
- margin_bucket_id?: string | null;
2276
+ risk_bucket_id?: string | null;
2105
2277
  /**
2106
- * @description Decimal collateral to allocate into a new isolated margin bucket. When provided, the API creates the bucket ID and matching-engine persists the bucket through the durable log.
2278
+ * @description Decimal collateral to allocate into a new isolated risk bucket. When provided, the API creates the bucket ID and matching-engine persists the bucket through the durable log.
2107
2279
  * @example 1000
2108
2280
  */
2109
- margin_bucket_collateral?: string | null;
2281
+ risk_bucket_collateral?: string | null;
2110
2282
  /**
2111
2283
  * @description Position side for margin orders: LONG, SHORT, or NONE
2112
2284
  * @example LONG
@@ -2123,6 +2295,11 @@ export interface components {
2123
2295
  * @example false
2124
2296
  */
2125
2297
  reduce_only?: boolean | null;
2298
+ /**
2299
+ * @description Strategy key used to group risk buckets for delegated/margin orders
2300
+ * @example my-strategy
2301
+ */
2302
+ strategy_key?: string | null;
2126
2303
  };
2127
2304
  BatchCreateOrdersRequest: {
2128
2305
  orders: components["schemas"]["BatchCreateOrderItem"][];
@@ -2406,100 +2583,6 @@ export interface components {
2406
2583
  association_type?: string | null;
2407
2584
  activated_at?: string | null;
2408
2585
  };
2409
- CreateConditionalOrderRequest: {
2410
- /**
2411
- * Format: uuid
2412
- * @description MARGIN trading pair UUID
2413
- * @example 123e4567-e89b-12d3-a456-426614174000
2414
- */
2415
- trading_pair_id: string;
2416
- /**
2417
- * Format: uuid
2418
- * @description Isolated margin account UUID
2419
- * @example 123e4567-e89b-12d3-a456-426614174000
2420
- */
2421
- margin_account_id: string;
2422
- /**
2423
- * @description STOP_LOSS or TAKE_PROFIT
2424
- * @enum {string}
2425
- */
2426
- condition_type: "STOP_LOSS" | "TAKE_PROFIT";
2427
- /**
2428
- * @description Mark price that triggers the conditional order
2429
- * @example 65000
2430
- */
2431
- trigger_price: string;
2432
- /**
2433
- * @description Trigger source; v1 supports MARK_PRICE
2434
- * @enum {string}
2435
- */
2436
- trigger_source: "MARK_PRICE";
2437
- /**
2438
- * @description Close order side: BUY or SELL
2439
- * @enum {string}
2440
- */
2441
- side: "BUY" | "SELL";
2442
- /**
2443
- * @description Position side being reduced: LONG or SHORT
2444
- * @enum {string}
2445
- */
2446
- position_side: "LONG" | "SHORT";
2447
- /**
2448
- * @description Triggered order type: MARKET or LIMIT
2449
- * @enum {string}
2450
- */
2451
- order_type: "MARKET" | "LIMIT";
2452
- /**
2453
- * @description Limit price for LIMIT conditional orders
2454
- * @example 64950
2455
- */
2456
- limit_price?: string | null;
2457
- /**
2458
- * @description Quantity to close; omit for full current position size
2459
- * @example 0.5
2460
- */
2461
- quantity?: string | null;
2462
- /**
2463
- * @description Must be true for TP/SL
2464
- * @example true
2465
- */
2466
- reduce_only: boolean;
2467
- /**
2468
- * @description LIMIT only: GTC or IOC
2469
- * @enum {string|null}
2470
- */
2471
- time_in_force?: "GTC" | "IOC" | null;
2472
- /**
2473
- * Format: int32
2474
- * @description MARKET only slippage tolerance in basis points
2475
- * @example 50
2476
- */
2477
- slippage_tolerance_bps?: number | null;
2478
- /**
2479
- * @description Optional conditional order expiry timestamp (ISO 8601)
2480
- * @example 2026-06-01T00:00:00Z
2481
- */
2482
- expires_at?: string | null;
2483
- };
2484
- CreateConditionalOrderResponse: {
2485
- /**
2486
- * Format: uuid
2487
- * @description Conditional order UUID
2488
- */
2489
- conditional_order_id?: string | null;
2490
- /**
2491
- * @description Result status
2492
- * @example SUCCESS
2493
- */
2494
- status?: string | null;
2495
- /** @description Human-readable status message */
2496
- message?: string | null;
2497
- /**
2498
- * @description Conditional order lifecycle state
2499
- * @example ACTIVE
2500
- */
2501
- state?: string | null;
2502
- };
2503
2586
  CreateDelegatedSessionRequest: {
2504
2587
  /**
2505
2588
  * Format: uuid
@@ -2614,15 +2697,15 @@ export interface components {
2614
2697
  margin_account_id?: string | null;
2615
2698
  /**
2616
2699
  * Format: uuid
2617
- * @description Existing isolated margin bucket UUID for bucket-scoped margin orders
2700
+ * @description Existing isolated risk bucket UUID for risk-bucket-scoped margin orders
2618
2701
  * @example 123e4567-e89b-12d3-a456-426614174001
2619
2702
  */
2620
- margin_bucket_id?: string | null;
2703
+ risk_bucket_id?: string | null;
2621
2704
  /**
2622
- * @description Decimal collateral to allocate into a new isolated margin bucket. When provided, the API creates the bucket ID and matching-engine persists the bucket through the durable log.
2705
+ * @description Decimal collateral to allocate into a new isolated risk bucket. When provided, the API creates the bucket ID and matching-engine persists the bucket through the durable log.
2623
2706
  * @example 1000
2624
2707
  */
2625
- margin_bucket_collateral?: string | null;
2708
+ risk_bucket_collateral?: string | null;
2626
2709
  /**
2627
2710
  * @description Position side for margin orders: LONG, SHORT, or NONE
2628
2711
  * @example LONG
@@ -2641,6 +2724,11 @@ export interface components {
2641
2724
  reduce_only?: boolean | null;
2642
2725
  take_profit?: components["schemas"]["ParentTpSlLeg"];
2643
2726
  stop_loss?: components["schemas"]["ParentTpSlLeg"];
2727
+ /**
2728
+ * @description Strategy key used to group risk buckets for delegated/margin orders
2729
+ * @example my-strategy
2730
+ */
2731
+ strategy_key?: string | null;
2644
2732
  };
2645
2733
  CreateOrderResponse: {
2646
2734
  /**
@@ -2677,9 +2765,9 @@ export interface components {
2677
2765
  margin_account_id?: string | null;
2678
2766
  /**
2679
2767
  * Format: uuid
2680
- * @description Resolved isolated margin bucket UUID for bucket-scoped margin orders
2768
+ * @description Resolved isolated risk bucket UUID for risk-bucket-scoped margin orders
2681
2769
  */
2682
- margin_bucket_id?: string | null;
2770
+ risk_bucket_id?: string | null;
2683
2771
  /** @description Client strategy key carried for compatibility */
2684
2772
  strategy_key?: string | null;
2685
2773
  /**
@@ -2756,24 +2844,6 @@ export interface components {
2756
2844
  */
2757
2845
  message?: string | null;
2758
2846
  };
2759
- EnsureParentMarginAccountRequest: {
2760
- /** @description Optional UI label for the parent margin account. */
2761
- label?: string | null;
2762
- /** @description Collateral asset for the parent margin account. USDC is the current v1 path. */
2763
- collateral_asset?: string | null;
2764
- };
2765
- EnsureParentMarginAccountResponse: {
2766
- /**
2767
- * @description Current implementation note:
2768
- * EnsureParentMarginAccount is idempotent and returns the user's parent margin account,
2769
- * initializing it only when no parent exists for the application/collateral scope.
2770
- */
2771
- margin_account_id?: string | null;
2772
- account_state?: string | null;
2773
- collateral_asset?: string | null;
2774
- created_at?: string | null;
2775
- label?: string | null;
2776
- };
2777
2847
  ExecutionPriceRange: {
2778
2848
  /**
2779
2849
  * @description Best execution price achieved
@@ -2908,6 +2978,13 @@ export interface components {
2908
2978
  wallet_available?: string | null;
2909
2979
  wallet_locked?: string | null;
2910
2980
  margin_transferable?: string | null;
2981
+ /**
2982
+ * @description Free collateral currently held in the user's parent margin account for this
2983
+ * asset (equity minus initial margin required), i.e. collateral already inside
2984
+ * margin and available to open new positions or transfer back out. Absent when
2985
+ * the user has no margin account yet.
2986
+ */
2987
+ margin_available_collateral?: string | null;
2911
2988
  };
2912
2989
  GetBalanceByAssetResponse: {
2913
2990
  /** @description Token contract address */
@@ -2954,6 +3031,11 @@ export interface components {
2954
3031
  * @example 123e4567-e89b-12d3-a456-426614174000
2955
3032
  */
2956
3033
  asset_id?: string | null;
3034
+ /**
3035
+ * @description Raw total balance (available + locked) in smallest token unit
3036
+ * @example 1050750000
3037
+ */
3038
+ total_balance_raw?: string | null;
2957
3039
  };
2958
3040
  GetBalancesResponse: {
2959
3041
  balances?: components["schemas"]["AccountBalance"][] | null;
@@ -3055,6 +3137,8 @@ export interface components {
3055
3137
  /** Format: uuid */
3056
3138
  trading_pair_id?: string | null;
3057
3139
  strategy_key?: string | null;
3140
+ risk_bucket_id?: string | null;
3141
+ margin_mode?: string | null;
3058
3142
  };
3059
3143
  GetMarkPriceResponse: {
3060
3144
  /** Format: uuid */
@@ -3142,6 +3226,34 @@ export interface components {
3142
3226
  * @example 95400.00
3143
3227
  */
3144
3228
  index_price?: string | null;
3229
+ /**
3230
+ * @description Life-to-date cumulative base-token volume (since market inception); "0" for a pair with no trades yet
3231
+ * @example 123456.78900000
3232
+ */
3233
+ total_base_volume_ltd?: string | null;
3234
+ /**
3235
+ * @description Life-to-date cumulative quote-token volume (since market inception); "0" for a pair with no trades yet
3236
+ * @example 9123456789.50
3237
+ */
3238
+ total_quote_volume_ltd?: string | null;
3239
+ /**
3240
+ * @description Life-to-date cumulative number of trades (since market inception); 0 for a pair with no trades yet
3241
+ * @example 482931
3242
+ */
3243
+ total_trade_count_ltd?: string | null;
3244
+ };
3245
+ /** @description Exchange-wide life-to-date cumulative market statistics across all trading pairs. */
3246
+ GetMarketStatsResponse: {
3247
+ /**
3248
+ * @description Life-to-date cumulative quote-token (notional) volume summed across all trading pairs
3249
+ * @example 48217365920.75
3250
+ */
3251
+ total_quote_volume_ltd?: string | null;
3252
+ /**
3253
+ * @description Life-to-date cumulative number of trades summed across all trading pairs
3254
+ * @example 19284736
3255
+ */
3256
+ total_trade_count_ltd?: string | null;
3145
3257
  };
3146
3258
  GetMovementsResponse: {
3147
3259
  movements?: components["schemas"]["LedgerMovement"][] | null;
@@ -3329,6 +3441,78 @@ export interface components {
3329
3441
  * @example 123e4567-e89b-12d3-a456-426614174000
3330
3442
  */
3331
3443
  position_id?: string | null;
3444
+ /**
3445
+ * @description Original order quantity in raw format (for precision)
3446
+ * @example 500000000
3447
+ */
3448
+ quantity_raw?: string | null;
3449
+ /**
3450
+ * @description Filled quantity in raw format (for precision)
3451
+ * @example 200000000
3452
+ */
3453
+ filled_quantity_raw?: string | null;
3454
+ /**
3455
+ * @description Remaining unfilled quantity (normalized for display)
3456
+ * @example 0.3
3457
+ */
3458
+ remaining_quantity?: string | null;
3459
+ /**
3460
+ * @description Remaining unfilled quantity in raw format (for precision)
3461
+ * @example 300000000
3462
+ */
3463
+ remaining_quantity_raw?: string | null;
3464
+ /** @description Client-assigned order identifier */
3465
+ client_order_id?: string | null;
3466
+ /**
3467
+ * @description Timestamp when the order was cancelled (ISO 8601)
3468
+ * @example 2023-11-13T10:35:00Z
3469
+ */
3470
+ cancelled_at?: string | null;
3471
+ /**
3472
+ * @description Timestamp when the order was fully filled (ISO 8601)
3473
+ * @example 2023-11-13T10:35:00Z
3474
+ */
3475
+ filled_at?: string | null;
3476
+ /**
3477
+ * @description Timestamp when the order expired (ISO 8601)
3478
+ * @example 2023-11-13T10:35:00Z
3479
+ */
3480
+ expired_at?: string | null;
3481
+ /**
3482
+ * @description Timestamp when the order was submitted (ISO 8601)
3483
+ * @example 2023-11-13T10:35:00Z
3484
+ */
3485
+ submitted_at?: string | null;
3486
+ /**
3487
+ * @description Timestamp when the order was acknowledged (ISO 8601)
3488
+ * @example 2023-11-13T10:35:00Z
3489
+ */
3490
+ acknowledged_at?: string | null;
3491
+ /**
3492
+ * @description Trigger price for stop/conditional orders
3493
+ * @example 34000.00
3494
+ */
3495
+ trigger_price?: string | null;
3496
+ /**
3497
+ * @description Quote volume of the order
3498
+ * @example 17500.00
3499
+ */
3500
+ quote_volume?: string | null;
3501
+ /**
3502
+ * Format: uuid
3503
+ * @description Application UUID that created the order
3504
+ */
3505
+ application_id?: string | null;
3506
+ /**
3507
+ * Format: uuid
3508
+ * @description Parent order UUID for linked orders
3509
+ */
3510
+ parent_order_id?: string | null;
3511
+ /**
3512
+ * Format: uuid
3513
+ * @description Batch UUID for batch orders
3514
+ */
3515
+ batch_id?: string | null;
3332
3516
  };
3333
3517
  /** @description Orderbook snapshot with token metadata and sequence number. */
3334
3518
  GetOrderbookResponse: {
@@ -3508,7 +3692,7 @@ export interface components {
3508
3692
  liquidation_price?: string | null;
3509
3693
  status?: string | null;
3510
3694
  updated_at?: string | null;
3511
- margin_bucket_id?: string | null;
3695
+ risk_bucket_id?: string | null;
3512
3696
  };
3513
3697
  GetPositionRiskResponse: {
3514
3698
  position_id?: string | null;
@@ -3605,7 +3789,23 @@ export interface components {
3605
3789
  };
3606
3790
  /** @description A single trade. */
3607
3791
  GetTradeByIdResponse: {
3608
- trade?: components["schemas"]["PublicTrade"];
3792
+ data?: components["schemas"]["TradeData"];
3793
+ /**
3794
+ * @description Event type identifier
3795
+ * @example trade
3796
+ */
3797
+ event_type?: string | null;
3798
+ /**
3799
+ * Format: uuid
3800
+ * @description Trading pair UUID
3801
+ * @example 456e7890-e12b-12d3-a456-426614174000
3802
+ */
3803
+ trading_pair_id?: string | null;
3804
+ /**
3805
+ * @description Trading mode: SPOT or MARGIN
3806
+ * @example SPOT
3807
+ */
3808
+ trading_mode?: string | null;
3609
3809
  };
3610
3810
  /** @description Recent trades for a trading pair. */
3611
3811
  GetTradesResponse: {
@@ -3658,6 +3858,11 @@ export interface components {
3658
3858
  amount?: string | null;
3659
3859
  /** @description On-chain address that will receive the withdrawal (EVM, 42 chars including 0x) */
3660
3860
  destination?: string | null;
3861
+ /**
3862
+ * @description Source ledger to withdraw from: "spot" (default) debits spot balance; "margin" directly debits withdrawable collateral from the parent margin account
3863
+ * @example spot
3864
+ */
3865
+ source?: string | null;
3661
3866
  };
3662
3867
  LedgerMovement: {
3663
3868
  /**
@@ -4034,15 +4239,6 @@ export interface components {
4034
4239
  */
4035
4240
  total_pages?: number | null;
4036
4241
  };
4037
- ListUserTradesResponse: {
4038
- trades?: components["schemas"]["UserTrade"][] | null;
4039
- /** Format: uint32 */
4040
- total?: number | null;
4041
- /** Format: uint32 */
4042
- page?: number | null;
4043
- /** Format: uint32 */
4044
- page_size?: number | null;
4045
- };
4046
4242
  MarginAccountMovement: {
4047
4243
  id?: string | null;
4048
4244
  movement_type?: string | null;
@@ -4052,7 +4248,7 @@ export interface components {
4052
4248
  created_at?: string | null;
4053
4249
  };
4054
4250
  MarginAccountSummary: {
4055
- /** @description The margin account currently acts as the isolated bucket for a live position. */
4251
+ /** @description Parent margin account UUID. */
4056
4252
  margin_account_id?: string | null;
4057
4253
  account_state?: string | null;
4058
4254
  equity?: string | null;
@@ -4068,6 +4264,10 @@ export interface components {
4068
4264
  /** Format: uuid */
4069
4265
  trading_pair_id?: string | null;
4070
4266
  strategy_key?: string | null;
4267
+ /** @description Present only for risk-bucket summary rows. */
4268
+ risk_bucket_id?: string | null;
4269
+ /** @description Present only for risk-bucket summary rows. Values: ISOLATED, CROSS. */
4270
+ margin_mode?: string | null;
4071
4271
  };
4072
4272
  MatchResult: {
4073
4273
  /**
@@ -4095,7 +4295,7 @@ export interface components {
4095
4295
  * @description Resulting order status after matching
4096
4296
  * @example PARTIALLY_FILLED
4097
4297
  */
4098
- order_status?: string | null;
4298
+ status?: string | null;
4099
4299
  /**
4100
4300
  * Format: int32
4101
4301
  * @description Actual slippage incurred in basis points
@@ -4219,7 +4419,7 @@ export interface components {
4219
4419
  liquidation_price?: string | null;
4220
4420
  status?: string | null;
4221
4421
  updated_at?: string | null;
4222
- margin_bucket_id?: string | null;
4422
+ risk_bucket_id?: string | null;
4223
4423
  };
4224
4424
  PositionHistoryEvent: {
4225
4425
  id?: string | null;
@@ -4295,44 +4495,25 @@ export interface components {
4295
4495
  */
4296
4496
  timestamp?: number | null;
4297
4497
  };
4498
+ /** @description A public trade event. Serializes to the historical REST/WebSocket envelope: { data: { ... }, event_type, trading_pair_id, trading_mode }. */
4298
4499
  PublicTrade: {
4500
+ data?: components["schemas"]["TradeData"];
4299
4501
  /**
4300
- * Format: uuid
4301
- * @description Trade UUID
4302
- * @example 123e4567-e89b-12d3-a456-426614174000
4502
+ * @description Event type identifier
4503
+ * @example trade
4303
4504
  */
4304
- trade_id?: string | null;
4505
+ event_type?: string | null;
4305
4506
  /**
4306
4507
  * Format: uuid
4307
4508
  * @description Trading pair UUID
4308
4509
  * @example 456e7890-e12b-12d3-a456-426614174000
4309
4510
  */
4310
4511
  trading_pair_id?: string | null;
4311
- /**
4312
- * @description Execution price
4313
- * @example 35000.00
4314
- */
4315
- price?: string | null;
4316
- /**
4317
- * @description Traded quantity in base token
4318
- * @example 0.5
4319
- */
4320
- quantity?: string | null;
4321
- /**
4322
- * @description Taker side: BUY or SELL
4323
- * @example BUY
4324
- */
4325
- side?: string | null;
4326
4512
  /**
4327
4513
  * @description Trading mode: SPOT or MARGIN
4328
4514
  * @example SPOT
4329
4515
  */
4330
4516
  trading_mode?: string | null;
4331
- /**
4332
- * @description Trade execution timestamp (ISO 8601)
4333
- * @example 2023-11-13T10:30:00Z
4334
- */
4335
- executed_at?: string | null;
4336
4517
  };
4337
4518
  ReducePositionMarginRequest: {
4338
4519
  amount?: string | null;
@@ -4482,6 +4663,21 @@ export interface components {
4482
4663
  price_change_percent_7d?: string | null;
4483
4664
  /** @description Up to 7 UTC-day buckets (oldest first); empty when <1 day of history */
4484
4665
  snapshot_7d?: components["schemas"]["ScreenerSnapshotPoint"][] | null;
4666
+ /**
4667
+ * @description Asset-class category: crypto, equities, commodities, or fx
4668
+ * @example crypto
4669
+ */
4670
+ category?: string | null;
4671
+ /**
4672
+ * @description Life-to-date cumulative quote-token volume (since market inception); "0" for a pair with no trades yet
4673
+ * @example 9123456789.50
4674
+ */
4675
+ total_quote_volume_ltd?: string | null;
4676
+ /**
4677
+ * @description Life-to-date cumulative number of trades (since market inception); 0 for a pair with no trades yet
4678
+ * @example 482931
4679
+ */
4680
+ total_trade_count_ltd?: string | null;
4485
4681
  };
4486
4682
  /** @description One UTC-day bucket in a pair's 7-day snapshot. */
4487
4683
  ScreenerSnapshotPoint: {
@@ -4501,18 +4697,6 @@ export interface components {
4501
4697
  */
4502
4698
  price_change_percent?: string | null;
4503
4699
  };
4504
- SimulateAutoMarginOrderRiskRequest: {
4505
- /** Format: uuid */
4506
- trading_pair_id?: string | null;
4507
- strategy_key?: string | null;
4508
- side?: string | null;
4509
- position_side?: string | null;
4510
- order_type?: string | null;
4511
- price?: string | null;
4512
- quantity?: string | null;
4513
- leverage?: string | null;
4514
- reduce_only?: boolean | null;
4515
- };
4516
4700
  SimulateFeesResponse: {
4517
4701
  /**
4518
4702
  * @description Notional value (price x quantity)
@@ -4616,6 +4800,36 @@ export interface components {
4616
4800
  free_collateral_after?: string | null;
4617
4801
  estimated_fee?: string | null;
4618
4802
  estimated_liquidation_price?: string | null;
4803
+ /**
4804
+ * @description The margin account the simulation was resolved against. Always populated;
4805
+ * useful for auto-resolved buckets where the caller didn't supply the id.
4806
+ */
4807
+ margin_account_id?: string | null;
4808
+ /** @description Populated when the simulated account is an auto-resolved bucket. */
4809
+ strategy_key?: string | null;
4810
+ };
4811
+ SimulateParentMarginOrderRiskRequest: {
4812
+ /** Format: uuid */
4813
+ trading_pair_id?: string | null;
4814
+ side?: string | null;
4815
+ position_side?: string | null;
4816
+ order_type?: string | null;
4817
+ price?: string | null;
4818
+ quantity?: string | null;
4819
+ leverage?: string | null;
4820
+ reduce_only?: boolean | null;
4821
+ };
4822
+ SimulateRiskBucketOrderRiskRequest: {
4823
+ /** Format: uuid */
4824
+ trading_pair_id?: string | null;
4825
+ strategy_key?: string | null;
4826
+ side?: string | null;
4827
+ position_side?: string | null;
4828
+ order_type?: string | null;
4829
+ price?: string | null;
4830
+ quantity?: string | null;
4831
+ leverage?: string | null;
4832
+ reduce_only?: boolean | null;
4619
4833
  };
4620
4834
  SubAccount: {
4621
4835
  /**
@@ -4743,6 +4957,40 @@ export interface components {
4743
4957
  slippage_tolerance_bps?: number | null;
4744
4958
  expires_at?: string | null;
4745
4959
  };
4960
+ /** @description Core fields of a single executed trade, nested under `data` in the public trade event envelope. */
4961
+ TradeData: {
4962
+ /**
4963
+ * @description Trade execution timestamp (ISO 8601). Omitted when the trade has no execution time.
4964
+ * @example 2023-11-13T10:30:00Z
4965
+ */
4966
+ executed_at?: string | null;
4967
+ /**
4968
+ * @description Maker order side: BUY or SELL
4969
+ * @example BUY
4970
+ */
4971
+ maker_side?: string | null;
4972
+ /**
4973
+ * @description Execution price
4974
+ * @example 35000.00
4975
+ */
4976
+ price?: string | null;
4977
+ /**
4978
+ * @description Traded quantity in base token (normalized)
4979
+ * @example 0.5
4980
+ */
4981
+ quantity?: string | null;
4982
+ /**
4983
+ * @description Traded quantity in raw base-token units
4984
+ * @example 50000000
4985
+ */
4986
+ quantity_raw?: string | null;
4987
+ /**
4988
+ * Format: uuid
4989
+ * @description Trade UUID
4990
+ * @example 123e4567-e89b-12d3-a456-426614174000
4991
+ */
4992
+ trade_id?: string | null;
4993
+ };
4746
4994
  /** @description Trading pair configuration including tokens, fees, and order limits. */
4747
4995
  TradingPairData: {
4748
4996
  /**
@@ -4851,12 +5099,26 @@ export interface components {
4851
5099
  * @example 20
4852
5100
  */
4853
5101
  max_leverage?: string | null;
5102
+ /**
5103
+ * @description Asset-class category: crypto, equities, commodities, or fx
5104
+ * @example crypto
5105
+ */
5106
+ category?: string | null;
4854
5107
  };
4855
5108
  TransferCollateralFromMarginAccountRequest: {
4856
- /** @description Margin account UUID whose current isolated bucket releases collateral. */
5109
+ /** @description Parent margin account UUID that releases collateral. */
4857
5110
  margin_account_id?: string | null;
4858
5111
  asset?: string | null;
4859
5112
  amount?: string | null;
5113
+ /**
5114
+ * Format: uuid
5115
+ * @description Optional trading pair UUID used to release collateral from an isolated risk
5116
+ * bucket under the parent margin account. If omitted, the transfer applies to
5117
+ * the parent margin account only.
5118
+ */
5119
+ trading_pair_id?: string | null;
5120
+ /** @description Optional strategy key echoed in responses when callers scope a risk bucket. */
5121
+ strategy_key?: string | null;
4860
5122
  };
4861
5123
  TransferCollateralFromMarginAccountResponse: {
4862
5124
  movement_id?: string | null;
@@ -4867,19 +5129,26 @@ export interface components {
4867
5129
  new_equity?: string | null;
4868
5130
  new_total_collateral_value?: string | null;
4869
5131
  new_withdrawable_collateral?: string | null;
5132
+ strategy_key?: string | null;
4870
5133
  };
4871
- TransferCollateralToAutoMarginAccountRequest: {
5134
+ TransferCollateralFromParentMarginAccountRequest: {
4872
5135
  asset?: string | null;
4873
5136
  amount?: string | null;
4874
- /** Format: uuid */
4875
- trading_pair_id?: string | null;
4876
- strategy_key?: string | null;
4877
5137
  };
4878
5138
  TransferCollateralToMarginAccountRequest: {
4879
- /** @description Margin account UUID whose current isolated bucket receives collateral. */
5139
+ /** @description Parent margin account UUID that receives collateral. */
4880
5140
  margin_account_id?: string | null;
4881
5141
  asset?: string | null;
4882
5142
  amount?: string | null;
5143
+ /**
5144
+ * Format: uuid
5145
+ * @description Optional trading pair UUID used to allocate collateral to an isolated risk
5146
+ * bucket under the parent margin account. If omitted, the transfer applies to
5147
+ * the parent margin account only.
5148
+ */
5149
+ trading_pair_id?: string | null;
5150
+ /** @description Optional strategy key echoed in responses when callers scope a risk bucket. */
5151
+ strategy_key?: string | null;
4883
5152
  };
4884
5153
  TransferCollateralToMarginAccountResponse: {
4885
5154
  movement_id?: string | null;
@@ -4890,6 +5159,21 @@ export interface components {
4890
5159
  new_equity?: string | null;
4891
5160
  new_total_collateral_value?: string | null;
4892
5161
  new_withdrawable_collateral?: string | null;
5162
+ strategy_key?: string | null;
5163
+ };
5164
+ TransferCollateralToParentMarginAccountRequest: {
5165
+ asset?: string | null;
5166
+ amount?: string | null;
5167
+ };
5168
+ TransferCollateralToRiskBucketRequest: {
5169
+ asset?: string | null;
5170
+ amount?: string | null;
5171
+ /**
5172
+ * Format: uuid
5173
+ * @description Trading pair UUID whose risk bucket receives collateral.
5174
+ */
5175
+ trading_pair_id?: string | null;
5176
+ strategy_key?: string | null;
4893
5177
  };
4894
5178
  UpdateLimitRequest: {
4895
5179
  /**
@@ -5054,11 +5338,11 @@ export interface components {
5054
5338
  user?: components["schemas"]["UserInfo"];
5055
5339
  };
5056
5340
  Withdrawal: {
5057
- /** @description Allocated withdrawal index — matches executeSignedWithdrawal.index on-chain */
5341
+ /** @description Allocated withdrawal index — matches executeWithdrawal.index on-chain */
5058
5342
  withdrawal_index?: string | null;
5059
5343
  /** @description 0x-prefixed lowercase address of the vault contract the calldata is submitted to */
5060
5344
  vault_address?: string | null;
5061
- /** @description 0x-prefixed ABI-encoded, signed executeSignedWithdrawal(...) calldata; submit as tx.data to the vault */
5345
+ /** @description 0x-prefixed ABI-encoded executeWithdrawal(...) calldata; submit as tx.data to the vault. Empty on InitiateWithdrawal (the merkle proof is not available until the withdrawal root is confirmed on-chain) — fetch it from GetWithdrawal once ready */
5062
5346
  calldata?: string | null;
5063
5347
  };
5064
5348
  };
@@ -6683,30 +6967,6 @@ export interface operations {
6683
6967
  };
6684
6968
  };
6685
6969
  };
6686
- ensure_parent_margin_account: {
6687
- parameters: {
6688
- query?: never;
6689
- header?: never;
6690
- path?: never;
6691
- cookie?: never;
6692
- };
6693
- requestBody: {
6694
- content: {
6695
- "application/json": components["schemas"]["EnsureParentMarginAccountRequest"];
6696
- };
6697
- };
6698
- responses: {
6699
- /** @description OK */
6700
- 200: {
6701
- headers: {
6702
- [name: string]: unknown;
6703
- };
6704
- content: {
6705
- "application/json": components["schemas"]["EnsureParentMarginAccountResponse"];
6706
- };
6707
- };
6708
- };
6709
- };
6710
6970
  get_margin_account_summary: {
6711
6971
  parameters: {
6712
6972
  query?: {
@@ -6738,7 +6998,7 @@ export interface operations {
6738
6998
  query?: never;
6739
6999
  header?: never;
6740
7000
  path: {
6741
- /** @description Margin account UUID whose current isolated bucket receives collateral. */
7001
+ /** @description Parent margin account UUID that receives collateral. */
6742
7002
  margin_account_id: string;
6743
7003
  };
6744
7004
  cookie?: never;
@@ -6765,7 +7025,7 @@ export interface operations {
6765
7025
  query?: never;
6766
7026
  header?: never;
6767
7027
  path: {
6768
- /** @description Margin account UUID whose current isolated bucket releases collateral. */
7028
+ /** @description Parent margin account UUID that releases collateral. */
6769
7029
  margin_account_id: string;
6770
7030
  };
6771
7031
  cookie?: never;
@@ -6865,7 +7125,128 @@ export interface operations {
6865
7125
  };
6866
7126
  };
6867
7127
  };
6868
- transfer_collateral_to_auto_margin_account: {
7128
+ get_parent_margin_account_summary: {
7129
+ parameters: {
7130
+ query?: {
7131
+ /** @description Trading pair identifier (UUID) */
7132
+ trading_pair_id?: string;
7133
+ };
7134
+ header?: never;
7135
+ path?: never;
7136
+ cookie?: never;
7137
+ };
7138
+ requestBody?: never;
7139
+ responses: {
7140
+ /** @description OK */
7141
+ 200: {
7142
+ headers: {
7143
+ [name: string]: unknown;
7144
+ };
7145
+ content: {
7146
+ "application/json": components["schemas"]["GetMarginAccountSummaryResponse"];
7147
+ };
7148
+ };
7149
+ };
7150
+ };
7151
+ transfer_collateral_to_parent_margin_account: {
7152
+ parameters: {
7153
+ query?: never;
7154
+ header?: never;
7155
+ path?: never;
7156
+ cookie?: never;
7157
+ };
7158
+ requestBody: {
7159
+ content: {
7160
+ "application/json": components["schemas"]["TransferCollateralToParentMarginAccountRequest"];
7161
+ };
7162
+ };
7163
+ responses: {
7164
+ /** @description OK */
7165
+ 200: {
7166
+ headers: {
7167
+ [name: string]: unknown;
7168
+ };
7169
+ content: {
7170
+ "application/json": components["schemas"]["TransferCollateralToMarginAccountResponse"];
7171
+ };
7172
+ };
7173
+ };
7174
+ };
7175
+ transfer_collateral_from_parent_margin_account: {
7176
+ parameters: {
7177
+ query?: never;
7178
+ header?: never;
7179
+ path?: never;
7180
+ cookie?: never;
7181
+ };
7182
+ requestBody: {
7183
+ content: {
7184
+ "application/json": components["schemas"]["TransferCollateralFromParentMarginAccountRequest"];
7185
+ };
7186
+ };
7187
+ responses: {
7188
+ /** @description OK */
7189
+ 200: {
7190
+ headers: {
7191
+ [name: string]: unknown;
7192
+ };
7193
+ content: {
7194
+ "application/json": components["schemas"]["TransferCollateralFromMarginAccountResponse"];
7195
+ };
7196
+ };
7197
+ };
7198
+ };
7199
+ get_parent_margin_account_movements: {
7200
+ parameters: {
7201
+ query?: {
7202
+ movement_type?: string;
7203
+ /** @description Page number (1-indexed) */
7204
+ page?: number;
7205
+ /** @description Items per page (max 100) */
7206
+ page_size?: number;
7207
+ };
7208
+ header?: never;
7209
+ path?: never;
7210
+ cookie?: never;
7211
+ };
7212
+ requestBody?: never;
7213
+ responses: {
7214
+ /** @description OK */
7215
+ 200: {
7216
+ headers: {
7217
+ [name: string]: unknown;
7218
+ };
7219
+ content: {
7220
+ "application/json": components["schemas"]["GetMarginAccountMovementsResponse"];
7221
+ };
7222
+ };
7223
+ };
7224
+ };
7225
+ simulate_parent_margin_order_risk: {
7226
+ parameters: {
7227
+ query?: never;
7228
+ header?: never;
7229
+ path?: never;
7230
+ cookie?: never;
7231
+ };
7232
+ requestBody: {
7233
+ content: {
7234
+ "application/json": components["schemas"]["SimulateParentMarginOrderRiskRequest"];
7235
+ };
7236
+ };
7237
+ responses: {
7238
+ /** @description OK */
7239
+ 200: {
7240
+ headers: {
7241
+ [name: string]: unknown;
7242
+ };
7243
+ content: {
7244
+ "application/json": components["schemas"]["SimulateOrderRiskResponse"];
7245
+ };
7246
+ };
7247
+ };
7248
+ };
7249
+ transfer_collateral_to_risk_bucket: {
6869
7250
  parameters: {
6870
7251
  query?: never;
6871
7252
  header?: never;
@@ -6874,7 +7255,7 @@ export interface operations {
6874
7255
  };
6875
7256
  requestBody: {
6876
7257
  content: {
6877
- "application/json": components["schemas"]["TransferCollateralToAutoMarginAccountRequest"];
7258
+ "application/json": components["schemas"]["TransferCollateralToRiskBucketRequest"];
6878
7259
  };
6879
7260
  };
6880
7261
  responses: {
@@ -6889,7 +7270,7 @@ export interface operations {
6889
7270
  };
6890
7271
  };
6891
7272
  };
6892
- simulate_auto_margin_order_risk: {
7273
+ simulate_risk_bucket_order_risk: {
6893
7274
  parameters: {
6894
7275
  query?: never;
6895
7276
  header?: never;
@@ -6898,7 +7279,7 @@ export interface operations {
6898
7279
  };
6899
7280
  requestBody: {
6900
7281
  content: {
6901
- "application/json": components["schemas"]["SimulateAutoMarginOrderRiskRequest"];
7282
+ "application/json": components["schemas"]["SimulateRiskBucketOrderRiskRequest"];
6902
7283
  };
6903
7284
  };
6904
7285
  responses: {
@@ -6925,6 +7306,7 @@ export interface operations {
6925
7306
  base_token?: string;
6926
7307
  quote_token?: string;
6927
7308
  is_active?: boolean;
7309
+ category?: string;
6928
7310
  };
6929
7311
  header?: never;
6930
7312
  path?: never;
@@ -7267,6 +7649,7 @@ export interface operations {
7267
7649
  /** @description Filter by market type */
7268
7650
  market_type?: "SPOT" | "MARGIN";
7269
7651
  is_active?: boolean;
7652
+ category?: string;
7270
7653
  };
7271
7654
  header?: never;
7272
7655
  path?: never;
@@ -7299,6 +7682,33 @@ export interface operations {
7299
7682
  };
7300
7683
  };
7301
7684
  };
7685
+ get_market_stats: {
7686
+ parameters: {
7687
+ query?: never;
7688
+ header?: never;
7689
+ path?: never;
7690
+ cookie?: never;
7691
+ };
7692
+ requestBody?: never;
7693
+ responses: {
7694
+ /** @description OK */
7695
+ 200: {
7696
+ headers: {
7697
+ [name: string]: unknown;
7698
+ };
7699
+ content: {
7700
+ "application/json": components["schemas"]["GetMarketStatsResponse"];
7701
+ };
7702
+ };
7703
+ /** @description Internal server error */
7704
+ 500: {
7705
+ headers: {
7706
+ [name: string]: unknown;
7707
+ };
7708
+ content?: never;
7709
+ };
7710
+ };
7711
+ };
7302
7712
  get_orderbook_snapshot: {
7303
7713
  parameters: {
7304
7714
  query?: {
@@ -7365,6 +7775,8 @@ export interface operations {
7365
7775
  /** @description Trading mode */
7366
7776
  trading_mode?: "SPOT" | "MARGIN";
7367
7777
  margin_account_id?: string;
7778
+ /** @description Sort direction for created_at */
7779
+ order_by?: "ASC" | "DESC";
7368
7780
  };
7369
7781
  header?: never;
7370
7782
  path?: never;
@@ -7756,30 +8168,6 @@ export interface operations {
7756
8168
  };
7757
8169
  };
7758
8170
  };
7759
- create_conditional_order: {
7760
- parameters: {
7761
- query?: never;
7762
- header?: never;
7763
- path?: never;
7764
- cookie?: never;
7765
- };
7766
- requestBody: {
7767
- content: {
7768
- "application/json": components["schemas"]["CreateConditionalOrderRequest"];
7769
- };
7770
- };
7771
- responses: {
7772
- /** @description OK */
7773
- 200: {
7774
- headers: {
7775
- [name: string]: unknown;
7776
- };
7777
- content: {
7778
- "application/json": components["schemas"]["CreateConditionalOrderResponse"];
7779
- };
7780
- };
7781
- };
7782
- };
7783
8171
  cancel_conditional_order: {
7784
8172
  parameters: {
7785
8173
  query?: never;
@@ -7944,6 +8332,30 @@ export interface operations {
7944
8332
  };
7945
8333
  };
7946
8334
  };
8335
+ batch_close_all_positions: {
8336
+ parameters: {
8337
+ query?: never;
8338
+ header?: never;
8339
+ path?: never;
8340
+ cookie?: never;
8341
+ };
8342
+ requestBody: {
8343
+ content: {
8344
+ "application/json": components["schemas"]["BatchCloseAllRequest"];
8345
+ };
8346
+ };
8347
+ responses: {
8348
+ /** @description OK */
8349
+ 200: {
8350
+ headers: {
8351
+ [name: string]: unknown;
8352
+ };
8353
+ content: {
8354
+ "application/json": components["schemas"]["BatchCloseAllResponse"];
8355
+ };
8356
+ };
8357
+ };
8358
+ };
7947
8359
  list_position_history: {
7948
8360
  parameters: {
7949
8361
  query?: {
@@ -8166,34 +8578,6 @@ export interface operations {
8166
8578
  };
8167
8579
  };
8168
8580
  };
8169
- list_user_trades: {
8170
- parameters: {
8171
- query?: {
8172
- margin_account_id?: string;
8173
- /** @description Trading pair identifier (UUID) */
8174
- trading_pair_id?: string;
8175
- /** @description Page number (1-indexed) */
8176
- page?: number;
8177
- /** @description Items per page (max 100) */
8178
- page_size?: number;
8179
- };
8180
- header?: never;
8181
- path?: never;
8182
- cookie?: never;
8183
- };
8184
- requestBody?: never;
8185
- responses: {
8186
- /** @description OK */
8187
- 200: {
8188
- headers: {
8189
- [name: string]: unknown;
8190
- };
8191
- content: {
8192
- "application/json": components["schemas"]["ListUserTradesResponse"];
8193
- };
8194
- };
8195
- };
8196
- };
8197
8581
  get_trades: {
8198
8582
  parameters: {
8199
8583
  query?: {
@@ -8373,13 +8757,20 @@ export interface operations {
8373
8757
  "application/json": components["schemas"]["Withdrawal"];
8374
8758
  };
8375
8759
  };
8376
- /** @description Withdrawal not found */
8760
+ /** @description Withdrawal not found (may not be persisted yet) */
8377
8761
  404: {
8378
8762
  headers: {
8379
8763
  [name: string]: unknown;
8380
8764
  };
8381
8765
  content?: never;
8382
8766
  };
8767
+ /** @description Withdrawal not confirmed on-chain yet; retry shortly */
8768
+ 409: {
8769
+ headers: {
8770
+ [name: string]: unknown;
8771
+ };
8772
+ content?: never;
8773
+ };
8383
8774
  /** @description Internal server error */
8384
8775
  500: {
8385
8776
  headers: {