@0xmonaco/types 1.0.42 → 1.0.44

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.
@@ -1573,6 +1573,85 @@ export interface paths {
1573
1573
  patch?: never;
1574
1574
  trace?: never;
1575
1575
  };
1576
+ "/api/v1/orders/twap": {
1577
+ parameters: {
1578
+ query?: never;
1579
+ header?: never;
1580
+ path?: never;
1581
+ cookie?: never;
1582
+ };
1583
+ /**
1584
+ * List TWAP orders
1585
+ * @description List TWAP orders.
1586
+ *
1587
+ * List TWAP parent orders for the authenticated user with pagination and
1588
+ * optional filtering by state and trading pair.
1589
+ */
1590
+ get: operations["list_twap_orders"];
1591
+ put?: never;
1592
+ /**
1593
+ * Create TWAP order
1594
+ * @description Create TWAP order.
1595
+ *
1596
+ * Create a server-side TWAP (time-weighted average price) parent order. The
1597
+ * matching engine executes it as a schedule of MARKET child orders with
1598
+ * seeded size/timing randomization across the requested window, then stops
1599
+ * hard at the end time — any unfilled remainder is reported as shortfall,
1600
+ * never traded past the window. Delegated-agent sessions are rejected.
1601
+ */
1602
+ post: operations["create_twap_order"];
1603
+ delete?: never;
1604
+ options?: never;
1605
+ head?: never;
1606
+ patch?: never;
1607
+ trace?: never;
1608
+ };
1609
+ "/api/v1/orders/twap/{twapOrderId}": {
1610
+ parameters: {
1611
+ query?: never;
1612
+ header?: never;
1613
+ path?: never;
1614
+ cookie?: never;
1615
+ };
1616
+ /**
1617
+ * Get TWAP order by ID
1618
+ * @description Get TWAP order by ID.
1619
+ *
1620
+ * Get a single TWAP parent order by its ID. Users can only access their own
1621
+ * TWAP orders.
1622
+ */
1623
+ get: operations["get_twap_order"];
1624
+ put?: never;
1625
+ post?: never;
1626
+ delete?: never;
1627
+ options?: never;
1628
+ head?: never;
1629
+ patch?: never;
1630
+ trace?: never;
1631
+ };
1632
+ "/api/v1/orders/twap/{twapOrderId}/cancel": {
1633
+ parameters: {
1634
+ query?: never;
1635
+ header?: never;
1636
+ path?: never;
1637
+ cookie?: never;
1638
+ };
1639
+ get?: never;
1640
+ put?: never;
1641
+ /**
1642
+ * Cancel TWAP order
1643
+ * @description Cancel TWAP order.
1644
+ *
1645
+ * Cancel a TWAP parent order. Child orders are IOC and never rest, so the
1646
+ * cancel is atomic and immediate; already-executed quantity stands.
1647
+ */
1648
+ post: operations["cancel_twap_order"];
1649
+ delete?: never;
1650
+ options?: never;
1651
+ head?: never;
1652
+ patch?: never;
1653
+ trace?: never;
1654
+ };
1576
1655
  "/api/v1/orders/{orderId}": {
1577
1656
  parameters: {
1578
1657
  query?: never;
@@ -2191,6 +2270,11 @@ export interface components {
2191
2270
  * @example 1050750000
2192
2271
  */
2193
2272
  totalBalanceRaw?: string | null;
2273
+ /**
2274
+ * @description True when this asset is the chain's wrapped-native token (e.g. WSEI): vault deposits can be made in native coin via depositNative (the vault wraps on entry) and withdrawals pay out native
2275
+ * @example true
2276
+ */
2277
+ wrappedNative?: boolean | null;
2194
2278
  };
2195
2279
  AppUser: {
2196
2280
  /**
@@ -2739,7 +2823,7 @@ export interface components {
2739
2823
  */
2740
2824
  price?: string | null;
2741
2825
  /**
2742
- * @description New quantity (if changing)
2826
+ * @description New TOTAL quantity (if changing). On a partially filled order the replacement rests total minus filled, and collateral is locked for that remainder only (FIX cancel/replace convention: LeavesQty = OrderQty - CumQty). Must exceed the filled amount. Omitted, the replacement keeps the unfilled remainder.
2743
2827
  * @example 0.7
2744
2828
  */
2745
2829
  quantity?: string | null;
@@ -2821,6 +2905,11 @@ export interface components {
2821
2905
  * @example 123e4567-e89b-12d3-a456-426614174000
2822
2906
  */
2823
2907
  orderId: string;
2908
+ /**
2909
+ * @description Partial cancel: reduce the resting order in place to this remaining quantity, keeping its queue position. A target ("leave this much resting"), not an amount to remove, so a retried request converges. Must be a positive multiple of the market's quantity step, strictly below the order's current remaining quantity; the delta is released exactly as a cancel releases it (spot unlock / margin reserve). Omit for a full cancel.
2910
+ * @example 0.5
2911
+ */
2912
+ remainingQuantityTarget?: string | null;
2824
2913
  };
2825
2914
  CancelOrderResponse: {
2826
2915
  /**
@@ -2840,6 +2929,24 @@ export interface components {
2840
2929
  */
2841
2930
  message?: string | null;
2842
2931
  };
2932
+ CancelTwapOrderResponse: {
2933
+ /**
2934
+ * Format: uuid
2935
+ * @description Cancelled TWAP parent order UUID
2936
+ * @example 123e4567-e89b-12d3-a456-426614174000
2937
+ */
2938
+ twapOrderId?: string | null;
2939
+ /**
2940
+ * @description Result status: SUCCESS or FAILED
2941
+ * @example SUCCESS
2942
+ */
2943
+ status?: string | null;
2944
+ /**
2945
+ * @description Human-readable status message
2946
+ * @example TWAP order cancelled successfully
2947
+ */
2948
+ message?: string | null;
2949
+ };
2843
2950
  Candle: {
2844
2951
  /**
2845
2952
  * @description Unix timestamp for the start of the candle period in milliseconds
@@ -3209,6 +3316,153 @@ export interface components {
3209
3316
  */
3210
3317
  delegationId?: string | null;
3211
3318
  };
3319
+ CreateTwapOrderRequest: {
3320
+ /**
3321
+ * Format: uuid
3322
+ * @description Trading pair UUID
3323
+ * @example afae0e16-2d05-4ee9-9ee8-afae0e162d05
3324
+ */
3325
+ tradingPairId: string;
3326
+ /**
3327
+ * @description Order side: BUY or SELL
3328
+ * @example BUY
3329
+ */
3330
+ side: string;
3331
+ /**
3332
+ * @description Total quantity to execute across the window as decimal string. Must be at least 2x the pair's minimum order size so it can be sliced, and small enough that the window's slice budget can carry it with every child at or below the pair's maximum order size.
3333
+ * @example 10
3334
+ */
3335
+ quantity: string;
3336
+ /**
3337
+ * Format: int64
3338
+ * @description Execution window length in seconds from launch. Exactly one of durationSeconds or endTime must be set. Bounds (env-tunable defaults): 60 to 2592000 (1 minute to 30 days).
3339
+ * @example 3600
3340
+ */
3341
+ durationSeconds?: number | null;
3342
+ /**
3343
+ * @description Window start (RFC 3339, UTC only — use a Z suffix; non-UTC offsets are rejected). Only valid together with endTime; defaults to now.
3344
+ * @example 2026-08-01T10:00:00Z
3345
+ */
3346
+ startTime?: string | null;
3347
+ /**
3348
+ * @description Window end (RFC 3339, UTC only — use a Z suffix; non-UTC offsets are rejected). Exactly one of durationSeconds or endTime must be set. The effective window must satisfy the same duration bounds. Execution stops hard at this time; any unfilled remainder is reported as shortfall.
3349
+ * @example 2026-08-01T11:00:00Z
3350
+ */
3351
+ endTime?: string | null;
3352
+ /**
3353
+ * @description Optional parent-level limit price as decimal string. BUY child orders never execute above it, SELL children never below it. Omitted: slippage band protection only.
3354
+ * @example 35000.00
3355
+ */
3356
+ limitPrice?: string | null;
3357
+ /**
3358
+ * Format: int32
3359
+ * @description Per-slice protective price band in basis points around the reference price (default 100 = 1%, maximum 500 = 5% — deliberately tighter than the standalone market-order cap; TWAP slices never sweep deep)
3360
+ * @example 100
3361
+ */
3362
+ slippageToleranceBps?: number | null;
3363
+ /**
3364
+ * @description Apply seeded randomization to slice sizes and timing (default true). The seed is recorded for audit, so the schedule is reproducible to compliance but unpredictable to the market.
3365
+ * @example true
3366
+ */
3367
+ randomize?: boolean | null;
3368
+ /**
3369
+ * @description Whether the TWAP parent is reduce-only (margin only). Child orders inherit it and clamp to the live position.
3370
+ * @example false
3371
+ */
3372
+ reduceOnly?: boolean | null;
3373
+ /**
3374
+ * @description Trading mode: SPOT or MARGIN (default: SPOT)
3375
+ * @example SPOT
3376
+ */
3377
+ tradingMode?: string | null;
3378
+ /**
3379
+ * Format: uuid
3380
+ * @description Margin account UUID for margin TWAP orders. Resolved once at creation and reused by every child order.
3381
+ * @example 123e4567-e89b-12d3-a456-426614174000
3382
+ */
3383
+ marginAccountId?: string | null;
3384
+ /**
3385
+ * Format: uuid
3386
+ * @description Existing isolated risk bucket UUID for risk-bucket-scoped margin TWAP orders. Snapshot at creation.
3387
+ * @example 123e4567-e89b-12d3-a456-426614174001
3388
+ */
3389
+ riskBucketId?: string | null;
3390
+ /**
3391
+ * @description Risk bucket mode for margin TWAP orders. Defaults to ISOLATED. Values: ISOLATED, CROSS.
3392
+ * @example CROSS
3393
+ * @enum {string|null}
3394
+ */
3395
+ marginMode?: "ISOLATED" | "CROSS" | null;
3396
+ /**
3397
+ * @description Leverage multiplier as a decimal string. Required for normal margin TWAP orders; optional and ignored for reduce-only.
3398
+ * @example 5
3399
+ */
3400
+ leverage?: string | null;
3401
+ /**
3402
+ * @description Strategy key used to group risk buckets for margin orders
3403
+ * @example my-strategy
3404
+ */
3405
+ strategyKey?: string | null;
3406
+ /**
3407
+ * @description Use master account balance for sub-account orders
3408
+ * @example false
3409
+ */
3410
+ useMasterBalance?: boolean | null;
3411
+ /**
3412
+ * @description Client-assigned idempotency key (max 36 chars), unique per user and application. A duplicate is rejected with 409.
3413
+ * @example oms-3f6a1c
3414
+ */
3415
+ clientTwapId?: string | null;
3416
+ };
3417
+ CreateTwapOrderResponse: {
3418
+ /**
3419
+ * Format: uuid
3420
+ * @description Created TWAP parent order UUID
3421
+ * @example 123e4567-e89b-12d3-a456-426614174000
3422
+ */
3423
+ twapOrderId?: string | null;
3424
+ /**
3425
+ * @description Result status: SUCCESS or FAILED. SUCCESS means the parent is durably recorded; execution itself is best-effort within the window.
3426
+ * @example SUCCESS
3427
+ */
3428
+ status?: string | null;
3429
+ /**
3430
+ * @description Human-readable status message
3431
+ * @example TWAP order created successfully
3432
+ */
3433
+ message?: string | null;
3434
+ /**
3435
+ * @description Initial parent state: always PENDING at create; the parent activates on its first attempted slice
3436
+ * @example PENDING
3437
+ */
3438
+ state?: string | null;
3439
+ /**
3440
+ * Format: uuid
3441
+ * @description Resolved margin account UUID for margin TWAP orders
3442
+ */
3443
+ marginAccountId?: string | null;
3444
+ /**
3445
+ * Format: uuid
3446
+ * @description Resolved isolated risk bucket UUID for risk-bucket-scoped margin TWAP orders
3447
+ */
3448
+ riskBucketId?: string | null;
3449
+ /**
3450
+ * Format: int32
3451
+ * @description Number of slices in the planned schedule
3452
+ * @example 120
3453
+ */
3454
+ plannedSlices?: number | null;
3455
+ /**
3456
+ * @description Planned time of the first slice (ISO 8601)
3457
+ * @example 2026-08-01T10:00:27Z
3458
+ */
3459
+ firstSliceAt?: string | null;
3460
+ /**
3461
+ * @description Resolved window end (ISO 8601). Execution never continues past it.
3462
+ * @example 2026-08-01T11:00:00Z
3463
+ */
3464
+ endTime?: string | null;
3465
+ };
3212
3466
  DelegatedAgent: {
3213
3467
  /**
3214
3468
  * Format: uuid
@@ -3506,11 +3760,14 @@ export interface components {
3506
3760
  * value, so the two surfaces cannot disagree. Absent when the user has no
3507
3761
  * margin account yet.
3508
3762
  *
3509
- * This is NOT trading headroom. It is bounded by allocation (principal not
3510
- * earmarked by risk buckets) as well as by margin requirements, and an
3511
- * unrealized gain does not raise it: a mark-to-market gain is initial margin
3512
- * for new positions but may not fund an exit. Size new positions from
3513
- * `MarginAccountSummary.free_collateral`, which credits that gain in full.
3763
+ * This is NOT trading headroom for existing cross exposure. It is bounded
3764
+ * by allocation (principal not earmarked by risk buckets) as well as by
3765
+ * margin requirements, and an unrealized gain does not raise it: a
3766
+ * mark-to-market gain is initial margin against existing cross exposure but
3767
+ * may not fund an exit. `MarginAccountSummary.free_collateral` credits that
3768
+ * gain in full and remains the trading-margin headroom for existing cross
3769
+ * exposure — but a NEW isolated or first-use position allocates principal
3770
+ * through the same gate this field measures, so size those from this field.
3514
3771
  *
3515
3772
  * Note the two `margin_*` fields answer opposite questions:
3516
3773
  * `margin_transferable` is wallet-to-margin capacity, this is the amount that
@@ -3571,6 +3828,11 @@ export interface components {
3571
3828
  * @example 1050750000
3572
3829
  */
3573
3830
  totalBalanceRaw?: string | null;
3831
+ /**
3832
+ * @description True when this asset is the chain's wrapped-native token (e.g. WSEI): vault deposits can be made in native coin via depositNative (the vault wraps on entry) and withdrawals pay out native
3833
+ * @example true
3834
+ */
3835
+ wrappedNative?: boolean | null;
3574
3836
  };
3575
3837
  GetBalancesResponse: {
3576
3838
  balances?: components["schemas"]["AccountBalance"][] | null;
@@ -4528,6 +4790,15 @@ export interface components {
4528
4790
  * as unavailable, never as zero.
4529
4791
  */
4530
4792
  liquidationPrice?: string | null;
4793
+ /**
4794
+ * @description Account distress ratio: maintenance margin required divided by equity
4795
+ * (higher is closer to liquidation). Equity that is zero or negative has no
4796
+ * meaningful quotient, so an account that still owes a maintenance requirement
4797
+ * reports the maximum-decimal sentinel (79228162514264337593543950335,
4798
+ * maximal distress) rather than zero or a negative value, and an account with
4799
+ * no open maintenance requirement reports zero. Clamp the sentinel before
4800
+ * display.
4801
+ */
4531
4802
  marginRatio?: string | null;
4532
4803
  /**
4533
4804
  * @description Maintenance margin required by this position at mark_price using the
@@ -5210,6 +5481,27 @@ export interface components {
5210
5481
  */
5211
5482
  totalPages?: number | null;
5212
5483
  };
5484
+ ListTwapOrdersResponse: {
5485
+ orders?: components["schemas"]["TwapOrder"][] | null;
5486
+ /**
5487
+ * Format: uint32
5488
+ * @description Total number of TWAP orders matching the filter
5489
+ * @example 3
5490
+ */
5491
+ total?: number | null;
5492
+ /**
5493
+ * Format: uint32
5494
+ * @description Current page number
5495
+ * @example 1
5496
+ */
5497
+ page?: number | null;
5498
+ /**
5499
+ * Format: uint32
5500
+ * @description Items per page
5501
+ * @example 20
5502
+ */
5503
+ pageSize?: number | null;
5504
+ };
5213
5505
  MarginAccountMovement: {
5214
5506
  id?: string | null;
5215
5507
  movementType?: string | null;
@@ -5502,6 +5794,14 @@ export interface components {
5502
5794
  priceAsOf?: string | null;
5503
5795
  /** @enum {string|null} */
5504
5796
  pricingStatus?: "priced" | "unpriced" | null;
5797
+ /** @description Weighted-average cost per unit of the holding, quote-denominated, from the spot cost-basis engine. Deposits are marked at the last-traded price at deposit time. Present only when a cost-basis checkpoint exists for the asset. */
5798
+ avgCost?: string | null;
5799
+ /** @description Unrealized PnL for the holding: costBasisQuantity x (markPrice - avgCost), quote-denominated. Uses the cost-basis engine's folded quantity so it agrees with the portfolio summary headline. Present only when both a cost-basis checkpoint and a mark price exist. */
5800
+ unrealizedPnl?: string | null;
5801
+ /** @description Unrealized return on the holding's cost basis, as a percentage: unrealizedPnl / (costBasisQuantity x avgCost) x 100. Present only when unrealizedPnl is present and the cost basis is non-zero. */
5802
+ unrealizedRoe?: string | null;
5803
+ /** @description Cumulative realized PnL booked against this holding over its lifetime, gross of fees, quote-denominated. Present only when a cost-basis checkpoint exists for the asset. */
5804
+ cumRealized?: string | null;
5505
5805
  };
5506
5806
  PortfolioAssetsPerformance: {
5507
5807
  pnl?: string | null;
@@ -5547,6 +5847,32 @@ export interface components {
5547
5847
  initialMarginRequired?: string | null;
5548
5848
  maintenanceMarginRequired?: string | null;
5549
5849
  unrealizedPnl?: string | null;
5850
+ /**
5851
+ * @description The largest amount that can actually leave the parent margin account —
5852
+ * the bound the engine enforces on transfers-out and withdrawals, and
5853
+ * therefore also the effective ceiling on funding new isolated or
5854
+ * first-use order capacity, because allocating collateral to a risk
5855
+ * bucket passes through the same principal-gated door.
5856
+ *
5857
+ * NOT a clamped `parent_available_collateral`. That field is
5858
+ * `free_collateral`, an equity figure: it credits settled realized PnL,
5859
+ * accrued funding, and mark-to-market gains that a transfer-out cannot
5860
+ * move, so the two can differ without limit. This bound never credits an
5861
+ * unrealized gain. Under the default capacity basis it also excludes
5862
+ * non-principal balances such as banked realized PnL:
5863
+ * `min(deposited principal - bucket allocations,
5864
+ * free_collateral - max(unrealized_pnl, 0))`, floored at zero. Whatever
5865
+ * the engine's configured capacity basis, this is the bound its gates
5866
+ * actually enforce. It agrees with
5867
+ * `MarginAccountSummary.withdrawable_collateral` up to quote-decimal
5868
+ * truncation: this surface truncates toward zero at the quote asset's
5869
+ * precision, while the margin-accounts surface may carry sub-tick tails.
5870
+ *
5871
+ * Size transfers-out, withdrawals, and new isolated/first-use positions
5872
+ * from this field; `parent_available_collateral` remains the trading-margin
5873
+ * headroom for existing cross exposure.
5874
+ */
5875
+ withdrawableCollateral?: string | null;
5550
5876
  };
5551
5877
  PortfolioPerformanceDrawdown: {
5552
5878
  /** @description Positive transfer-neutral loss magnitude */
@@ -5586,6 +5912,24 @@ export interface components {
5586
5912
  maintenanceMarginRequired?: string | null;
5587
5913
  unrealizedPnl?: string | null;
5588
5914
  positionCount?: string | null;
5915
+ /**
5916
+ * @description The largest transfer-out of this risk bucket the engine will actually
5917
+ * accept — the bound enforced on bucket collateral withdrawals.
5918
+ *
5919
+ * NOT a clamped `free_collateral`: free collateral is equity headroom and
5920
+ * credits realized PnL and mark-to-market gains that a transfer-out cannot
5921
+ * move. This bound is capped by the bucket's settled capacity (its
5922
+ * allocated collateral, under the default capacity basis), and an
5923
+ * unrealized gain never raises it.
5924
+ *
5925
+ * This is the largest accepted transfer-out, NOT a promise that every
5926
+ * smaller one is accepted: an underwater flat bucket accepts its full
5927
+ * close-out while refusing partial withdrawals below it. Agrees with the
5928
+ * risk-bucket rows' `MarginAccountSummary.withdrawable_collateral` up to
5929
+ * quote-decimal truncation (this surface truncates toward zero; that one
5930
+ * may carry sub-tick tails).
5931
+ */
5932
+ withdrawableCollateral?: string | null;
5589
5933
  };
5590
5934
  PortfolioSeriesWindow: {
5591
5935
  /**
@@ -5987,7 +6331,7 @@ export interface components {
5987
6331
  */
5988
6332
  price?: string | null;
5989
6333
  /**
5990
- * @description New quantity (if changing)
6334
+ * @description New TOTAL quantity (if changing). On a partially filled order the replacement rests total minus filled, and collateral is locked for that remainder only (FIX cancel/replace convention: LeavesQty = OrderQty - CumQty). Must exceed the filled amount. Omitted, the replacement keeps the unfilled remainder.
5991
6335
  * @example 0.7
5992
6336
  */
5993
6337
  quantity?: string | null;
@@ -6503,6 +6847,15 @@ export interface components {
6503
6847
  * @description Resolve the full live position size when triggered. Mutually exclusive
6504
6848
  * with quantity. For compatibility, omitting both quantity and this field
6505
6849
  * also means full-position close.
6850
+ *
6851
+ * Attaching a full-close leg to a position SUPERSEDES that position's
6852
+ * previously active full-close legs of the same condition type: they are
6853
+ * cancelled in the same engine step that creates the replacement, so moving
6854
+ * a take-profit or stop-loss is one call with no window in which the
6855
+ * position holds both levels or neither. Fixed-quantity legs never
6856
+ * participate — laddered partial exits stack — and a superseded leg's
6857
+ * OCO sibling is left active rather than dropped. Legs attached to an entry
6858
+ * order are excluded on both sides.
6506
6859
  */
6507
6860
  closePosition?: boolean | null;
6508
6861
  };
@@ -6825,6 +7178,155 @@ export interface components {
6825
7178
  */
6826
7179
  tradingBalance?: string | null;
6827
7180
  };
7181
+ TwapOrder: {
7182
+ /**
7183
+ * Format: uuid
7184
+ * @description TWAP parent order UUID
7185
+ */
7186
+ twapOrderId?: string | null;
7187
+ /**
7188
+ * Format: uuid
7189
+ * @description Trading pair UUID
7190
+ */
7191
+ tradingPairId?: string | null;
7192
+ /**
7193
+ * @description Order side: BUY or SELL
7194
+ * @example BUY
7195
+ */
7196
+ side?: string | null;
7197
+ /**
7198
+ * @description Trading mode: SPOT or MARGIN
7199
+ * @example SPOT
7200
+ */
7201
+ tradingMode?: string | null;
7202
+ /**
7203
+ * @description Total quantity requested
7204
+ * @example 10
7205
+ */
7206
+ totalQuantity?: string | null;
7207
+ /**
7208
+ * @description Quantity executed so far across all child orders
7209
+ * @example 4.5
7210
+ */
7211
+ executedQuantity?: string | null;
7212
+ /**
7213
+ * @description Notional (quote) value executed so far
7214
+ * @example 157500.00
7215
+ */
7216
+ executedNotional?: string | null;
7217
+ /**
7218
+ * @description Volume-weighted average fill price (executedNotional / executedQuantity); absent until the first fill
7219
+ * @example 35000.00
7220
+ */
7221
+ averageFillPrice?: string | null;
7222
+ /**
7223
+ * @description Execution progress as a decimal fraction (executedQuantity / totalQuantity, 0 to 1)
7224
+ * @example 0.45
7225
+ */
7226
+ progress?: string | null;
7227
+ /**
7228
+ * @description Parent-level limit price; absent when only the slippage band protects child orders
7229
+ * @example 35000.00
7230
+ */
7231
+ limitPrice?: string | null;
7232
+ /**
7233
+ * Format: int32
7234
+ * @description Per-slice protective price band in basis points
7235
+ * @example 100
7236
+ */
7237
+ slippageToleranceBps?: number | null;
7238
+ /**
7239
+ * @description Whether the parent is reduce-only
7240
+ * @example false
7241
+ */
7242
+ reduceOnly?: boolean | null;
7243
+ /**
7244
+ * Format: uuid
7245
+ * @description Margin account UUID for margin TWAP orders
7246
+ */
7247
+ marginAccountId?: string | null;
7248
+ /**
7249
+ * Format: uuid
7250
+ * @description Isolated risk bucket UUID for risk-bucket-scoped margin TWAP orders
7251
+ */
7252
+ riskBucketId?: string | null;
7253
+ /**
7254
+ * @description Leverage for margin TWAP orders
7255
+ * @example 5
7256
+ */
7257
+ leverage?: string | null;
7258
+ /**
7259
+ * @description Whether child orders use the master account balance
7260
+ * @example false
7261
+ */
7262
+ useMasterBalance?: boolean | null;
7263
+ /** @description Strategy key used to group risk buckets */
7264
+ strategyKey?: string | null;
7265
+ /** @description Client-assigned idempotency key */
7266
+ clientTwapId?: string | null;
7267
+ /**
7268
+ * @description Whether seeded size/timing randomization is applied to the schedule
7269
+ * @example true
7270
+ */
7271
+ randomize?: boolean | null;
7272
+ /**
7273
+ * @description Window start (ISO 8601)
7274
+ * @example 2026-08-01T10:00:00Z
7275
+ */
7276
+ startTime?: string | null;
7277
+ /**
7278
+ * @description Window end (ISO 8601). Execution stops hard at this time.
7279
+ * @example 2026-08-01T11:00:00Z
7280
+ */
7281
+ endTime?: string | null;
7282
+ /**
7283
+ * Format: int64
7284
+ * @description Derived base slice interval in milliseconds (stored for audit)
7285
+ * @example 30000
7286
+ */
7287
+ intervalMs?: number | null;
7288
+ /**
7289
+ * Format: int32
7290
+ * @description Number of slices in the planned schedule
7291
+ * @example 120
7292
+ */
7293
+ plannedSlices?: number | null;
7294
+ /**
7295
+ * Format: int32
7296
+ * @description Number of child orders placed so far
7297
+ * @example 54
7298
+ */
7299
+ slicesPlaced?: number | null;
7300
+ /**
7301
+ * Format: int32
7302
+ * @description Number of slices skipped or failed so far (limit price through the market, self-trade prevention, halted market, failed admission). Skips never terminate the parent; the deficit flows into catch-up.
7303
+ * @example 2
7304
+ */
7305
+ slicesSkipped?: number | null;
7306
+ /**
7307
+ * @description Planned time of the next slice (ISO 8601); absent once the parent is terminal
7308
+ * @example 2026-08-01T10:27:30Z
7309
+ */
7310
+ nextSliceAt?: string | null;
7311
+ /**
7312
+ * @description Parent state: PENDING, ACTIVE, COMPLETED, or CANCELLED
7313
+ * @example ACTIVE
7314
+ */
7315
+ state?: string | null;
7316
+ /** @description Terminal cause detail, e.g. an end-of-window shortfall ('ended with shortfall <qty>'); absent for non-terminal parents */
7317
+ terminalReason?: string | null;
7318
+ /**
7319
+ * @description Creation timestamp (ISO 8601)
7320
+ * @example 2026-08-01T09:59:58Z
7321
+ */
7322
+ createdAt?: string | null;
7323
+ /** @description Last update timestamp (ISO 8601) */
7324
+ updatedAt?: string | null;
7325
+ /** @description Cancellation timestamp (ISO 8601) */
7326
+ cancelledAt?: string | null;
7327
+ /** @description Completion timestamp (ISO 8601) */
7328
+ completedAt?: string | null;
7329
+ };
6828
7330
  UpdateLimitRequest: {
6829
7331
  /**
6830
7332
  * Format: uuid
@@ -10301,6 +10803,207 @@ export interface operations {
10301
10803
  };
10302
10804
  };
10303
10805
  };
10806
+ list_twap_orders: {
10807
+ parameters: {
10808
+ query?: {
10809
+ /** @description Page number (1-indexed) */
10810
+ page?: number;
10811
+ /** @description Items per page (max 100) */
10812
+ pageSize?: number;
10813
+ state?: string;
10814
+ /** @description Trading pair identifier (UUID) */
10815
+ tradingPairId?: string;
10816
+ };
10817
+ header?: never;
10818
+ path?: never;
10819
+ cookie?: never;
10820
+ };
10821
+ requestBody?: never;
10822
+ responses: {
10823
+ /** @description OK */
10824
+ 200: {
10825
+ headers: {
10826
+ [name: string]: unknown;
10827
+ };
10828
+ content: {
10829
+ "application/json": components["schemas"]["ListTwapOrdersResponse"];
10830
+ };
10831
+ };
10832
+ /** @description Invalid query parameters */
10833
+ 400: {
10834
+ headers: {
10835
+ [name: string]: unknown;
10836
+ };
10837
+ content?: never;
10838
+ };
10839
+ /** @description Authentication required */
10840
+ 401: {
10841
+ headers: {
10842
+ [name: string]: unknown;
10843
+ };
10844
+ content?: never;
10845
+ };
10846
+ /** @description Internal server error */
10847
+ 500: {
10848
+ headers: {
10849
+ [name: string]: unknown;
10850
+ };
10851
+ content?: never;
10852
+ };
10853
+ };
10854
+ };
10855
+ create_twap_order: {
10856
+ parameters: {
10857
+ query?: never;
10858
+ header?: never;
10859
+ path?: never;
10860
+ cookie?: never;
10861
+ };
10862
+ requestBody: {
10863
+ content: {
10864
+ "application/json": components["schemas"]["CreateTwapOrderRequest"];
10865
+ };
10866
+ };
10867
+ responses: {
10868
+ /** @description OK */
10869
+ 200: {
10870
+ headers: {
10871
+ [name: string]: unknown;
10872
+ };
10873
+ content: {
10874
+ "application/json": components["schemas"]["CreateTwapOrderResponse"];
10875
+ };
10876
+ };
10877
+ /** @description Invalid TWAP parameters (window bounds, quantity too small or too large to slice, margin field mismatch) or per-user active TWAP cap reached */
10878
+ 400: {
10879
+ headers: {
10880
+ [name: string]: unknown;
10881
+ };
10882
+ content?: never;
10883
+ };
10884
+ /** @description Authentication required or delegated-agent session (rejected for TWAP) */
10885
+ 401: {
10886
+ headers: {
10887
+ [name: string]: unknown;
10888
+ };
10889
+ content?: never;
10890
+ };
10891
+ /** @description Duplicate clientTwapId for this user and application */
10892
+ 409: {
10893
+ headers: {
10894
+ [name: string]: unknown;
10895
+ };
10896
+ content?: never;
10897
+ };
10898
+ /** @description Internal server error or matching engine failure */
10899
+ 500: {
10900
+ headers: {
10901
+ [name: string]: unknown;
10902
+ };
10903
+ content?: never;
10904
+ };
10905
+ };
10906
+ };
10907
+ get_twap_order: {
10908
+ parameters: {
10909
+ query?: never;
10910
+ header?: never;
10911
+ path: {
10912
+ twapOrderId: string;
10913
+ };
10914
+ cookie?: never;
10915
+ };
10916
+ requestBody?: never;
10917
+ responses: {
10918
+ /** @description OK */
10919
+ 200: {
10920
+ headers: {
10921
+ [name: string]: unknown;
10922
+ };
10923
+ content: {
10924
+ "application/json": components["schemas"]["TwapOrder"];
10925
+ };
10926
+ };
10927
+ /** @description Invalid TWAP order ID format */
10928
+ 400: {
10929
+ headers: {
10930
+ [name: string]: unknown;
10931
+ };
10932
+ content?: never;
10933
+ };
10934
+ /** @description Authentication required */
10935
+ 401: {
10936
+ headers: {
10937
+ [name: string]: unknown;
10938
+ };
10939
+ content?: never;
10940
+ };
10941
+ /** @description TWAP order not found */
10942
+ 404: {
10943
+ headers: {
10944
+ [name: string]: unknown;
10945
+ };
10946
+ content?: never;
10947
+ };
10948
+ /** @description Internal server error */
10949
+ 500: {
10950
+ headers: {
10951
+ [name: string]: unknown;
10952
+ };
10953
+ content?: never;
10954
+ };
10955
+ };
10956
+ };
10957
+ cancel_twap_order: {
10958
+ parameters: {
10959
+ query?: never;
10960
+ header?: never;
10961
+ path: {
10962
+ twapOrderId: string;
10963
+ };
10964
+ cookie?: never;
10965
+ };
10966
+ requestBody?: never;
10967
+ responses: {
10968
+ /** @description OK */
10969
+ 200: {
10970
+ headers: {
10971
+ [name: string]: unknown;
10972
+ };
10973
+ content: {
10974
+ "application/json": components["schemas"]["CancelTwapOrderResponse"];
10975
+ };
10976
+ };
10977
+ /** @description Invalid TWAP order ID or order already terminal */
10978
+ 400: {
10979
+ headers: {
10980
+ [name: string]: unknown;
10981
+ };
10982
+ content?: never;
10983
+ };
10984
+ /** @description Authentication required or delegated-agent session (rejected for TWAP) */
10985
+ 401: {
10986
+ headers: {
10987
+ [name: string]: unknown;
10988
+ };
10989
+ content?: never;
10990
+ };
10991
+ /** @description TWAP order not found */
10992
+ 404: {
10993
+ headers: {
10994
+ [name: string]: unknown;
10995
+ };
10996
+ content?: never;
10997
+ };
10998
+ /** @description Internal server error */
10999
+ 500: {
11000
+ headers: {
11001
+ [name: string]: unknown;
11002
+ };
11003
+ content?: never;
11004
+ };
11005
+ };
11006
+ };
10304
11007
  get_order_by_id: {
10305
11008
  parameters: {
10306
11009
  query?: never;