@0xmonaco/types 1.0.74 → 1.0.75

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.
Files changed (43) hide show
  1. package/dist/api/index.d.ts +0 -7
  2. package/dist/applications/index.d.ts +14 -15
  3. package/dist/applications/index.js +2 -2
  4. package/dist/applications/requests.d.ts +70 -15
  5. package/dist/applications/requests.js +2 -3
  6. package/dist/applications/responses.d.ts +35 -39
  7. package/dist/applications/responses.js +1 -1
  8. package/dist/fees/responses.js +2 -2
  9. package/dist/margin-accounts/index.d.ts +72 -12
  10. package/dist/market/index.d.ts +76 -6
  11. package/dist/pitpass/index.d.ts +16 -11
  12. package/dist/pitpass/index.js +1 -1
  13. package/dist/pitpass/responses.d.ts +21 -0
  14. package/dist/pitpass/responses.js +43 -14
  15. package/dist/positions/index.d.ts +81 -14
  16. package/dist/profile/index.d.ts +114 -44
  17. package/dist/trading/index.d.ts +1 -1
  18. package/dist/trading/orders.d.ts +6 -32
  19. package/dist/trading/responses.d.ts +9 -14
  20. package/dist/validation/applications.d.ts +51 -0
  21. package/dist/validation/applications.js +45 -0
  22. package/dist/validation/index.d.ts +1 -0
  23. package/dist/validation/index.js +1 -0
  24. package/dist/validation/margin-accounts.d.ts +10 -3
  25. package/dist/validation/margin-accounts.js +17 -6
  26. package/dist/validation/market.d.ts +24 -0
  27. package/dist/validation/market.js +22 -0
  28. package/dist/validation/positions.d.ts +5 -3
  29. package/dist/validation/positions.js +12 -5
  30. package/dist/validation/profile.d.ts +19 -2
  31. package/dist/validation/profile.js +36 -4
  32. package/dist/validation/trading.d.ts +2 -2
  33. package/dist/websocket/base.d.ts +56 -6
  34. package/dist/websocket/client.d.ts +8 -3
  35. package/dist/websocket/events/index.d.ts +1 -0
  36. package/dist/websocket/events/index.js +1 -0
  37. package/dist/websocket/events/position-events.d.ts +15 -0
  38. package/dist/websocket/events/position-valuation-events.d.ts +60 -0
  39. package/dist/websocket/events/position-valuation-events.js +15 -0
  40. package/dist/wire/operations.d.ts +1 -1
  41. package/dist/wire/operations.js +2 -0
  42. package/dist/wire/schema.d.ts +748 -235
  43. package/package.json +2 -2
@@ -444,8 +444,8 @@ export interface paths {
444
444
  * List application balances
445
445
  * @description List application balances.
446
446
  *
447
- * Returns a paginated list of all user balances for this application.
448
- * Requires backend authentication via secret key.
447
+ * Returns a paginated list of the balances of the application's users.
448
+ * Public: the application is selected by `client_id`.
449
449
  */
450
450
  get: operations["list_application_balances"];
451
451
  put?: never;
@@ -490,9 +490,9 @@ export interface paths {
490
490
  * List application movements
491
491
  * @description List application movements.
492
492
  *
493
- * Returns a paginated list of all ledger movements (deposits, withdrawals,
494
- * trades, etc.) for this application. Requires backend authentication via
495
- * secret key.
493
+ * Returns a paginated list of the ledger movements (deposits, withdrawals,
494
+ * trades, etc.) of the application's users. Public: the application is
495
+ * selected by `client_id`.
496
496
  */
497
497
  get: operations["list_application_movements"];
498
498
  put?: never;
@@ -514,8 +514,8 @@ export interface paths {
514
514
  * List application orders
515
515
  * @description List application orders.
516
516
  *
517
- * Returns a paginated list of all orders for this application. Requires
518
- * backend authentication via secret key.
517
+ * Returns a paginated list of all orders placed by the application's users.
518
+ * Public: the application is selected by `client_id`.
519
519
  */
520
520
  get: operations["list_application_orders"];
521
521
  put?: never;
@@ -538,8 +538,8 @@ export interface paths {
538
538
  * @description Get application stats.
539
539
  *
540
540
  * Returns aggregate volume and fee stats for this application. Stats are
541
- * scoped to trades where the application's users were the taker. Requires
542
- * backend authentication via secret key.
541
+ * scoped to trades where the application's users were the taker. Public:
542
+ * the application is selected by `client_id`.
543
543
  */
544
544
  get: operations["get_application_stats"];
545
545
  put?: never;
@@ -561,8 +561,8 @@ export interface paths {
561
561
  * List application users
562
562
  * @description List application users.
563
563
  *
564
- * Returns a paginated list of all users for this application. Requires
565
- * backend authentication via secret key.
564
+ * Returns a paginated list of the application's users. Public: the
565
+ * application is selected by `client_id`.
566
566
  */
567
567
  get: operations["list_application_users"];
568
568
  put?: never;
@@ -1963,6 +1963,51 @@ export interface paths {
1963
1963
  patch?: never;
1964
1964
  trace?: never;
1965
1965
  };
1966
+ "/api/v1/margin/sub-accounts/{marginAccountId}/collateral/transfer-in": {
1967
+ parameters: {
1968
+ query?: never;
1969
+ header?: never;
1970
+ path?: never;
1971
+ cookie?: never;
1972
+ };
1973
+ get?: never;
1974
+ put?: never;
1975
+ /**
1976
+ * @description Move collateral from the caller's default margin account to one of their
1977
+ * sub-accounts, in one sequenced step. The same move as `TransferCollateral`
1978
+ * from the default account to the sub-account. The path names an open
1979
+ * sub-account of the caller; the default margin account itself is refused
1980
+ * (fund it with the parent-margin-account routes).
1981
+ */
1982
+ post: operations["transfer_collateral_to_sub_account"];
1983
+ delete?: never;
1984
+ options?: never;
1985
+ head?: never;
1986
+ patch?: never;
1987
+ trace?: never;
1988
+ };
1989
+ "/api/v1/margin/sub-accounts/{marginAccountId}/collateral/transfer-out": {
1990
+ parameters: {
1991
+ query?: never;
1992
+ header?: never;
1993
+ path?: never;
1994
+ cookie?: never;
1995
+ };
1996
+ get?: never;
1997
+ put?: never;
1998
+ /**
1999
+ * @description Move collateral from one of the caller's sub-accounts back to their
2000
+ * default margin account, in one sequenced step. The mirror of
2001
+ * `TransferCollateralToSubAccount`; the amount must fit the sub-account's
2002
+ * free collateral.
2003
+ */
2004
+ post: operations["transfer_collateral_from_sub_account"];
2005
+ delete?: never;
2006
+ options?: never;
2007
+ head?: never;
2008
+ patch?: never;
2009
+ trace?: never;
2010
+ };
1966
2011
  "/api/v1/market/funding/history": {
1967
2012
  parameters: {
1968
2013
  query?: never;
@@ -2758,8 +2803,9 @@ export interface paths {
2758
2803
  * @description Read your own referral position (self-scoped).
2759
2804
  *
2760
2805
  * Return the authenticated caller's referral position: their referral chain
2761
- * upward (L1, L2 and L3 — who referred them, who referred that wallet, and so
2762
- * on), the total rewards they have earned, and their most recent reward rows.
2806
+ * upward (L1, L2 and onward — who referred them, who referred that wallet, and
2807
+ * so on, as many levels as PitPass currently rewards), the total rewards they
2808
+ * have earned, and their most recent reward rows.
2763
2809
  * Self-scoped — identity comes only from the session, never a path id,
2764
2810
  * so a caller can only ever read their own chain. Every other user is
2765
2811
  * identified by their public wallet address, never an internal id. An empty
@@ -2785,10 +2831,12 @@ export interface paths {
2785
2831
  * Get your referral downline and earnings
2786
2832
  * @description Read your own downline earnings (self-scoped).
2787
2833
  *
2788
- * Return who the authenticated caller earns from and how much: an
2789
- * earnings-by-source breakdown aggregated from the caller's reward rows across
2790
- * all three reward levels (L1/L2/L3), their L1 direct-referee roster (including
2791
- * referees who have not traded yet), and a per-level earnings summary.
2834
+ * Return who the authenticated caller earns from and how much: one page of
2835
+ * the earnings-by-source breakdown across every reward level, their L1
2836
+ * direct-referee roster (including referees who have not traded yet), and a
2837
+ * per-level earnings summary that always covers every level and source,
2838
+ * whatever page is requested. `earnings_by_source` is paged (`page_size`,
2839
+ * `page_token`); a request without them gets the first page, not every row.
2792
2840
  * Self-scoped — identity comes only from the session, never a path id. Every
2793
2841
  * source and referee is identified by their public wallet address, never an
2794
2842
  * internal id.
@@ -2814,16 +2862,16 @@ export interface paths {
2814
2862
  * @description Read one level of your own referral tree (self-scoped).
2815
2863
  *
2816
2864
  * Return the wallets directly referred by `parent` — the authenticated caller
2817
- * when `parent` is omitted, otherwise one of the caller's own L1 or L2
2818
- * referees — one page at a time, newest first. Each node carries its level
2865
+ * when `parent` is omitted, otherwise one of the caller's own referees above
2866
+ * the deepest rewarded level — one page at a time, newest first. Each node carries its level
2819
2867
  * relative to the caller, its parent, how many wallets it has referred (so the
2820
2868
  * client knows whether it can be expanded), and what the caller has earned
2821
2869
  * from that wallet's own trades. Expanding a node is another call with
2822
- * `parent` set to that node's wallet; the tree stops at L3, the deepest level
2823
- * that pays referral rewards.
2870
+ * `parent` set to that node's wallet; the tree stops at the deepest level that
2871
+ * pays referral rewards, which an admin configures (at most 10).
2824
2872
  *
2825
2873
  * Self-scoped — identity comes only from the session. A `parent` that is not
2826
- * the caller or inside the caller's own L1/L2 downline returns 404, the same
2874
+ * the caller or a referee the caller can expand returns 404, the same
2827
2875
  * as a wallet that does not exist, so the endpoint cannot be used to read
2828
2876
  * anyone else's tree. Every node is identified by its public wallet address,
2829
2877
  * never an internal id.
@@ -3442,28 +3490,16 @@ export interface components {
3442
3490
  * @example master
3443
3491
  */
3444
3492
  accountType?: string | null;
3445
- /**
3446
- * @description Whether the user is allowed to withdraw
3447
- * @example true
3448
- */
3449
- canWithdraw?: boolean | null;
3450
3493
  /**
3451
3494
  * @description Account creation timestamp (ISO 8601)
3452
3495
  * @example 2023-11-13T10:30:00Z
3453
3496
  */
3454
3497
  createdAt?: string | null;
3455
- /** @description Email address */
3456
- email?: string | null;
3457
3498
  /**
3458
3499
  * @description Whether the user account is active
3459
3500
  * @example true
3460
3501
  */
3461
3502
  isActive?: boolean | null;
3462
- /**
3463
- * @description Whether the user is banned
3464
- * @example false
3465
- */
3466
- isBanned?: boolean | null;
3467
3503
  /**
3468
3504
  * Format: uuid
3469
3505
  * @description Master account ID (for sub-accounts)
@@ -3898,7 +3934,7 @@ export interface components {
3898
3934
  */
3899
3935
  strategyKey?: string | null;
3900
3936
  /**
3901
- * @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS.
3937
+ * @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED.
3902
3938
  * @example CROSS
3903
3939
  * @enum {string|null}
3904
3940
  */
@@ -4699,7 +4735,7 @@ export interface components {
4699
4735
  */
4700
4736
  strategyKey?: string | null;
4701
4737
  /**
4702
- * @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS.
4738
+ * @description Risk bucket mode for margin orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED.
4703
4739
  * @example CROSS
4704
4740
  * @enum {string|null}
4705
4741
  */
@@ -4865,7 +4901,7 @@ export interface components {
4865
4901
  */
4866
4902
  riskBucketId?: string | null;
4867
4903
  /**
4868
- * @description Risk bucket mode for margin TWAP orders. Defaults to ISOLATED. Values: ISOLATED, CROSS.
4904
+ * @description Risk bucket mode for margin TWAP orders. Defaults to ISOLATED. Values: ISOLATED, CROSS. On an isolated-only market (TradingPairData.isolated_only) a CROSS order that is not reduce-only is rejected with HTTP 400 / gRPC INVALID_ARGUMENT carrying the structured error code CROSS_MARGIN_NOT_ALLOWED.
4869
4905
  * @example CROSS
4870
4906
  * @enum {string|null}
4871
4907
  */
@@ -5429,12 +5465,6 @@ export interface components {
5429
5465
  * @example 5
5430
5466
  */
5431
5467
  total?: number | null;
5432
- /**
5433
- * Format: uint32
5434
- * @description Current page number
5435
- * @example 1
5436
- */
5437
- page?: number | null;
5438
5468
  /**
5439
5469
  * Format: uint32
5440
5470
  * @description Items per page
@@ -5447,6 +5477,12 @@ export interface components {
5447
5477
  * @example 1
5448
5478
  */
5449
5479
  totalPages?: number | null;
5480
+ /**
5481
+ * @description Cursor for the next page, minted from the last row of an over-fetched
5482
+ * page. The whole set is already in memory, so over-fetching is free and an
5483
+ * empty token is the definitive end of the walk.
5484
+ */
5485
+ nextPageToken?: string | null;
5450
5486
  };
5451
5487
  GetBuildercodePayoutSummaryResponse: {
5452
5488
  /**
@@ -5632,16 +5668,15 @@ export interface components {
5632
5668
  };
5633
5669
  GetMarginAccountMovementsResponse: {
5634
5670
  movements?: components["schemas"]["MarginAccountMovement"][] | null;
5635
- /**
5636
- * Format: uint32
5637
- * @description Matching movements. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more movements than the listing can page through reads the cap, not its lifetime total.
5638
- * @example 150
5639
- */
5640
- total?: number | null;
5641
- /** Format: uint32 */
5642
- page?: number | null;
5643
5671
  /** Format: uint32 */
5644
5672
  pageSize?: number | null;
5673
+ /**
5674
+ * @description Cursor for the next page, minted from the last row of an over-fetched
5675
+ * page: this listing is one SQL statement with one global ORDER BY, so a
5676
+ * page shorter than `pageSize` proves the walk is exhausted and this is
5677
+ * empty. A non-empty token always has at least one further row behind it.
5678
+ */
5679
+ nextPageToken?: string | null;
5645
5680
  };
5646
5681
  GetMarginAccountPnlResponse: {
5647
5682
  marginAccountId?: string | null;
@@ -5683,6 +5718,9 @@ export interface components {
5683
5718
  * bucket cannot be released at all, and the parent margin account is
5684
5719
  * charged at most its allocation, the loss past it being the insurance
5685
5720
  * fund's.
5721
+ *
5722
+ * Printed truncated toward zero at the quote asset's precision, so the
5723
+ * printed amount itself is always accepted.
5686
5724
  */
5687
5725
  withdrawableCollateral?: string | null;
5688
5726
  totalPositionNotional?: string | null;
@@ -5854,16 +5892,10 @@ export interface components {
5854
5892
  movements?: components["schemas"]["LedgerMovement"][] | null;
5855
5893
  /**
5856
5894
  * Format: uint32
5857
- * @description Matching movements. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a user with more matching movements than the listing can page through reads the cap, not their lifetime total.
5895
+ * @description Number of movements matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
5858
5896
  * @example 150
5859
5897
  */
5860
5898
  total?: number | null;
5861
- /**
5862
- * Format: uint32
5863
- * @description Current page number
5864
- * @example 1
5865
- */
5866
- page?: number | null;
5867
5899
  /**
5868
5900
  * Format: uint32
5869
5901
  * @description Items per page
@@ -5872,15 +5904,28 @@ export interface components {
5872
5904
  pageSize?: number | null;
5873
5905
  /**
5874
5906
  * Format: uint32
5875
- * @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
5907
+ * @description Number of pages at this pageSize, bounded by the server ceiling — a lower bound when totalCapped is true.
5876
5908
  * @example 8
5877
5909
  */
5878
5910
  totalPages?: number | null;
5911
+ /**
5912
+ * @description Cursor for the next page, minted from the last row of an over-fetched
5913
+ * page. Each arm of the union is cut at the same over-fetched depth and the
5914
+ * outer query orders the merged rows, so a page shorter than `pageSize`
5915
+ * means both arms are exhausted and this is empty — a non-empty token always
5916
+ * has at least one further row behind it.
5917
+ */
5918
+ nextPageToken?: string | null;
5919
+ /**
5920
+ * @description True when more than the server ceiling of movements matched, so the count stopped at the ceiling and total/totalPages are a lower bound. False when total is exact, including exactly the ceiling.
5921
+ * @example false
5922
+ */
5923
+ totalCapped?: boolean | null;
5879
5924
  };
5880
5925
  GetMyFeeTierResponse: {
5881
5926
  /**
5882
5927
  * Format: int32
5883
- * @description Caller's resolved tier (1–6) from their wallet's stored weighted 14-day volume
5928
+ * @description Caller's resolved tier (1–6) from the higher of their wallet's weighted 14-day volume and any volume floor set on the wallet. A floor that is set or changed counts once it applies to the wallet's fills, usually within a minute, and likewise for an account the wallet opens in a new application; a removed or expired floor stops counting at once
5884
5929
  * @example 2
5885
5930
  */
5886
5931
  currentTierLevel?: number | null;
@@ -5900,7 +5945,7 @@ export interface components {
5900
5945
  */
5901
5946
  perpVolume14d?: string | null;
5902
5947
  /**
5903
- * @description Additional weighted volume needed to reach the next tier; omitted at tier 6
5948
+ * @description Additional weighted volume needed to reach the next tier, counted from the volume the current tier resolved from; omitted at tier 6
5904
5949
  * @example 17500000
5905
5950
  */
5906
5951
  volumeToNextTier?: string | null;
@@ -5914,12 +5959,14 @@ export interface components {
5914
5959
  feeSchedule?: components["schemas"]["FeeTierScheduleRow"][] | null;
5915
5960
  };
5916
5961
  GetMyReferralDownlineResponse: {
5917
- /** @description One row per (source trader, level, token) the caller earns from, across all three reward levels. Comes straight from the caller's reward rows — no tree walk. */
5962
+ /** @description One page of rows, one per (source account, level, token) the caller earns from, across every reward level, ordered by each source account's own total, largest first. A wallet that traded through several applications has one account per application: its rows within a page are merged into one row at the position of its first (largest) part, so a merged row can sit below a smaller one, and the wallet can appear again on a later page. Paged by `pageSize` / `pageToken`; follow `nextPageToken` for the rest. Comes from the caller's maintained reward totals — no tree walk. */
5918
5963
  earningsBySource?: components["schemas"]["ReferralEarningsSource"][] | null;
5919
- /** @description The caller's direct (L1) referees, newest first, including referees who have not traded yet (0 earned). Bounded to the most recent 500 EFFECTIVE referees (after per-wallet dedupe and the winning-edge filter). The earnings views (`earnings_by_source` and the summary) are unbounded and count every level, so a caller past the roster cap still sees their full earnings; only this roster listing is capped. */
5964
+ /** @description The caller's direct (L1) referees, newest first, including referees who have not traded yet (0 earned). Bounded to the most recent 500 EFFECTIVE referees (after per-wallet dedupe and the winning-edge filter). The summary counts every level and source and `earnings_by_source` pages through every row, so a caller past the roster cap still sees their full earnings; only this roster listing is capped. */
5920
5965
  directReferees?: components["schemas"]["ReferralDirectReferee"][] | null;
5921
- /** @description Total earned broken down by level (L1/L2/L3). */
5966
+ /** @description Total earned broken down by level. Covers every level and source regardless of the `earnings_by_source` page. */
5922
5967
  summary?: components["schemas"]["ReferralEarningsSummary"] | null;
5968
+ /** @description Cursor for the next `earningsBySource` page; empty when there are no more rows. */
5969
+ nextPageToken?: string | null;
5923
5970
  };
5924
5971
  GetMyReferralPositionResponse: {
5925
5972
  /**
@@ -5939,7 +5986,7 @@ export interface components {
5939
5986
  referrerDisplay?: string | null;
5940
5987
  /** @description The caller's most recent reward rows, newest first. Bounded server-side — not the full history. */
5941
5988
  rewards?: components["schemas"]["ReferralRewardEntry"][] | null;
5942
- /** @description The caller's referral chain upward, nearest first: L1 (who referred the caller), then L2 (who referred them), then L3. At most three entries; shorter when the chain ends, empty when the caller was not referred. These are the wallets the caller's own trades pay referral rewards to. */
5989
+ /** @description The caller's referral chain upward, nearest first: L1 (who referred the caller), then L2 (who referred them), and so on. At most as many entries as PitPass currently rewards levels (at most 10); shorter when the chain ends, empty when the caller was not referred. These are the wallets the caller's own trades pay referral rewards to. */
5943
5990
  upline?: components["schemas"]["ReferralUplineEntry"][] | null;
5944
5991
  };
5945
5992
  GetMyReferralTreeResponse: {
@@ -5947,7 +5994,7 @@ export interface components {
5947
5994
  parent?: string | null;
5948
5995
  /**
5949
5996
  * Format: int32
5950
- * @description Depth of `parent` below the caller: 0 for the caller, 1 or 2 for a referee being expanded. Every node is one level deeper.
5997
+ * @description Depth of `parent` below the caller: 0 for the caller, otherwise the level of the referee being expanded. Every node is one level deeper.
5951
5998
  */
5952
5999
  parentLevel?: number | null;
5953
6000
  /** @description The wallets `parent` referred, newest first. A wallet that signed up under several referrers (one per app) appears only under the referrer the reward engine pays. */
@@ -5998,7 +6045,7 @@ export interface components {
5998
6045
  */
5999
6046
  tradingPairId?: string | null;
6000
6047
  /**
6001
- * @description What kind of order this row is: LIMIT or MARKET for a book order, TWAP for a TWAP parent, CONDITIONAL for a price-triggered order. TWAP and CONDITIONAL appear only in responses — they name a row's kind and cannot be placed through the create-order request, which still takes LIMIT, MARKET or IOC. A row of either kind carries its kind-specific fields in `twap` or `conditional`; the fields shared by every kind (id, side, quantity, status, timestamps) are populated in place as usual.
6048
+ * @description Order type: LIMIT or MARKET
6002
6049
  * @example LIMIT
6003
6050
  */
6004
6051
  orderType?: string | null;
@@ -6008,7 +6055,7 @@ export interface components {
6008
6055
  */
6009
6056
  side?: string | null;
6010
6057
  /**
6011
- * @description Limit price (null for market orders). For a TWAP parent this is its optional parent-level limit price, and for a conditional order the limit price its triggered order will carry (null when it triggers as a market order).
6058
+ * @description Limit price (null for market orders)
6012
6059
  * @example 35000.00
6013
6060
  */
6014
6061
  price?: string | null;
@@ -6191,7 +6238,7 @@ export interface components {
6191
6238
  */
6192
6239
  batchId?: string | null;
6193
6240
  /**
6194
- * @description Stable terminal cause for a cancelled order: USER_REQUESTED, REPLACED, LIQUIDATION, INSUFFICIENT_MARGIN, REDUCE_ONLY_EXHAUSTED, POSITION_CLOSED, OCO_SIBLING_TRIGGERED, SELF_TRADE_PREVENTION, AUTO_DELEVERAGING, or SYSTEM. AUTO_DELEVERAGING means auto-deleveraging closed the position your risk bucket held and this resting order was cancelled with it; you were deleveraged as a counterparty, not liquidated.
6241
+ * @description Stable terminal cause for a cancelled order: USER_REQUESTED, REPLACED, LIQUIDATION, INSUFFICIENT_MARGIN, REDUCE_ONLY_EXHAUSTED, POSITION_CLOSED, OCO_SIBLING_TRIGGERED, SELF_TRADE_PREVENTION, AUTO_DELEVERAGING, PRICE_BAND, SLIPPAGE_TOLERANCE, or SYSTEM. AUTO_DELEVERAGING means auto-deleveraging closed the position your risk bucket held and this resting order was cancelled with it; you were deleveraged as a counterparty, not liquidated. PRICE_BAND means the exchange's protective price band stopped the order and its remainder was cancelled; SLIPPAGE_TOLERANCE means your own slippageToleranceBps did.
6195
6242
  * @example REDUCE_ONLY_EXHAUSTED
6196
6243
  */
6197
6244
  terminalReason?: string | null;
@@ -6200,10 +6247,6 @@ export interface components {
6200
6247
  * @example false
6201
6248
  */
6202
6249
  postOnly?: boolean | null;
6203
- /** @description Present only when orderType is TWAP: the full TWAP parent, identical to what GET /api/v1/orders/twap/{twapOrderId} returns — schedule, slice counters, progress, and terminal reason. The row's shared fields mirror it: quantity is the parent's total quantity, filledQuantity its executed quantity, and status maps its state onto the order statuses. */
6204
- twap?: components["schemas"]["TwapOrder"] | null;
6205
- /** @description Present only when orderType is CONDITIONAL: the full conditional order, identical to what the conditional-order endpoints return — trigger price and direction, condition type, linked group, and the order it triggers into. The row's shared fields mirror it, with status mapping its state onto the order statuses. */
6206
- conditional?: components["schemas"]["ConditionalOrder"] | null;
6207
6250
  /**
6208
6251
  * Format: int64
6209
6252
  * @description Opaque, compare-only revision counter for this order's state: the sequencer step that wrote it. A strictly higher value is strictly newer state for that order. The SAME counter is carried on every order WebSocket event and on the `orders` snapshot frame, so a reconnecting client reconciles on `(id, version)` — take the REST row when `snapshot.version >= local.version`, else keep local state. Note `>=`, not `>`: on the stream, equal versions mean the SAME STEP rather than identical state, because one step emits several events for one order (an `OrderPlaced` and then its fills) and a batch shares one step across every item. A REST row is that step's FINAL state, so it wins a tie. Between two REST reads the comparison is simpler — equal there does mean identical state. Do not read anything else into the number: it is not a count of updates, consecutive values are not expected (it is drawn from a global sequence shared by every order, so per-order values are sparse and gaps are normal), and it is not comparable across different orders. Absent means unknown: an order last written before this field existed. Fall back to a full field comparison for those rather than treating absent as version zero — and note that a comparison against an absent value is false in both directions, so an order held locally without one is never refreshed by the merge above; take the REST row unconditionally for those. Reconciling on this counter does NOT on its own close a reconnect gap: an order that filled or was cancelled while the socket was down appears in neither the resting snapshot nor the stream, so recover fills from `listUserTrades` (ordered by execution time) and resolve anything your local state believes is resting that the snapshot no longer lists with a targeted `getOrder`. Unlike `updatedAt`, this value is identical on every REST endpoint that serves the same order state, and never advances without a state change.
@@ -6645,6 +6688,11 @@ export interface components {
6645
6688
  * @example 918342
6646
6689
  */
6647
6690
  version?: number | null;
6691
+ /**
6692
+ * @description RFC 3339 instant at which this position opened. Same contract as
6693
+ * `Position.opened_at` above.
6694
+ */
6695
+ openedAt?: string | null;
6648
6696
  };
6649
6697
  GetPositionRiskResponse: {
6650
6698
  positionId?: string | null;
@@ -7250,29 +7298,50 @@ export interface components {
7250
7298
  */
7251
7299
  balanceId?: string | null;
7252
7300
  };
7301
+ /** @description What the caller has earned at one referral level. */
7302
+ LevelEarnings: {
7303
+ /**
7304
+ * Format: int32
7305
+ * @description Referral level: 1 for direct referees, 2 for their referees, and so on (at most 10).
7306
+ * @example 1
7307
+ */
7308
+ level?: number | null;
7309
+ /**
7310
+ * @description All-time credited earnings at this level, in the reward token's RAW atomic units.
7311
+ * @example 900000
7312
+ */
7313
+ earned?: string | null;
7314
+ };
7253
7315
  ListAllFundingHistoryResponse: {
7254
7316
  records?: components["schemas"]["FundingRecord"][] | null;
7255
- /** Format: uint32 */
7317
+ /**
7318
+ * Format: uint32
7319
+ * @description Settlements matching the filter, bounded by the server count ceiling — see
7320
+ * `totalCapped`. A lower bound when `totalCapped` is true.
7321
+ */
7256
7322
  total?: number | null;
7257
7323
  /** Format: uint32 */
7258
- page?: number | null;
7259
- /** Format: uint32 */
7260
7324
  pageSize?: number | null;
7325
+ /**
7326
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7327
+ * page: this listing is one ordered read, so a page shorter than
7328
+ * `pageSize` proves the walk is exhausted and this is empty.
7329
+ */
7330
+ nextPageToken?: string | null;
7331
+ /**
7332
+ * @description True when MORE than the server ceiling matched, so the count stopped at
7333
+ * the ceiling and `total` is a lower bound.
7334
+ */
7335
+ totalCapped?: boolean | null;
7261
7336
  };
7262
7337
  ListAppBalancesResponse: {
7263
7338
  balances?: components["schemas"]["ApplicationBalance"][] | null;
7264
7339
  /**
7265
7340
  * Format: uint32
7266
- * @description Total matching balances
7341
+ * @description Number of balances matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7267
7342
  * @example 50
7268
7343
  */
7269
7344
  total?: number | null;
7270
- /**
7271
- * Format: uint32
7272
- * @description Current page number
7273
- * @example 1
7274
- */
7275
- page?: number | null;
7276
7345
  /**
7277
7346
  * Format: uint32
7278
7347
  * @description Items per page
@@ -7281,25 +7350,24 @@ export interface components {
7281
7350
  pageSize?: number | null;
7282
7351
  /**
7283
7352
  * Format: uint32
7284
- * @description Total number of pages
7353
+ * @description Number of pages at this pageSize, bounded by the server ceiling — a lower bound when totalCapped is true.
7285
7354
  * @example 3
7286
7355
  */
7287
7356
  totalPages?: number | null;
7288
- };
7289
- ListAppMovementsResponse: {
7290
- movements?: components["schemas"]["ApplicationMovement"][] | null;
7291
7357
  /**
7292
- * Format: uint32
7293
- * @description Matching movements. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so an application with more matching movements than the listing can page through reads the cap, not its lifetime total.
7294
- * @example 150
7358
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7359
+ * page: this listing is one ordered read, so a page shorter than
7360
+ * `pageSize` proves the walk is exhausted and this is empty.
7295
7361
  */
7296
- total?: number | null;
7362
+ nextPageToken?: string | null;
7297
7363
  /**
7298
- * Format: uint32
7299
- * @description Current page number
7300
- * @example 1
7364
+ * @description True when more than the server ceiling of balances matched, so the count stopped at the ceiling and total/totalPages are a lower bound.
7365
+ * @example false
7301
7366
  */
7302
- page?: number | null;
7367
+ totalCapped?: boolean | null;
7368
+ };
7369
+ ListAppMovementsResponse: {
7370
+ movements?: components["schemas"]["ApplicationMovement"][] | null;
7303
7371
  /**
7304
7372
  * Format: uint32
7305
7373
  * @description Items per page
@@ -7307,26 +7375,14 @@ export interface components {
7307
7375
  */
7308
7376
  pageSize?: number | null;
7309
7377
  /**
7310
- * Format: uint32
7311
- * @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
7312
- * @example 8
7378
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7379
+ * page: this listing is one ordered read, so a page shorter than
7380
+ * `pageSize` proves the walk is exhausted and this is empty.
7313
7381
  */
7314
- totalPages?: number | null;
7382
+ nextPageToken?: string | null;
7315
7383
  };
7316
7384
  ListAppOrdersResponse: {
7317
7385
  orders?: components["schemas"]["ApplicationOrder"][] | null;
7318
- /**
7319
- * Format: uint32
7320
- * @description Matching orders. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so an application with more matching orders than the listing can page through reads the cap, not its lifetime total.
7321
- * @example 150
7322
- */
7323
- total?: number | null;
7324
- /**
7325
- * Format: uint32
7326
- * @description Current page number
7327
- * @example 1
7328
- */
7329
- page?: number | null;
7330
7386
  /**
7331
7387
  * Format: uint32
7332
7388
  * @description Items per page
@@ -7334,26 +7390,20 @@ export interface components {
7334
7390
  */
7335
7391
  pageSize?: number | null;
7336
7392
  /**
7337
- * Format: uint32
7338
- * @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
7339
- * @example 8
7393
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7394
+ * page: this listing is one ordered read, so a page shorter than
7395
+ * `pageSize` proves the walk is exhausted and this is empty.
7340
7396
  */
7341
- totalPages?: number | null;
7397
+ nextPageToken?: string | null;
7342
7398
  };
7343
7399
  ListAppUsersResponse: {
7344
7400
  users?: components["schemas"]["AppUser"][] | null;
7345
7401
  /**
7346
7402
  * Format: uint32
7347
- * @description Total number of users
7403
+ * @description Number of users matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7348
7404
  * @example 50
7349
7405
  */
7350
7406
  total?: number | null;
7351
- /**
7352
- * Format: uint32
7353
- * @description Current page number
7354
- * @example 1
7355
- */
7356
- page?: number | null;
7357
7407
  /**
7358
7408
  * Format: uint32
7359
7409
  * @description Items per page
@@ -7362,10 +7412,21 @@ export interface components {
7362
7412
  pageSize?: number | null;
7363
7413
  /**
7364
7414
  * Format: uint32
7365
- * @description Total number of pages
7415
+ * @description Number of pages at this pageSize, bounded by the server ceiling — a lower bound when totalCapped is true.
7366
7416
  * @example 3
7367
7417
  */
7368
7418
  totalPages?: number | null;
7419
+ /**
7420
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7421
+ * page: this listing is one ordered read, so a page shorter than
7422
+ * `pageSize` proves the walk is exhausted and this is empty.
7423
+ */
7424
+ nextPageToken?: string | null;
7425
+ /**
7426
+ * @description True when more than the server ceiling of users matched, so the count stopped at the ceiling and total/totalPages are a lower bound.
7427
+ * @example false
7428
+ */
7429
+ totalCapped?: boolean | null;
7369
7430
  };
7370
7431
  ListBuilderFeeChangesResponse: {
7371
7432
  /** @description Builder-fee changes, newest first. */
@@ -7432,27 +7493,34 @@ export interface components {
7432
7493
  };
7433
7494
  ListFundingHistoryResponse: {
7434
7495
  records?: components["schemas"]["FundingRecord"][] | null;
7435
- /** Format: uint32 */
7496
+ /**
7497
+ * Format: uint32
7498
+ * @description Settlements matching the filter, bounded by the server count ceiling — see
7499
+ * `totalCapped`. A lower bound when `totalCapped` is true.
7500
+ */
7436
7501
  total?: number | null;
7437
7502
  /** Format: uint32 */
7438
- page?: number | null;
7439
- /** Format: uint32 */
7440
7503
  pageSize?: number | null;
7504
+ /**
7505
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7506
+ * page: this listing is one ordered read, so a page shorter than
7507
+ * `pageSize` proves the walk is exhausted and this is empty.
7508
+ */
7509
+ nextPageToken?: string | null;
7510
+ /**
7511
+ * @description True when MORE than the server ceiling matched, so the count stopped at
7512
+ * the ceiling and `total` is a lower bound.
7513
+ */
7514
+ totalCapped?: boolean | null;
7441
7515
  };
7442
7516
  ListFundingPaymentsResponse: {
7443
7517
  records?: components["schemas"]["FundingPaymentRecord"][] | null;
7444
7518
  /**
7445
7519
  * Format: uint32
7446
- * @description Matching funding payment records. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a user with more matching payments than the listing can page through reads the cap, not their lifetime total.
7520
+ * @description Number of funding payments matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7447
7521
  * @example 2
7448
7522
  */
7449
7523
  total?: number | null;
7450
- /**
7451
- * Format: uint32
7452
- * @description Current page number
7453
- * @example 1
7454
- */
7455
- page?: number | null;
7456
7524
  /**
7457
7525
  * Format: uint32
7458
7526
  * @description Items per page
@@ -7461,10 +7529,21 @@ export interface components {
7461
7529
  pageSize?: number | null;
7462
7530
  /**
7463
7531
  * Format: uint32
7464
- * @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
7532
+ * @description Number of pages at this pageSize, bounded by the server ceiling — a lower bound when totalCapped is true.
7465
7533
  * @example 1
7466
7534
  */
7467
7535
  totalPages?: number | null;
7536
+ /**
7537
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7538
+ * page: this listing is one ordered read, so a page shorter than
7539
+ * `pageSize` proves the walk is exhausted and this is empty.
7540
+ */
7541
+ nextPageToken?: string | null;
7542
+ /**
7543
+ * @description True when more than the server ceiling of payments matched, so the count stopped at the ceiling and total/totalPages are a lower bound.
7544
+ * @example false
7545
+ */
7546
+ totalCapped?: boolean | null;
7468
7547
  };
7469
7548
  ListLeadTraderClosedTradesResponse: {
7470
7549
  closedTrades?: components["schemas"]["ClosedTrade"][] | null;
@@ -7494,12 +7573,20 @@ export interface components {
7494
7573
  };
7495
7574
  ListMarginAccountsResponse: {
7496
7575
  accounts?: components["schemas"]["MarginAccountSummary"][] | null;
7497
- /** Format: uint32 */
7576
+ /**
7577
+ * Format: uint32
7578
+ * @description Exact: a user's margin accounts and risk buckets are a small bounded set,
7579
+ * counted in memory after the repricing pass.
7580
+ */
7498
7581
  total?: number | null;
7499
7582
  /** Format: uint32 */
7500
- page?: number | null;
7501
- /** Format: uint32 */
7502
7583
  pageSize?: number | null;
7584
+ /**
7585
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7586
+ * page. The whole set is already in memory, so over-fetching is free and an
7587
+ * empty token is the definitive end of the walk.
7588
+ */
7589
+ nextPageToken?: string | null;
7503
7590
  };
7504
7591
  ListMyFollowersResponse: {
7505
7592
  followers?: components["schemas"]["Follower"][] | null;
@@ -7575,29 +7662,38 @@ export interface components {
7575
7662
  };
7576
7663
  ListPositionHistoryResponse: {
7577
7664
  events?: components["schemas"]["PositionHistoryEvent"][] | null;
7578
- /**
7579
- * Format: uint32
7580
- * @description Matching position-history events. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more history than the listing can page through reads the cap, not its lifetime total.
7581
- * @example 150
7582
- */
7583
- total?: number | null;
7584
- /** Format: uint32 */
7585
- page?: number | null;
7586
7665
  /** Format: uint32 */
7587
7666
  pageSize?: number | null;
7667
+ /**
7668
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7669
+ * page: this listing is one SQL statement with one global ORDER BY, so a
7670
+ * page shorter than `pageSize` proves the walk is exhausted and this is
7671
+ * empty. A non-empty token always has at least one further row behind it.
7672
+ */
7673
+ nextPageToken?: string | null;
7588
7674
  };
7589
7675
  ListPositionsResponse: {
7590
7676
  positions?: components["schemas"]["Position"][] | null;
7591
7677
  /**
7592
7678
  * Format: uint32
7593
- * @description Matching positions. Exact up to 10,000 pages of the requested page size (page_size x 10,000 rows) and saturates there, so a caller with more matching positions than the listing can page through reads the cap, not its lifetime total.
7679
+ * @description Number of positions matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7594
7680
  * @example 150
7595
7681
  */
7596
7682
  total?: number | null;
7597
7683
  /** Format: uint32 */
7598
- page?: number | null;
7599
- /** Format: uint32 */
7600
7684
  pageSize?: number | null;
7685
+ /**
7686
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7687
+ * page: this listing is one SQL statement with one global ORDER BY, so a
7688
+ * page shorter than `pageSize` proves the walk is exhausted and this is
7689
+ * empty. A non-empty token always has at least one further row behind it.
7690
+ */
7691
+ nextPageToken?: string | null;
7692
+ /**
7693
+ * @description True when more than the server ceiling of positions matched, so the count stopped at the ceiling and total is a lower bound. False when total is exact, including exactly the ceiling.
7694
+ * @example false
7695
+ */
7696
+ totalCapped?: boolean | null;
7601
7697
  };
7602
7698
  ListSubAccountsResponse: {
7603
7699
  subAccounts?: components["schemas"]["SubAccount"][] | null;
@@ -7733,6 +7829,9 @@ export interface components {
7733
7829
  * bucket cannot be released at all, and the parent margin account is
7734
7830
  * charged at most its allocation, the loss past it being the insurance
7735
7831
  * fund's.
7832
+ *
7833
+ * Printed truncated toward zero at the quote asset's precision, so the
7834
+ * printed amount itself is always accepted.
7736
7835
  */
7737
7836
  withdrawableCollateral?: string | null;
7738
7837
  totalPositionNotional?: string | null;
@@ -7788,7 +7887,8 @@ export interface components {
7788
7887
  *
7789
7888
  * Present only on risk-bucket summary rows served from a live risk engine
7790
7889
  * snapshot; absent on parent rows and on persisted-fallback reads, where
7791
- * neither of the gate's terms is reconstructable.
7890
+ * neither of the gate's terms is reconstructable. Printed truncated toward
7891
+ * zero at the quote asset's precision, like `withdrawable_collateral`.
7792
7892
  */
7793
7893
  availableOrderCollateral?: string | null;
7794
7894
  /**
@@ -8172,10 +8272,9 @@ export interface components {
8172
8272
  * realized PnL and funding, less what risk buckets have allocated:
8173
8273
  * `min(net deposits + settled realized PnL - bucket allocations,
8174
8274
  * free_collateral - max(unrealized_pnl, 0))`, floored at zero. This is the
8175
- * bound the engine's gates actually enforce. It agrees with
8176
- * `MarginAccountSummary.withdrawable_collateral` up to quote-decimal
8177
- * truncation: this surface truncates toward zero at the quote asset's
8178
- * precision, while the margin-accounts surface may carry sub-tick tails.
8275
+ * bound the engine's gates actually enforce. The same figure as
8276
+ * `MarginAccountSummary.withdrawable_collateral`: both surfaces truncate it
8277
+ * toward zero at the quote asset's precision.
8179
8278
  *
8180
8279
  * Size transfers-out, withdrawals, and new isolated/first-use positions
8181
8280
  * from this field; `parent_available_collateral` remains the trading-margin
@@ -8234,10 +8333,8 @@ export interface components {
8234
8333
  *
8235
8334
  * This is the largest accepted transfer-out, and every smaller amount is
8236
8335
  * accepted too. It is zero on a risk bucket that is not `NORMAL` and on one
8237
- * whose realized loss has used up its allocation. Agrees with the
8238
- * risk-bucket rows' `MarginAccountSummary.withdrawable_collateral` up to
8239
- * quote-decimal truncation (this surface truncates toward zero; that one
8240
- * may carry sub-tick tails).
8336
+ * whose realized loss has used up its allocation. The same figure as the
8337
+ * risk-bucket rows' `MarginAccountSummary.withdrawable_collateral`.
8241
8338
  */
8242
8339
  withdrawableCollateral?: string | null;
8243
8340
  /**
@@ -8488,6 +8585,34 @@ export interface components {
8488
8585
  * @example 918342
8489
8586
  */
8490
8587
  version?: number | null;
8588
+ /**
8589
+ * @description RFC 3339 instant at which this position OPENED: the fill that took its
8590
+ * exposure from zero to non-zero. Time held is now minus opened_at for an
8591
+ * OPEN position, and updated_at minus opened_at for a terminal one. It never
8592
+ * changes for the life of the position id; a flip closes the position and
8593
+ * opens a new one, with a new id and its own opened_at.
8594
+ *
8595
+ * Served from the matching engine's record of the opening fill while the
8596
+ * engine holds the position, and from the persisted row otherwise. The row
8597
+ * is written from the same fill's durable stamp, which comes from the
8598
+ * sequencer's non-decreasing stamp clock rather than the engine's wall
8599
+ * clock. The two readings normally agree to within one sequencer step, but
8600
+ * while the stamp clock is held ahead of a lagging host clock they differ by
8601
+ * that lead (`matching_engine_stamp_clock_live_lead_ms`), so a position's
8602
+ * value can move by it when the engine restarts and re-reads the row. Clamp
8603
+ * a computed time held at zero.
8604
+ *
8605
+ * Absent when the opening instant is unknown, never filled with the read
8606
+ * instant. Positions opened before this field existed carry the persisted
8607
+ * row's value, which can trail the opening fill by the persistence lag
8608
+ * where the fill could not be recovered.
8609
+ *
8610
+ * Not versioned, and not guaranteed constant at a given `version`: a
8611
+ * one-off operator correction can move it earlier without advancing the
8612
+ * version. Take it from the newest payload rather than skipping it on an
8613
+ * equal version.
8614
+ */
8615
+ openedAt?: string | null;
8491
8616
  };
8492
8617
  PositionHistoryEvent: {
8493
8618
  id?: string | null;
@@ -8797,7 +8922,7 @@ export interface components {
8797
8922
  source?: string | null;
8798
8923
  /**
8799
8924
  * Format: int32
8800
- * @description Referral level the caller earns from this source at: 1 (direct), 2, or 3.
8925
+ * @description Referral level the caller earns from this source at: 1 (direct), 2, and so on (at most 10). Rows at a level deeper than PitPass rewards today are earlier earnings, kept as history.
8801
8926
  * @example 1
8802
8927
  */
8803
8928
  level?: number | null;
@@ -8830,6 +8955,10 @@ export interface components {
8830
8955
  * ever pays in more than one reward token, atomic units across tokens are not
8831
8956
  * additive, so read the per-token `earnings_by_source` rows for a correct
8832
8957
  * breakdown.
8958
+ *
8959
+ * `by_level` covers every level with earnings. `level1_earned`,
8960
+ * `level2_earned` and `level3_earned` are deprecated: they carry levels 1 to 3
8961
+ * for older clients and say nothing about deeper levels.
8833
8962
  */
8834
8963
  ReferralEarningsSummary: {
8835
8964
  /**
@@ -8838,20 +8967,25 @@ export interface components {
8838
8967
  */
8839
8968
  totalEarned?: string | null;
8840
8969
  /**
8841
- * @description Total earned from direct (L1) referees, in RAW atomic units.
8970
+ * @deprecated
8971
+ * @description DEPRECATED: use `byLevel`. Total earned from direct (L1) referees, in RAW atomic units.
8842
8972
  * @example 900000
8843
8973
  */
8844
8974
  level1Earned?: string | null;
8845
8975
  /**
8846
- * @description Total earned from L2 downline, in RAW atomic units.
8976
+ * @deprecated
8977
+ * @description DEPRECATED: use `byLevel`. Total earned from L2 downline, in RAW atomic units.
8847
8978
  * @example 400000
8848
8979
  */
8849
8980
  level2Earned?: string | null;
8850
8981
  /**
8851
- * @description Total earned from L3 downline, in RAW atomic units.
8982
+ * @deprecated
8983
+ * @description DEPRECATED: use `byLevel`. Total earned from L3 downline, in RAW atomic units.
8852
8984
  * @example 100000
8853
8985
  */
8854
8986
  level3Earned?: string | null;
8987
+ /** @description All-time credited earnings per referral level, ascending by level, one entry per level the caller has earned at (levels with nothing earned are omitted). Covers every level, including levels deeper than PitPass rewards today. */
8988
+ byLevel?: components["schemas"]["LevelEarnings"][] | null;
8855
8989
  };
8856
8990
  /** @description A single reward the caller has earned, one row per referred trade × level. */
8857
8991
  ReferralRewardEntry: {
@@ -8862,7 +8996,7 @@ export interface components {
8862
8996
  source?: string | null;
8863
8997
  /**
8864
8998
  * Format: int32
8865
- * @description Referral level this reward was paid at: 1 (direct, 30%), 2 (15%), or 3 (5%).
8999
+ * @description Referral level this reward was paid at: 1 for the direct referrer, 2 for the referrer's referrer, and so on (at most 10).
8866
9000
  * @example 1
8867
9001
  */
8868
9002
  level?: number | null;
@@ -8903,7 +9037,7 @@ export interface components {
8903
9037
  display?: string | null;
8904
9038
  /**
8905
9039
  * Format: int32
8906
- * @description Depth below the caller: 1 (the caller referred this wallet), 2, or 3.
9040
+ * @description Depth below the caller: 1 (the caller referred this wallet), 2, and so on up to the configured reward depth (at most 10).
8907
9041
  */
8908
9042
  level?: number | null;
8909
9043
  /** @description Wallet address of the referrer of this node — the caller for a level-1 node. */
@@ -8915,7 +9049,7 @@ export interface components {
8915
9049
  referredAt?: string | null;
8916
9050
  /**
8917
9051
  * Format: uint32
8918
- * @description How many wallets this node has referred. Expand the node (request it as `parent`) when this is above 0. Always 0 at level 3, the deepest level shown.
9052
+ * @description How many wallets this node has referred. Expand the node (request it as `parent`) when this is above 0. Always 0 at the deepest rewarded level, the deepest level shown.
8919
9053
  */
8920
9054
  refereeCount?: number | null;
8921
9055
  /** @description What the caller has earned from this wallet's own trades, across every token, in RAW atomic units. `0` for a wallet that has not traded yet. */
@@ -8932,7 +9066,7 @@ export interface components {
8932
9066
  display?: string | null;
8933
9067
  /**
8934
9068
  * Format: int32
8935
- * @description How far above the caller this ancestor is: 1 (the caller's direct referrer), 2, or 3.
9069
+ * @description How far above the caller this ancestor is: 1 (the caller's direct referrer), 2, and so on up to the configured reward depth (at most 10).
8936
9070
  */
8937
9071
  level?: number | null;
8938
9072
  };
@@ -9999,6 +10133,11 @@ export interface components {
9999
10133
  * @example USDC
10000
10134
  */
10001
10135
  quoteAssetName?: string | null;
10136
+ /**
10137
+ * @description Isolated-only market: cross margin may only reduce a position here. An order from a CROSS risk bucket that is not reduce-only is rejected with the error code CROSS_MARGIN_NOT_ALLOWED; open the position with margin_mode ISOLATED instead
10138
+ * @example false
10139
+ */
10140
+ isolatedOnly?: boolean | null;
10002
10141
  };
10003
10142
  /**
10004
10143
  * @description Trailing stop leg (0XM-2827). Reduce-only MARKET close whose trigger trails
@@ -10067,7 +10206,8 @@ export interface components {
10067
10206
  /**
10068
10207
  * @description The largest amount a further transfer-out will accept after this one.
10069
10208
  * See `MarginAccountSummary.withdrawable_collateral`: this is an
10070
- * allocation-bounded figure, not clamped equity headroom.
10209
+ * allocation-bounded figure, not clamped equity headroom. Truncated toward
10210
+ * zero at the collateral asset's precision.
10071
10211
  */
10072
10212
  newWithdrawableCollateral?: string | null;
10073
10213
  strategyKey?: string | null;
@@ -10076,6 +10216,11 @@ export interface components {
10076
10216
  asset?: string | null;
10077
10217
  amount?: string | null;
10078
10218
  };
10219
+ TransferCollateralFromSubAccountRequest: {
10220
+ /** @description The caller's sub-account the collateral leaves. */
10221
+ marginAccountId?: string | null;
10222
+ amount?: string | null;
10223
+ };
10079
10224
  TransferCollateralRequest: {
10080
10225
  /** @description Collateral asset symbol or address. */
10081
10226
  asset?: string | null;
@@ -10121,7 +10266,8 @@ export interface components {
10121
10266
  /**
10122
10267
  * @description The largest amount a further transfer-out will accept after this one.
10123
10268
  * See `MarginAccountSummary.withdrawable_collateral`: this is an
10124
- * allocation-bounded figure, not clamped equity headroom.
10269
+ * allocation-bounded figure, not clamped equity headroom. Truncated toward
10270
+ * zero at the collateral asset's precision.
10125
10271
  */
10126
10272
  newWithdrawableCollateral?: string | null;
10127
10273
  strategyKey?: string | null;
@@ -10207,6 +10353,11 @@ export interface components {
10207
10353
  */
10208
10354
  marginAccountId?: string | null;
10209
10355
  };
10356
+ TransferCollateralToSubAccountRequest: {
10357
+ /** @description The caller's sub-account that receives the collateral. */
10358
+ marginAccountId?: string | null;
10359
+ amount?: string | null;
10360
+ };
10210
10361
  TransferRewardsRequest: {
10211
10362
  /**
10212
10363
  * @description Reward token contract address (0x-prefixed) to transfer.
@@ -10770,10 +10921,26 @@ export interface operations {
10770
10921
  get_user_balances: {
10771
10922
  parameters: {
10772
10923
  query?: {
10773
- /** @description Page number (1-indexed) */
10774
- page?: number;
10775
- /** @description Items per page (max 100) */
10924
+ /** @description Items per page (max 1000) */
10776
10925
  pageSize?: number;
10926
+ /**
10927
+ * @description Pagination cursor with two states:
10928
+ * - Omitted or empty string (""): start a cursor walk with no prior
10929
+ * position, from the lowest token address.
10930
+ * - Non-empty: an opaque cursor from a previous response's
10931
+ * `nextPageToken`; results resume immediately after that position.
10932
+ *
10933
+ * This listing has no database page to walk: it reads every balance row,
10934
+ * overlays the matching engine's authoritative amounts (which can add rows
10935
+ * the projection has not written yet and drop rows the engine has zeroed),
10936
+ * and pages that in-memory set. The walk therefore seeks by KEY on
10937
+ * `(token, asset_id)` — immutable, present on every row including a
10938
+ * live-only one — rather than by index, so a balance that appears or
10939
+ * vanishes mid-walk no longer shifts the rows behind it across the resume
10940
+ * point and duplicate or skipped rows. `total` and `totalPages` are exact:
10941
+ * the set is bounded by the asset universe, so there is nothing to cap.
10942
+ */
10943
+ pageToken?: string;
10777
10944
  };
10778
10945
  header?: never;
10779
10946
  path?: never;
@@ -10885,10 +11052,28 @@ export interface operations {
10885
11052
  tradingPairId?: string;
10886
11053
  positionId?: string;
10887
11054
  marginAccountId?: string;
10888
- /** @description Page number (1-indexed) */
10889
- page?: number;
10890
- /** @description Items per page (max 100) */
11055
+ /** @description Items per page (max 1000) */
10891
11056
  pageSize?: number;
11057
+ /**
11058
+ * @description Pagination cursor with two states:
11059
+ * - Omitted or empty string (""): start a cursor walk with no prior
11060
+ * position, from the newest payment.
11061
+ * - Non-empty: an opaque cursor from a previous response's
11062
+ * `nextPageToken`; results resume immediately after that position.
11063
+ *
11064
+ * The walk seeks on `(created_at, id)` descending. Not `period_end`, which
11065
+ * the removed page-number mode led its sort with: that column is nullable
11066
+ * and the risk engine leaves it unset when a payment carries no window,
11067
+ * while `created_at` is always stamped (it falls back to the settlement
11068
+ * instant). The `id` tie-break is new — the removed order had none, so a
11069
+ * page boundary inside one funding window could already repeat or drop a
11070
+ * payment.
11071
+ *
11072
+ * `total` and `totalPages` are populated — bounded by the server count
11073
+ * ceiling, see `totalCapped`. Filters must match the request that produced
11074
+ * the token, or the request is rejected 400.
11075
+ */
11076
+ pageToken?: string;
10892
11077
  };
10893
11078
  header?: never;
10894
11079
  path?: never;
@@ -11396,9 +11581,7 @@ export interface operations {
11396
11581
  get_user_movements: {
11397
11582
  parameters: {
11398
11583
  query?: {
11399
- /** @description Page number (1-indexed) */
11400
- page?: number;
11401
- /** @description Items per page (max 100) */
11584
+ /** @description Items per page (max 1000) */
11402
11585
  pageSize?: number;
11403
11586
  /** @description Transaction type */
11404
11587
  transactionType?: "DEPOSIT" | "WITHDRAWAL" | "TRADE" | "FEE" | "FUNDING" | "LIQUIDATION" | "INTEREST" | "REWARD" | "CHAIN_SYNC";
@@ -11408,9 +11591,22 @@ export interface operations {
11408
11591
  assetId?: string;
11409
11592
  /** @description Sort direction for createdAt */
11410
11593
  orderBy?: "ASC" | "DESC";
11411
- };
11412
- header?: never;
11413
- path?: never;
11594
+ /**
11595
+ * @description Pagination cursor with two states:
11596
+ * - Omitted or empty string (""): start a cursor walk with no prior
11597
+ * position, from the newest row (or the oldest, when `orderBy` is ASC).
11598
+ * - Non-empty: an opaque cursor from a previous response's
11599
+ * `nextPageToken`; results resume immediately after that position.
11600
+ *
11601
+ * Every walk covers the ledger and funding arms merged. `total` and
11602
+ * `totalPages` are populated — bounded by the server count ceiling, see
11603
+ * `totalCapped`. Filters and `orderBy` must match the request that produced
11604
+ * the token, or the request is rejected 400.
11605
+ */
11606
+ pageToken?: string;
11607
+ };
11608
+ header?: never;
11609
+ path?: never;
11414
11610
  cookie?: never;
11415
11611
  };
11416
11612
  requestBody?: never;
@@ -11874,7 +12070,7 @@ export interface operations {
11874
12070
  * - Omitted or empty string (""): start a cursor walk with no prior
11875
12071
  * position, from the newest row.
11876
12072
  * - Non-empty: an opaque cursor from a previous response's
11877
- * `next_page_token`; results resume immediately after that position.
12073
+ * `nextPageToken`; results resume immediately after that position.
11878
12074
  *
11879
12075
  * Every walk covers full trade history — hot and archived rows merged. The
11880
12076
  * response carries no item count: this listing's table is too large to count
@@ -11929,15 +12125,34 @@ export interface operations {
11929
12125
  };
11930
12126
  list_application_balances: {
11931
12127
  parameters: {
11932
- query?: {
11933
- /** @description Page number (1-indexed) */
11934
- page?: number;
11935
- /** @description Items per page (max 100) */
12128
+ query: {
12129
+ /** @description Items per page (max 1000) */
11936
12130
  pageSize?: number;
11937
12131
  /** @description User identifier (UUID) */
11938
12132
  userId?: string;
11939
12133
  /** @description Asset identifier (UUID) */
11940
12134
  assetId?: string;
12135
+ /**
12136
+ * @description Pagination cursor with two states:
12137
+ * - Omitted or empty string (""): start a cursor walk with no prior
12138
+ * position.
12139
+ * - Non-empty: an opaque cursor from a previous response's
12140
+ * `nextPageToken`; results resume immediately after that position.
12141
+ *
12142
+ * Ordered by balance id ascending. NOT by `updated_at`, which the removed
12143
+ * offset mode sorted on: that column changes on every balance movement, so
12144
+ * a walk over it could repeat or skip rows with no concurrent insert at
12145
+ * all.
12146
+ *
12147
+ * `total` and `totalPages` are populated — bounded by the server count
12148
+ * ceiling, see `totalCapped`.
12149
+ *
12150
+ * Filters must match the request that produced the token, or the request
12151
+ * is rejected 400.
12152
+ */
12153
+ pageToken?: string;
12154
+ /** @description Application client ID */
12155
+ clientId: string;
11941
12156
  };
11942
12157
  header?: never;
11943
12158
  path?: never;
@@ -11954,15 +12169,22 @@ export interface operations {
11954
12169
  "application/json": components["schemas"]["ListAppBalancesResponse"];
11955
12170
  };
11956
12171
  };
11957
- /** @description Bad request */
12172
+ /** @description Bad request (missing client_id, invalid filter or page token) */
11958
12173
  400: {
11959
12174
  headers: {
11960
12175
  [name: string]: unknown;
11961
12176
  };
11962
12177
  content?: never;
11963
12178
  };
11964
- /** @description Unauthorized - Invalid or missing x-server-key */
11965
- 401: {
12179
+ /** @description No active application has this client_id */
12180
+ 404: {
12181
+ headers: {
12182
+ [name: string]: unknown;
12183
+ };
12184
+ content?: never;
12185
+ };
12186
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12187
+ 429: {
11966
12188
  headers: {
11967
12189
  [name: string]: unknown;
11968
12190
  };
@@ -12034,10 +12256,8 @@ export interface operations {
12034
12256
  };
12035
12257
  list_application_movements: {
12036
12258
  parameters: {
12037
- query?: {
12038
- /** @description Page number (1-indexed) */
12039
- page?: number;
12040
- /** @description Items per page (max 100) */
12259
+ query: {
12260
+ /** @description Items per page (max 1000) */
12041
12261
  pageSize?: number;
12042
12262
  /** @description User identifier (UUID) */
12043
12263
  userId?: string;
@@ -12047,6 +12267,23 @@ export interface operations {
12047
12267
  entryType?: "CREDIT" | "DEBIT" | "LOCK" | "UNLOCK" | "FEE";
12048
12268
  /** @description Asset identifier (UUID) */
12049
12269
  assetId?: string;
12270
+ /**
12271
+ * @description Pagination cursor with two states:
12272
+ * - Omitted or empty string (""): start a cursor walk with no prior
12273
+ * position, from the newest movement.
12274
+ * - Non-empty: an opaque cursor from a previous response's
12275
+ * `nextPageToken`; results resume immediately after that position.
12276
+ *
12277
+ * The response carries no item count: `user_ledger` is too large to count
12278
+ * behind a filter. A movement with no recorded timestamp is not listed —
12279
+ * the column is nullable, and a NULL has no position in the sort key.
12280
+ *
12281
+ * Filters must match the request that produced the token, or the request
12282
+ * is rejected 400.
12283
+ */
12284
+ pageToken?: string;
12285
+ /** @description Application client ID */
12286
+ clientId: string;
12050
12287
  };
12051
12288
  header?: never;
12052
12289
  path?: never;
@@ -12063,15 +12300,22 @@ export interface operations {
12063
12300
  "application/json": components["schemas"]["ListAppMovementsResponse"];
12064
12301
  };
12065
12302
  };
12066
- /** @description Bad request */
12303
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12067
12304
  400: {
12068
12305
  headers: {
12069
12306
  [name: string]: unknown;
12070
12307
  };
12071
12308
  content?: never;
12072
12309
  };
12073
- /** @description Unauthorized - Invalid or missing x-server-key */
12074
- 401: {
12310
+ /** @description No active application has this client_id */
12311
+ 404: {
12312
+ headers: {
12313
+ [name: string]: unknown;
12314
+ };
12315
+ content?: never;
12316
+ };
12317
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12318
+ 429: {
12075
12319
  headers: {
12076
12320
  [name: string]: unknown;
12077
12321
  };
@@ -12088,10 +12332,8 @@ export interface operations {
12088
12332
  };
12089
12333
  list_application_orders: {
12090
12334
  parameters: {
12091
- query?: {
12092
- /** @description Page number (1-indexed) */
12093
- page?: number;
12094
- /** @description Items per page (max 100) */
12335
+ query: {
12336
+ /** @description Items per page (max 1000) */
12095
12337
  pageSize?: number;
12096
12338
  /** @description Order status (single value or comma-separated list) */
12097
12339
  status?: string;
@@ -12103,6 +12345,23 @@ export interface operations {
12103
12345
  side?: "BUY" | "SELL";
12104
12346
  /** @description Order type */
12105
12347
  orderType?: "LIMIT" | "MARKET" | "STOP_LOSS" | "TAKE_PROFIT" | "STOP_LIMIT" | "TRAILING_STOP";
12348
+ /**
12349
+ * @description Pagination cursor with two states:
12350
+ * - Omitted or empty string (""): start a cursor walk with no prior
12351
+ * position.
12352
+ * - Non-empty: an opaque cursor from a previous response's
12353
+ * `nextPageToken`; results resume immediately after that position.
12354
+ *
12355
+ * Every walk covers full order history — hot and archived rows merged.
12356
+ * The response carries no item count: `orders_all` is too large to count
12357
+ * behind a filter.
12358
+ *
12359
+ * Filters must match the request that produced the token, or the request
12360
+ * is rejected 400.
12361
+ */
12362
+ pageToken?: string;
12363
+ /** @description Application client ID */
12364
+ clientId: string;
12106
12365
  };
12107
12366
  header?: never;
12108
12367
  path?: never;
@@ -12119,15 +12378,22 @@ export interface operations {
12119
12378
  "application/json": components["schemas"]["ListAppOrdersResponse"];
12120
12379
  };
12121
12380
  };
12122
- /** @description Bad request */
12381
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12123
12382
  400: {
12124
12383
  headers: {
12125
12384
  [name: string]: unknown;
12126
12385
  };
12127
12386
  content?: never;
12128
12387
  };
12129
- /** @description Unauthorized - Invalid or missing x-server-key */
12130
- 401: {
12388
+ /** @description No active application has this client_id */
12389
+ 404: {
12390
+ headers: {
12391
+ [name: string]: unknown;
12392
+ };
12393
+ content?: never;
12394
+ };
12395
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12396
+ 429: {
12131
12397
  headers: {
12132
12398
  [name: string]: unknown;
12133
12399
  };
@@ -12144,8 +12410,10 @@ export interface operations {
12144
12410
  };
12145
12411
  get_application_stats: {
12146
12412
  parameters: {
12147
- query?: {
12413
+ query: {
12148
12414
  since?: string;
12415
+ /** @description Application client ID */
12416
+ clientId: string;
12149
12417
  };
12150
12418
  header?: never;
12151
12419
  path?: never;
@@ -12162,15 +12430,22 @@ export interface operations {
12162
12430
  "application/json": components["schemas"]["GetAppStatsResponse"];
12163
12431
  };
12164
12432
  };
12165
- /** @description Bad request */
12433
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12166
12434
  400: {
12167
12435
  headers: {
12168
12436
  [name: string]: unknown;
12169
12437
  };
12170
12438
  content?: never;
12171
12439
  };
12172
- /** @description Unauthorized - Invalid or missing x-server-key */
12173
- 401: {
12440
+ /** @description No active application has this client_id */
12441
+ 404: {
12442
+ headers: {
12443
+ [name: string]: unknown;
12444
+ };
12445
+ content?: never;
12446
+ };
12447
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12448
+ 429: {
12174
12449
  headers: {
12175
12450
  [name: string]: unknown;
12176
12451
  };
@@ -12188,15 +12463,34 @@ export interface operations {
12188
12463
  list_application_users: {
12189
12464
  parameters: {
12190
12465
  query: {
12191
- /** @description Page number (1-indexed) */
12192
- page?: number;
12193
- /** @description Items per page (max 100) */
12466
+ /** @description Items per page (max 1000) */
12194
12467
  pageSize?: number;
12195
12468
  isActive?: boolean;
12196
12469
  /** @description Account type filter */
12197
12470
  accountType?: "master" | "sub";
12198
12471
  /** @description Wallet address */
12199
12472
  address: string;
12473
+ /**
12474
+ * @description Pagination cursor with two states:
12475
+ * - Omitted or empty string (""): start a cursor walk with no prior
12476
+ * position.
12477
+ * - Non-empty: an opaque cursor from a previous response's
12478
+ * `nextPageToken`; results resume immediately after that position.
12479
+ *
12480
+ * Ordered by user id ascending, NOT newest-first: `users.created_at` is
12481
+ * nullable, so it cannot be a total keyset key, and excluding the rows
12482
+ * without one would hide users from the listing an application
12483
+ * reconciles against.
12484
+ *
12485
+ * `total` and `totalPages` are populated — bounded by the server count
12486
+ * ceiling, see `totalCapped`.
12487
+ *
12488
+ * Filters must match the request that produced the token, or the request
12489
+ * is rejected 400.
12490
+ */
12491
+ pageToken?: string;
12492
+ /** @description Application client ID */
12493
+ clientId: string;
12200
12494
  };
12201
12495
  header?: never;
12202
12496
  path?: never;
@@ -12213,15 +12507,22 @@ export interface operations {
12213
12507
  "application/json": components["schemas"]["ListAppUsersResponse"];
12214
12508
  };
12215
12509
  };
12216
- /** @description Bad request */
12510
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12217
12511
  400: {
12218
12512
  headers: {
12219
12513
  [name: string]: unknown;
12220
12514
  };
12221
12515
  content?: never;
12222
12516
  };
12223
- /** @description Unauthorized - Invalid or missing x-server-key */
12224
- 401: {
12517
+ /** @description No active application has this client_id */
12518
+ 404: {
12519
+ headers: {
12520
+ [name: string]: unknown;
12521
+ };
12522
+ content?: never;
12523
+ };
12524
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12525
+ 429: {
12225
12526
  headers: {
12226
12527
  [name: string]: unknown;
12227
12528
  };
@@ -14475,9 +14776,7 @@ export interface operations {
14475
14776
  list_margin_accounts: {
14476
14777
  parameters: {
14477
14778
  query?: {
14478
- /** @description Page number (1-indexed) */
14479
- page?: number;
14480
- /** @description Items per page (max 100) */
14779
+ /** @description Items per page (max 1000) */
14481
14780
  pageSize?: number;
14482
14781
  /**
14483
14782
  * @description Keep only risk-bucket rows in this state (see `risk_bucket_state`). A
@@ -14486,6 +14785,34 @@ export interface operations {
14486
14785
  state?: string;
14487
14786
  /** @description Trading pair identifier (UUID) */
14488
14787
  tradingPairId?: string;
14788
+ /**
14789
+ * @description Pagination cursor with two states:
14790
+ * - Omitted or empty string (""): start a cursor walk with no prior
14791
+ * position, from the lowest margin account id.
14792
+ * - Non-empty: an opaque cursor from a previous response's
14793
+ * `nextPageToken`; results resume immediately after that position.
14794
+ *
14795
+ * This listing has no database page to walk: one row is a margin account
14796
+ * and one row is a risk bucket, each repriced against live marks and the
14797
+ * engine's bounds, so the set is built in memory and paged there. The walk
14798
+ * seeks by KEY on
14799
+ * `(margin_account_id, trading_pair_id, risk_bucket_id, strategy_key)` —
14800
+ * every component immutable for the row's lifetime, the parent row sorting
14801
+ * ahead of its buckets — rather than by index, so a bucket that opens or
14802
+ * closes mid-walk no longer shifts the rows behind it across the resume
14803
+ * point. The strategy key is part of the key because an auto bucket the
14804
+ * engine has not materialized yet carries no `risk_bucket_id`, and one
14805
+ * account and pair can hold several strategies; such a row sorts under the
14806
+ * id its bucket will carry once the engine projects it, derived from the
14807
+ * account and pair, so provisioning completing mid-walk cannot move the row
14808
+ * across the resume point and serve the same risk bucket twice. `total` is
14809
+ * exact: a user's accounts and buckets are a small bounded set, counted in
14810
+ * memory.
14811
+ *
14812
+ * Filters must match the request that produced the token, or the request is
14813
+ * rejected 400.
14814
+ */
14815
+ pageToken?: string;
14489
14816
  };
14490
14817
  header?: never;
14491
14818
  path?: never;
@@ -14625,10 +14952,21 @@ export interface operations {
14625
14952
  parameters: {
14626
14953
  query?: {
14627
14954
  movementType?: string;
14628
- /** @description Page number (1-indexed) */
14629
- page?: number;
14630
- /** @description Items per page (max 100) */
14955
+ /** @description Items per page (max 1000) */
14631
14956
  pageSize?: number;
14957
+ /**
14958
+ * @description Pagination cursor with two states:
14959
+ * - Omitted or empty string (""): start a cursor walk with no prior
14960
+ * position, from the newest movement — this listing always sorts
14961
+ * newest-first.
14962
+ * - Non-empty: an opaque cursor from a previous response's
14963
+ * `nextPageToken`; results resume immediately after that position.
14964
+ *
14965
+ * The response carries no item count: the underlying ledger is too large to
14966
+ * count behind a filter. `movementType` must match the request that produced
14967
+ * the token, or the request is rejected 400.
14968
+ */
14969
+ pageToken?: string;
14632
14970
  };
14633
14971
  header?: never;
14634
14972
  path: {
@@ -14886,10 +15224,13 @@ export interface operations {
14886
15224
  parameters: {
14887
15225
  query?: {
14888
15226
  movementType?: string;
14889
- /** @description Page number (1-indexed) */
14890
- page?: number;
14891
- /** @description Items per page (max 100) */
15227
+ /** @description Items per page (max 1000) */
14892
15228
  pageSize?: number;
15229
+ /**
15230
+ * @description See `GetMarginAccountMovementsRequest.page_token`: the same cursor walk,
15231
+ * scoped to the caller's parent margin account.
15232
+ */
15233
+ pageToken?: string;
14893
15234
  };
14894
15235
  header?: never;
14895
15236
  path?: never;
@@ -15073,6 +15414,80 @@ export interface operations {
15073
15414
  };
15074
15415
  };
15075
15416
  };
15417
+ transfer_collateral_to_sub_account: {
15418
+ parameters: {
15419
+ query?: never;
15420
+ header?: never;
15421
+ path: {
15422
+ /**
15423
+ * @description The caller's sub-account that receives the collateral.
15424
+ * @example 2b1a5f9c-0000-4000-8000-000000000001
15425
+ */
15426
+ marginAccountId: string;
15427
+ };
15428
+ cookie?: never;
15429
+ };
15430
+ requestBody: {
15431
+ content: {
15432
+ "application/json": components["schemas"]["TransferCollateralToSubAccountRequest"];
15433
+ };
15434
+ };
15435
+ responses: {
15436
+ /** @description OK */
15437
+ 200: {
15438
+ headers: {
15439
+ [name: string]: unknown;
15440
+ };
15441
+ content: {
15442
+ "application/json": components["schemas"]["TransferCollateralResponse"];
15443
+ };
15444
+ };
15445
+ /** @description Movement rate limit exceeded — withdrawals and collateral transfers share a per-user budget; retry after the interval in details.retryAfter */
15446
+ 429: {
15447
+ headers: {
15448
+ [name: string]: unknown;
15449
+ };
15450
+ content?: never;
15451
+ };
15452
+ };
15453
+ };
15454
+ transfer_collateral_from_sub_account: {
15455
+ parameters: {
15456
+ query?: never;
15457
+ header?: never;
15458
+ path: {
15459
+ /**
15460
+ * @description The caller's sub-account the collateral leaves.
15461
+ * @example 2b1a5f9c-0000-4000-8000-000000000001
15462
+ */
15463
+ marginAccountId: string;
15464
+ };
15465
+ cookie?: never;
15466
+ };
15467
+ requestBody: {
15468
+ content: {
15469
+ "application/json": components["schemas"]["TransferCollateralFromSubAccountRequest"];
15470
+ };
15471
+ };
15472
+ responses: {
15473
+ /** @description OK */
15474
+ 200: {
15475
+ headers: {
15476
+ [name: string]: unknown;
15477
+ };
15478
+ content: {
15479
+ "application/json": components["schemas"]["TransferCollateralResponse"];
15480
+ };
15481
+ };
15482
+ /** @description Movement rate limit exceeded — withdrawals and collateral transfers share a per-user budget; retry after the interval in details.retryAfter */
15483
+ 429: {
15484
+ headers: {
15485
+ [name: string]: unknown;
15486
+ };
15487
+ content?: never;
15488
+ };
15489
+ };
15490
+ };
15076
15491
  list_all_funding_history: {
15077
15492
  parameters: {
15078
15493
  query?: {
@@ -15080,12 +15495,30 @@ export interface operations {
15080
15495
  startTime?: number;
15081
15496
  /** @description End time as Unix timestamp (milliseconds) */
15082
15497
  endTime?: number;
15083
- /** @description Page number (1-indexed) */
15084
- page?: number;
15085
- /** @description Items per page (max 100) */
15498
+ /** @description Items per page (max 1000) */
15086
15499
  pageSize?: number;
15087
15500
  /** @description Sort direction for settledAt */
15088
15501
  orderBy?: "ASC" | "DESC";
15502
+ /**
15503
+ * @description Pagination cursor with two states:
15504
+ * - Omitted or empty string (""): start a cursor walk with no prior
15505
+ * position, from the newest settlement (the oldest when `orderBy` is
15506
+ * ASC).
15507
+ * - Non-empty: an opaque cursor from a previous response's
15508
+ * `nextPageToken`; results resume immediately after that position.
15509
+ *
15510
+ * The walk seeks on `(settled_at, id)` in the requested direction.
15511
+ * `settled_at` is NOT NULL and never changes once a window settles, and the
15512
+ * `id` tie-break makes the key total — the removed page-number mode ordered
15513
+ * by `(settled_at, trading_pair_id, epoch)` with no tie-break, so a page
15514
+ * boundary between two settlements sharing that triple could repeat or drop
15515
+ * a row.
15516
+ *
15517
+ * `total` is populated — bounded by the server count ceiling, see
15518
+ * `totalCapped`. Filters and `orderBy` must match the request that produced
15519
+ * the token, or the request is rejected 400.
15520
+ */
15521
+ pageToken?: string;
15089
15522
  };
15090
15523
  header?: never;
15091
15524
  path?: never;
@@ -15271,12 +15704,29 @@ export interface operations {
15271
15704
  startTime?: number;
15272
15705
  /** @description End time as Unix timestamp (milliseconds) */
15273
15706
  endTime?: number;
15274
- /** @description Page number (1-indexed) */
15275
- page?: number;
15276
- /** @description Items per page (max 100) */
15707
+ /** @description Items per page (max 1000) */
15277
15708
  pageSize?: number;
15278
- /** @description Sort direction for createdAt */
15709
+ /** @description Sort direction for settledAt */
15279
15710
  orderBy?: "ASC" | "DESC";
15711
+ /**
15712
+ * @description Pagination cursor with two states:
15713
+ * - Omitted or empty string (""): start a cursor walk with no prior
15714
+ * position, from the newest settlement (the oldest when `orderBy` is
15715
+ * ASC).
15716
+ * - Non-empty: an opaque cursor from a previous response's
15717
+ * `nextPageToken`; results resume immediately after that position.
15718
+ *
15719
+ * The walk seeks on `(settled_at, id)` in the requested direction.
15720
+ * `settled_at` is NOT NULL and never changes once a window settles, and the
15721
+ * `id` tie-break makes the key total — the removed page-number mode ordered
15722
+ * by `epoch` with no tie-break, so a page boundary between two
15723
+ * settlements sharing it could repeat or drop a row.
15724
+ *
15725
+ * `total` is populated — bounded by the server count ceiling, see
15726
+ * `totalCapped`. Filters and `orderBy` must match the request that produced
15727
+ * the token, or the request is rejected 400.
15728
+ */
15729
+ pageToken?: string;
15280
15730
  };
15281
15731
  header?: never;
15282
15732
  path: {
@@ -16844,7 +17294,15 @@ export interface operations {
16844
17294
  };
16845
17295
  get_my_referral_downline: {
16846
17296
  parameters: {
16847
- query?: never;
17297
+ query?: {
17298
+ /** @description `earningsBySource` rows per page (max 500) */
17299
+ pageSize?: number;
17300
+ /**
17301
+ * @description Opaque cursor from a previous response's `nextPageToken`; omit or send an
17302
+ * empty string for the first page.
17303
+ */
17304
+ pageToken?: string;
17305
+ };
16848
17306
  header?: never;
16849
17307
  path?: never;
16850
17308
  cookie?: never;
@@ -16924,7 +17382,7 @@ export interface operations {
16924
17382
  };
16925
17383
  content?: never;
16926
17384
  };
16927
- /** @description `parent` is not the caller or one of the caller's own L1/L2 referees */
17385
+ /** @description `parent` is not the caller or one of the caller's own expandable referees */
16928
17386
  404: {
16929
17387
  headers: {
16930
17388
  [name: string]: unknown;
@@ -17056,10 +17514,53 @@ export interface operations {
17056
17514
  tradingPairId?: string;
17057
17515
  /** @description Order status (single value or comma-separated list) */
17058
17516
  status?: string;
17059
- /** @description Page number (1-indexed) */
17060
- page?: number;
17061
- /** @description Items per page (max 100) */
17517
+ /** @description Items per page (max 1000) */
17062
17518
  pageSize?: number;
17519
+ /**
17520
+ * @description Pagination cursor with two states:
17521
+ * - Omitted or empty string (""): start a cursor walk with no prior
17522
+ * position.
17523
+ * - Non-empty: an opaque cursor from a previous response's
17524
+ * `nextPageToken`; results resume immediately after that position.
17525
+ *
17526
+ * ORDER DEPENDS ON THE FILTER, because the two cases are served from
17527
+ * different places:
17528
+ *
17529
+ * - `status=OPEN` is answered from the matching engine's live view, which
17530
+ * carries no timestamps for a position the persistor has not written
17531
+ * yet. It is ordered by `(marginAccountId, tradingPairId, positionId)`
17532
+ * ascending — stable and total, but UUID order, NOT newest-first.
17533
+ * - Every other filter reads persisted rows, ordered by the IMMUTABLE
17534
+ * `(opened_at, id)` descending: newest-opened first. The removed
17535
+ * page-number mode sorted on `COALESCE(closed_at, last_funding_at,
17536
+ * opened_at)`, which *advances* whenever a position takes a funding
17537
+ * payment or closes, so rows moved across a resume point mid-walk;
17538
+ * `opened_at` never changes after the insert. Order therefore differs
17539
+ * from the removed mode's. One exception: an operator correction may
17540
+ * move an OPEN position's `opened_at` EARLIER, never later, to its
17541
+ * opening fill. A walk in flight while that runs can return such a
17542
+ * position a second time, but cannot skip one: dedupe on `positionId`.
17543
+ *
17544
+ * Those are two separate cursor spaces, so a token is only valid in the one
17545
+ * that minted it, and crossing between them is ASYMMETRIC:
17546
+ *
17547
+ * - A PERSISTED token offered to `status=OPEN` while the engine is
17548
+ * reachable is served: the live branch does not recognise it, declines,
17549
+ * and the persisted walk answers. That is what keeps a walk going which
17550
+ * started on persisted rows because the engine was down at the time and
17551
+ * has since come back.
17552
+ * - A LIVE token offered after the engine becomes unreachable is NOT
17553
+ * served. The live branch cannot answer at all, and the persisted
17554
+ * decoder rejects the `src=live` token, so the request is a 400 and the
17555
+ * walk has to start over. There is no way to carry a live position into
17556
+ * the persisted ordering: the two relations do not share a sort key, and
17557
+ * resuming at a key from the wrong one would skip or repeat rows
17558
+ * silently, which is worse than the restart.
17559
+ *
17560
+ * A token neither relation recognises is rejected 400, and so is one minted
17561
+ * under different filters.
17562
+ */
17563
+ pageToken?: string;
17063
17564
  };
17064
17565
  header?: never;
17065
17566
  path?: never;
@@ -17123,12 +17624,24 @@ export interface operations {
17123
17624
  marginAccountId?: string;
17124
17625
  /** @description Trading pair identifier (UUID) */
17125
17626
  tradingPairId?: string;
17126
- /** @description Page number (1-indexed) */
17127
- page?: number;
17128
- /** @description Items per page (max 100) */
17627
+ /** @description Items per page (max 1000) */
17129
17628
  pageSize?: number;
17130
17629
  /** @description When true, return only DECREASE, CLOSE, and LIQUIDATE execution rows. */
17131
17630
  reductionOnly?: boolean;
17631
+ /**
17632
+ * @description Pagination cursor with two states:
17633
+ * - Omitted or empty string (""): start a cursor walk with no prior
17634
+ * position, from the newest event — this listing always sorts
17635
+ * newest-first.
17636
+ * - Non-empty: an opaque cursor from a previous response's
17637
+ * `nextPageToken`; results resume immediately after that position.
17638
+ *
17639
+ * Every walk covers full position history — hot and archived rows merged.
17640
+ * The response carries no item count: this listing's relation is too large
17641
+ * to count behind a filter. Filters must match the request that produced the
17642
+ * token, or the request is rejected 400.
17643
+ */
17644
+ pageToken?: string;
17132
17645
  };
17133
17646
  header?: never;
17134
17647
  path?: never;