@0xmonaco/types 1.0.74 → 1.0.76

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 (58) 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/buildercodes/index.d.ts +3 -4
  9. package/dist/buildercodes/responses.d.ts +10 -3
  10. package/dist/buildercodes/responses.js +24 -4
  11. package/dist/fees/responses.js +2 -2
  12. package/dist/managed-markets/index.d.ts +21 -2
  13. package/dist/margin-accounts/index.d.ts +72 -12
  14. package/dist/market/index.d.ts +76 -6
  15. package/dist/pitpass/index.d.ts +16 -11
  16. package/dist/pitpass/index.js +1 -1
  17. package/dist/pitpass/responses.d.ts +21 -0
  18. package/dist/pitpass/responses.js +43 -14
  19. package/dist/positions/index.d.ts +81 -14
  20. package/dist/profile/index.d.ts +114 -44
  21. package/dist/sdk/index.d.ts +12 -4
  22. package/dist/trading/index.d.ts +1 -1
  23. package/dist/trading/orders.d.ts +6 -32
  24. package/dist/trading/responses.d.ts +9 -14
  25. package/dist/validation/applications.d.ts +51 -0
  26. package/dist/validation/applications.js +45 -0
  27. package/dist/validation/index.d.ts +2 -0
  28. package/dist/validation/index.js +2 -0
  29. package/dist/validation/managed-markets.d.ts +17 -0
  30. package/dist/validation/managed-markets.js +17 -0
  31. package/dist/validation/margin-accounts.d.ts +10 -3
  32. package/dist/validation/margin-accounts.js +17 -6
  33. package/dist/validation/market.d.ts +45 -0
  34. package/dist/validation/market.js +43 -0
  35. package/dist/validation/positions.d.ts +5 -3
  36. package/dist/validation/positions.js +12 -5
  37. package/dist/validation/profile.d.ts +19 -2
  38. package/dist/validation/profile.js +36 -4
  39. package/dist/validation/trading.d.ts +2 -2
  40. package/dist/validation/vault.d.ts +14 -0
  41. package/dist/validation/vault.js +14 -0
  42. package/dist/websocket/base.d.ts +56 -6
  43. package/dist/websocket/client.d.ts +8 -3
  44. package/dist/websocket/events/index.d.ts +1 -0
  45. package/dist/websocket/events/index.js +1 -0
  46. package/dist/websocket/events/instrument-events.d.ts +27 -1
  47. package/dist/websocket/events/instrument-events.js +6 -1
  48. package/dist/websocket/events/market-stats-events.d.ts +41 -5
  49. package/dist/websocket/events/market-stats-events.js +3 -2
  50. package/dist/websocket/events/orders-events.d.ts +30 -3
  51. package/dist/websocket/events/position-events.d.ts +15 -0
  52. package/dist/websocket/events/position-valuation-events.d.ts +60 -0
  53. package/dist/websocket/events/position-valuation-events.js +15 -0
  54. package/dist/wire/operations.d.ts +1 -1
  55. package/dist/wire/operations.js +2 -0
  56. package/dist/wire/schema.d.ts +906 -284
  57. package/dist/withdrawals/index.d.ts +27 -6
  58. 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;
@@ -732,9 +732,10 @@ export interface paths {
732
732
  * application's behalf do not count. Setting the fee it already has is a
733
733
  * no-op that succeeds and does not use up a change.
734
734
  *
735
- * The fee can be set while builder fees are switched off
736
- * (`builderFeeEnabled` false): it is stored and nothing is charged until they
737
- * are switched on. A newly stored fee reaches order requests within a few
735
+ * The fee can be set while the revenue share or builder fees are switched
736
+ * on, and is refused (**HTTP 403** / **PERMISSION_DENIED**) while both are
737
+ * off. With builder fees off (`builderFeeEnabled` false) it is stored and
738
+ * nothing is charged until they are switched on. A newly stored fee reaches order requests within a few
738
739
  * seconds. Sequencer ordering is authoritative for matching-engine policy and
739
740
  * enrollment state: an order processed before one of those sequenced changes
740
741
  * uses the earlier state, and a later order uses the new state.
@@ -790,8 +791,7 @@ export interface paths {
790
791
  *
791
792
  * The application is taken from the authenticated session; there is no
792
793
  * application id in the request. The caller must be the application's
793
- * configured payout wallet. This method is gated by `buildercodes_enabled`
794
- * like the rest of the service.
794
+ * configured payout wallet.
795
795
  */
796
796
  get: operations["get_buildercodes_config"];
797
797
  put?: never;
@@ -912,13 +912,13 @@ export interface paths {
912
912
  *
913
913
  * Delegated-agent sessions are refused: a delegated grant conveys only
914
914
  * order-management authority, and this claim converts reserved balance into a
915
- * tradeable one. The refusal happens before the feature check, so a delegated
916
- * caller is refused whether or not BuilderCodes is enabled.
915
+ * tradeable one. No program switch gates the claim: a balance already
916
+ * credited stays claimable whether or not the revenue share is on.
917
917
  *
918
918
  * Transport contracts differ, and this comment is emitted into the generated
919
919
  * gRPC SDK where HTTP statuses do not exist. An insufficient payout balance
920
920
  * is **HTTP 409** on REST and **FAILED_PRECONDITION** on gRPC; a refused
921
- * caller (delegated session, or BuilderCodes disabled) is **HTTP 403** on
921
+ * caller (delegated session) is **HTTP 403** on
922
922
  * REST and **PERMISSION_DENIED** on gRPC.
923
923
  *
924
924
  * A claim can also fail as **HTTP 503** / **UNAVAILABLE** when the matching
@@ -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
  /**
@@ -5481,7 +5517,7 @@ export interface components {
5481
5517
  * @example 0x0000000000000000000000000000000000000001
5482
5518
  */
5483
5519
  payoutAddress?: string | null;
5484
- /** @description Current BuilderCodes feature-flag state. Successful responses are true because this endpoint is gated by the flag. */
5520
+ /** @description Whether the BuilderCodes revenue share is switched on. While false no new share accrues; balances already credited stay readable and claimable. */
5485
5521
  buildercodesEnabled?: boolean | null;
5486
5522
  /**
5487
5523
  * Format: uint32
@@ -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;
@@ -6848,18 +6896,36 @@ export interface components {
6848
6896
  /** @description Recent trades for a trading pair. */
6849
6897
  GetTradesResponse: {
6850
6898
  trades?: components["schemas"]["PublicTrade"][] | null;
6851
- /**
6852
- * Format: uint32
6853
- * @description Current page number
6854
- * @example 1
6855
- */
6856
- page?: number | null;
6857
6899
  /**
6858
6900
  * Format: uint32
6859
6901
  * @description Maximum number of trades returned
6860
6902
  * @example 25
6861
6903
  */
6862
6904
  pageSize?: number | null;
6905
+ /**
6906
+ * @description Cursor for the next page, under **proven** semantics: the read over-fetches
6907
+ * one row past `page_size`, so an empty token means the walk is finished and
6908
+ * a non-empty token means a further trade was actually seen. Unlike
6909
+ * `ListUserTradesResponse.next_page_token` (AIP-158 "maybe more"), a client
6910
+ * can stop here on the empty token without a confirming extra request — this
6911
+ * listing reads one table, so there is no hot/archive interleave that could
6912
+ * hide rows behind a short page.
6913
+ *
6914
+ * That one table is the hot `trades` table, so a walk reaches the end of the
6915
+ * archiver's retention window rather than the end of the pair's history. This
6916
+ * is the endpoint's long-standing scope, unchanged by the cursor.
6917
+ *
6918
+ * There is no public walk over a pair's ARCHIVED history, and this endpoint is
6919
+ * not a partial one — do not point market-data consumers at the user trade
6920
+ * listings to continue it. `GetUserTrades` / `ListUserTrades` do merge the
6921
+ * archive, but they are authenticated and user-scoped (`auth.user_id` is the
6922
+ * read's first mandatory filter), so they return only trades where the caller
6923
+ * was maker or taker. Following them to extend a public pair tape would
6924
+ * silently drop every fill between two other parties. An individual archived
6925
+ * trade does stay publicly reachable by id: `GetTradeById` falls back to the
6926
+ * archive table on a hot miss.
6927
+ */
6928
+ nextPageToken?: string | null;
6863
6929
  };
6864
6930
  /** @description Single trading pair details. */
6865
6931
  GetTradingPairResponse: {
@@ -7250,29 +7316,50 @@ export interface components {
7250
7316
  */
7251
7317
  balanceId?: string | null;
7252
7318
  };
7319
+ /** @description What the caller has earned at one referral level. */
7320
+ LevelEarnings: {
7321
+ /**
7322
+ * Format: int32
7323
+ * @description Referral level: 1 for direct referees, 2 for their referees, and so on (at most 10).
7324
+ * @example 1
7325
+ */
7326
+ level?: number | null;
7327
+ /**
7328
+ * @description All-time credited earnings at this level, in the reward token's RAW atomic units.
7329
+ * @example 900000
7330
+ */
7331
+ earned?: string | null;
7332
+ };
7253
7333
  ListAllFundingHistoryResponse: {
7254
7334
  records?: components["schemas"]["FundingRecord"][] | null;
7255
- /** Format: uint32 */
7335
+ /**
7336
+ * Format: uint32
7337
+ * @description Settlements matching the filter, bounded by the server count ceiling — see
7338
+ * `totalCapped`. A lower bound when `totalCapped` is true.
7339
+ */
7256
7340
  total?: number | null;
7257
7341
  /** Format: uint32 */
7258
- page?: number | null;
7259
- /** Format: uint32 */
7260
7342
  pageSize?: number | null;
7343
+ /**
7344
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7345
+ * page: this listing is one ordered read, so a page shorter than
7346
+ * `pageSize` proves the walk is exhausted and this is empty.
7347
+ */
7348
+ nextPageToken?: string | null;
7349
+ /**
7350
+ * @description True when MORE than the server ceiling matched, so the count stopped at
7351
+ * the ceiling and `total` is a lower bound.
7352
+ */
7353
+ totalCapped?: boolean | null;
7261
7354
  };
7262
7355
  ListAppBalancesResponse: {
7263
7356
  balances?: components["schemas"]["ApplicationBalance"][] | null;
7264
7357
  /**
7265
7358
  * Format: uint32
7266
- * @description Total matching balances
7359
+ * @description Number of balances matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7267
7360
  * @example 50
7268
7361
  */
7269
7362
  total?: number | null;
7270
- /**
7271
- * Format: uint32
7272
- * @description Current page number
7273
- * @example 1
7274
- */
7275
- page?: number | null;
7276
7363
  /**
7277
7364
  * Format: uint32
7278
7365
  * @description Items per page
@@ -7281,25 +7368,24 @@ export interface components {
7281
7368
  pageSize?: number | null;
7282
7369
  /**
7283
7370
  * Format: uint32
7284
- * @description Total number of pages
7371
+ * @description Number of pages at this pageSize, bounded by the server ceiling — a lower bound when totalCapped is true.
7285
7372
  * @example 3
7286
7373
  */
7287
7374
  totalPages?: number | null;
7288
- };
7289
- ListAppMovementsResponse: {
7290
- movements?: components["schemas"]["ApplicationMovement"][] | null;
7291
7375
  /**
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
7376
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7377
+ * page: this listing is one ordered read, so a page shorter than
7378
+ * `pageSize` proves the walk is exhausted and this is empty.
7295
7379
  */
7296
- total?: number | null;
7380
+ nextPageToken?: string | null;
7297
7381
  /**
7298
- * Format: uint32
7299
- * @description Current page number
7300
- * @example 1
7382
+ * @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.
7383
+ * @example false
7301
7384
  */
7302
- page?: number | null;
7385
+ totalCapped?: boolean | null;
7386
+ };
7387
+ ListAppMovementsResponse: {
7388
+ movements?: components["schemas"]["ApplicationMovement"][] | null;
7303
7389
  /**
7304
7390
  * Format: uint32
7305
7391
  * @description Items per page
@@ -7307,26 +7393,14 @@ export interface components {
7307
7393
  */
7308
7394
  pageSize?: number | null;
7309
7395
  /**
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
7396
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7397
+ * page: this listing is one ordered read, so a page shorter than
7398
+ * `pageSize` proves the walk is exhausted and this is empty.
7313
7399
  */
7314
- totalPages?: number | null;
7400
+ nextPageToken?: string | null;
7315
7401
  };
7316
7402
  ListAppOrdersResponse: {
7317
7403
  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
7404
  /**
7331
7405
  * Format: uint32
7332
7406
  * @description Items per page
@@ -7334,26 +7408,20 @@ export interface components {
7334
7408
  */
7335
7409
  pageSize?: number | null;
7336
7410
  /**
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
7411
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7412
+ * page: this listing is one ordered read, so a page shorter than
7413
+ * `pageSize` proves the walk is exhausted and this is empty.
7340
7414
  */
7341
- totalPages?: number | null;
7415
+ nextPageToken?: string | null;
7342
7416
  };
7343
7417
  ListAppUsersResponse: {
7344
7418
  users?: components["schemas"]["AppUser"][] | null;
7345
7419
  /**
7346
7420
  * Format: uint32
7347
- * @description Total number of users
7421
+ * @description Number of users matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7348
7422
  * @example 50
7349
7423
  */
7350
7424
  total?: number | null;
7351
- /**
7352
- * Format: uint32
7353
- * @description Current page number
7354
- * @example 1
7355
- */
7356
- page?: number | null;
7357
7425
  /**
7358
7426
  * Format: uint32
7359
7427
  * @description Items per page
@@ -7362,10 +7430,21 @@ export interface components {
7362
7430
  pageSize?: number | null;
7363
7431
  /**
7364
7432
  * Format: uint32
7365
- * @description Total number of pages
7433
+ * @description Number of pages at this pageSize, bounded by the server ceiling — a lower bound when totalCapped is true.
7366
7434
  * @example 3
7367
7435
  */
7368
7436
  totalPages?: number | null;
7437
+ /**
7438
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7439
+ * page: this listing is one ordered read, so a page shorter than
7440
+ * `pageSize` proves the walk is exhausted and this is empty.
7441
+ */
7442
+ nextPageToken?: string | null;
7443
+ /**
7444
+ * @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.
7445
+ * @example false
7446
+ */
7447
+ totalCapped?: boolean | null;
7369
7448
  };
7370
7449
  ListBuilderFeeChangesResponse: {
7371
7450
  /** @description Builder-fee changes, newest first. */
@@ -7381,11 +7460,6 @@ export interface components {
7381
7460
  * @description Total payout rows for this application.
7382
7461
  */
7383
7462
  total?: number | null;
7384
- /**
7385
- * Format: uint32
7386
- * @description Current page number.
7387
- */
7388
- page?: number | null;
7389
7463
  /**
7390
7464
  * Format: uint32
7391
7465
  * @description Items per page.
@@ -7396,6 +7470,12 @@ export interface components {
7396
7470
  * @description Total number of pages.
7397
7471
  */
7398
7472
  totalPages?: number | null;
7473
+ /**
7474
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7475
+ * page: this listing is one ordered read, so a page shorter than
7476
+ * `page_size` proves the walk is exhausted and this is empty.
7477
+ */
7478
+ nextPageToken?: string | null;
7399
7479
  };
7400
7480
  ListConditionalOrdersResponse: {
7401
7481
  orders?: components["schemas"]["ConditionalOrder"][] | null;
@@ -7432,27 +7512,34 @@ export interface components {
7432
7512
  };
7433
7513
  ListFundingHistoryResponse: {
7434
7514
  records?: components["schemas"]["FundingRecord"][] | null;
7435
- /** Format: uint32 */
7515
+ /**
7516
+ * Format: uint32
7517
+ * @description Settlements matching the filter, bounded by the server count ceiling — see
7518
+ * `totalCapped`. A lower bound when `totalCapped` is true.
7519
+ */
7436
7520
  total?: number | null;
7437
7521
  /** Format: uint32 */
7438
- page?: number | null;
7439
- /** Format: uint32 */
7440
7522
  pageSize?: number | null;
7523
+ /**
7524
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7525
+ * page: this listing is one ordered read, so a page shorter than
7526
+ * `pageSize` proves the walk is exhausted and this is empty.
7527
+ */
7528
+ nextPageToken?: string | null;
7529
+ /**
7530
+ * @description True when MORE than the server ceiling matched, so the count stopped at
7531
+ * the ceiling and `total` is a lower bound.
7532
+ */
7533
+ totalCapped?: boolean | null;
7441
7534
  };
7442
7535
  ListFundingPaymentsResponse: {
7443
7536
  records?: components["schemas"]["FundingPaymentRecord"][] | null;
7444
7537
  /**
7445
7538
  * 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.
7539
+ * @description Number of funding payments matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7447
7540
  * @example 2
7448
7541
  */
7449
7542
  total?: number | null;
7450
- /**
7451
- * Format: uint32
7452
- * @description Current page number
7453
- * @example 1
7454
- */
7455
- page?: number | null;
7456
7543
  /**
7457
7544
  * Format: uint32
7458
7545
  * @description Items per page
@@ -7461,10 +7548,21 @@ export interface components {
7461
7548
  pageSize?: number | null;
7462
7549
  /**
7463
7550
  * 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.
7551
+ * @description Number of pages at this pageSize, bounded by the server ceiling — a lower bound when totalCapped is true.
7465
7552
  * @example 1
7466
7553
  */
7467
7554
  totalPages?: number | null;
7555
+ /**
7556
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7557
+ * page: this listing is one ordered read, so a page shorter than
7558
+ * `pageSize` proves the walk is exhausted and this is empty.
7559
+ */
7560
+ nextPageToken?: string | null;
7561
+ /**
7562
+ * @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.
7563
+ * @example false
7564
+ */
7565
+ totalCapped?: boolean | null;
7468
7566
  };
7469
7567
  ListLeadTraderClosedTradesResponse: {
7470
7568
  closedTrades?: components["schemas"]["ClosedTrade"][] | null;
@@ -7484,22 +7582,37 @@ export interface components {
7484
7582
  ListManagedMarketAssignmentsResponse: {
7485
7583
  /** @description Expected assignments, including phases currently unable to quote. */
7486
7584
  items?: components["schemas"]["ManagedMarketAssignment"][] | null;
7487
- /** Format: uint32 */
7585
+ /**
7586
+ * Format: uint32
7587
+ * @description Exact: a maker's assignment inventory is a small bounded set.
7588
+ */
7488
7589
  total?: number | null;
7489
7590
  /** Format: uint32 */
7490
- page?: number | null;
7491
- /** Format: uint32 */
7492
7591
  pageSize?: number | null;
7493
7592
  inventoryObservedAt?: string | null;
7593
+ /**
7594
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7595
+ * page: this listing is one ordered read, so a page shorter than
7596
+ * `page_size` proves the walk is exhausted and this is empty.
7597
+ */
7598
+ nextPageToken?: string | null;
7494
7599
  };
7495
7600
  ListMarginAccountsResponse: {
7496
7601
  accounts?: components["schemas"]["MarginAccountSummary"][] | null;
7497
- /** Format: uint32 */
7602
+ /**
7603
+ * Format: uint32
7604
+ * @description Exact: a user's margin accounts and risk buckets are a small bounded set,
7605
+ * counted in memory after the repricing pass.
7606
+ */
7498
7607
  total?: number | null;
7499
7608
  /** Format: uint32 */
7500
- page?: number | null;
7501
- /** Format: uint32 */
7502
7609
  pageSize?: number | null;
7610
+ /**
7611
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7612
+ * page. The whole set is already in memory, so over-fetching is free and an
7613
+ * empty token is the definitive end of the walk.
7614
+ */
7615
+ nextPageToken?: string | null;
7503
7616
  };
7504
7617
  ListMyFollowersResponse: {
7505
7618
  followers?: components["schemas"]["Follower"][] | null;
@@ -7554,12 +7667,6 @@ export interface components {
7554
7667
  * @example 3
7555
7668
  */
7556
7669
  total?: number | null;
7557
- /**
7558
- * Format: uint32
7559
- * @description Current page number
7560
- * @example 1
7561
- */
7562
- page?: number | null;
7563
7670
  /**
7564
7671
  * Format: uint32
7565
7672
  * @description Items per page
@@ -7572,32 +7679,47 @@ export interface components {
7572
7679
  * @example 1
7573
7680
  */
7574
7681
  totalPages?: number | null;
7682
+ /**
7683
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7684
+ * page: this listing is one ordered read, so a page shorter than
7685
+ * `page_size` proves the walk is exhausted and this is empty.
7686
+ */
7687
+ nextPageToken?: string | null;
7575
7688
  };
7576
7689
  ListPositionHistoryResponse: {
7577
7690
  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
7691
  /** Format: uint32 */
7587
7692
  pageSize?: number | null;
7693
+ /**
7694
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7695
+ * page: this listing is one SQL statement with one global ORDER BY, so a
7696
+ * page shorter than `pageSize` proves the walk is exhausted and this is
7697
+ * empty. A non-empty token always has at least one further row behind it.
7698
+ */
7699
+ nextPageToken?: string | null;
7588
7700
  };
7589
7701
  ListPositionsResponse: {
7590
7702
  positions?: components["schemas"]["Position"][] | null;
7591
7703
  /**
7592
7704
  * 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.
7705
+ * @description Number of positions matching the filter, bounded by the server ceiling — a lower bound when totalCapped is true.
7594
7706
  * @example 150
7595
7707
  */
7596
7708
  total?: number | null;
7597
7709
  /** Format: uint32 */
7598
- page?: number | null;
7599
- /** Format: uint32 */
7600
7710
  pageSize?: number | null;
7711
+ /**
7712
+ * @description Cursor for the next page, minted from the last row of an over-fetched
7713
+ * page: this listing is one SQL statement with one global ORDER BY, so a
7714
+ * page shorter than `pageSize` proves the walk is exhausted and this is
7715
+ * empty. A non-empty token always has at least one further row behind it.
7716
+ */
7717
+ nextPageToken?: string | null;
7718
+ /**
7719
+ * @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.
7720
+ * @example false
7721
+ */
7722
+ totalCapped?: boolean | null;
7601
7723
  };
7602
7724
  ListSubAccountsResponse: {
7603
7725
  subAccounts?: components["schemas"]["SubAccount"][] | null;
@@ -7733,6 +7855,9 @@ export interface components {
7733
7855
  * bucket cannot be released at all, and the parent margin account is
7734
7856
  * charged at most its allocation, the loss past it being the insurance
7735
7857
  * fund's.
7858
+ *
7859
+ * Printed truncated toward zero at the quote asset's precision, so the
7860
+ * printed amount itself is always accepted.
7736
7861
  */
7737
7862
  withdrawableCollateral?: string | null;
7738
7863
  totalPositionNotional?: string | null;
@@ -7788,7 +7913,8 @@ export interface components {
7788
7913
  *
7789
7914
  * Present only on risk-bucket summary rows served from a live risk engine
7790
7915
  * snapshot; absent on parent rows and on persisted-fallback reads, where
7791
- * neither of the gate's terms is reconstructable.
7916
+ * neither of the gate's terms is reconstructable. Printed truncated toward
7917
+ * zero at the quote asset's precision, like `withdrawable_collateral`.
7792
7918
  */
7793
7919
  availableOrderCollateral?: string | null;
7794
7920
  /**
@@ -8172,10 +8298,9 @@ export interface components {
8172
8298
  * realized PnL and funding, less what risk buckets have allocated:
8173
8299
  * `min(net deposits + settled realized PnL - bucket allocations,
8174
8300
  * 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.
8301
+ * bound the engine's gates actually enforce. The same figure as
8302
+ * `MarginAccountSummary.withdrawable_collateral`: both surfaces truncate it
8303
+ * toward zero at the quote asset's precision.
8179
8304
  *
8180
8305
  * Size transfers-out, withdrawals, and new isolated/first-use positions
8181
8306
  * from this field; `parent_available_collateral` remains the trading-margin
@@ -8234,10 +8359,8 @@ export interface components {
8234
8359
  *
8235
8360
  * This is the largest accepted transfer-out, and every smaller amount is
8236
8361
  * 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).
8362
+ * whose realized loss has used up its allocation. The same figure as the
8363
+ * risk-bucket rows' `MarginAccountSummary.withdrawable_collateral`.
8241
8364
  */
8242
8365
  withdrawableCollateral?: string | null;
8243
8366
  /**
@@ -8488,6 +8611,34 @@ export interface components {
8488
8611
  * @example 918342
8489
8612
  */
8490
8613
  version?: number | null;
8614
+ /**
8615
+ * @description RFC 3339 instant at which this position OPENED: the fill that took its
8616
+ * exposure from zero to non-zero. Time held is now minus opened_at for an
8617
+ * OPEN position, and updated_at minus opened_at for a terminal one. It never
8618
+ * changes for the life of the position id; a flip closes the position and
8619
+ * opens a new one, with a new id and its own opened_at.
8620
+ *
8621
+ * Served from the matching engine's record of the opening fill while the
8622
+ * engine holds the position, and from the persisted row otherwise. The row
8623
+ * is written from the same fill's durable stamp, which comes from the
8624
+ * sequencer's non-decreasing stamp clock rather than the engine's wall
8625
+ * clock. The two readings normally agree to within one sequencer step, but
8626
+ * while the stamp clock is held ahead of a lagging host clock they differ by
8627
+ * that lead (`matching_engine_stamp_clock_live_lead_ms`), so a position's
8628
+ * value can move by it when the engine restarts and re-reads the row. Clamp
8629
+ * a computed time held at zero.
8630
+ *
8631
+ * Absent when the opening instant is unknown, never filled with the read
8632
+ * instant. Positions opened before this field existed carry the persisted
8633
+ * row's value, which can trail the opening fill by the persistence lag
8634
+ * where the fill could not be recovered.
8635
+ *
8636
+ * Not versioned, and not guaranteed constant at a given `version`: a
8637
+ * one-off operator correction can move it earlier without advancing the
8638
+ * version. Take it from the newest payload rather than skipping it on an
8639
+ * equal version.
8640
+ */
8641
+ openedAt?: string | null;
8491
8642
  };
8492
8643
  PositionHistoryEvent: {
8493
8644
  id?: string | null;
@@ -8797,7 +8948,7 @@ export interface components {
8797
8948
  source?: string | null;
8798
8949
  /**
8799
8950
  * Format: int32
8800
- * @description Referral level the caller earns from this source at: 1 (direct), 2, or 3.
8951
+ * @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
8952
  * @example 1
8802
8953
  */
8803
8954
  level?: number | null;
@@ -8830,6 +8981,10 @@ export interface components {
8830
8981
  * ever pays in more than one reward token, atomic units across tokens are not
8831
8982
  * additive, so read the per-token `earnings_by_source` rows for a correct
8832
8983
  * breakdown.
8984
+ *
8985
+ * `by_level` covers every level with earnings. `level1_earned`,
8986
+ * `level2_earned` and `level3_earned` are deprecated: they carry levels 1 to 3
8987
+ * for older clients and say nothing about deeper levels.
8833
8988
  */
8834
8989
  ReferralEarningsSummary: {
8835
8990
  /**
@@ -8838,20 +8993,25 @@ export interface components {
8838
8993
  */
8839
8994
  totalEarned?: string | null;
8840
8995
  /**
8841
- * @description Total earned from direct (L1) referees, in RAW atomic units.
8996
+ * @deprecated
8997
+ * @description DEPRECATED: use `byLevel`. Total earned from direct (L1) referees, in RAW atomic units.
8842
8998
  * @example 900000
8843
8999
  */
8844
9000
  level1Earned?: string | null;
8845
9001
  /**
8846
- * @description Total earned from L2 downline, in RAW atomic units.
9002
+ * @deprecated
9003
+ * @description DEPRECATED: use `byLevel`. Total earned from L2 downline, in RAW atomic units.
8847
9004
  * @example 400000
8848
9005
  */
8849
9006
  level2Earned?: string | null;
8850
9007
  /**
8851
- * @description Total earned from L3 downline, in RAW atomic units.
9008
+ * @deprecated
9009
+ * @description DEPRECATED: use `byLevel`. Total earned from L3 downline, in RAW atomic units.
8852
9010
  * @example 100000
8853
9011
  */
8854
9012
  level3Earned?: string | null;
9013
+ /** @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. */
9014
+ byLevel?: components["schemas"]["LevelEarnings"][] | null;
8855
9015
  };
8856
9016
  /** @description A single reward the caller has earned, one row per referred trade × level. */
8857
9017
  ReferralRewardEntry: {
@@ -8862,7 +9022,7 @@ export interface components {
8862
9022
  source?: string | null;
8863
9023
  /**
8864
9024
  * Format: int32
8865
- * @description Referral level this reward was paid at: 1 (direct, 30%), 2 (15%), or 3 (5%).
9025
+ * @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
9026
  * @example 1
8867
9027
  */
8868
9028
  level?: number | null;
@@ -8903,7 +9063,7 @@ export interface components {
8903
9063
  display?: string | null;
8904
9064
  /**
8905
9065
  * Format: int32
8906
- * @description Depth below the caller: 1 (the caller referred this wallet), 2, or 3.
9066
+ * @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
9067
  */
8908
9068
  level?: number | null;
8909
9069
  /** @description Wallet address of the referrer of this node — the caller for a level-1 node. */
@@ -8915,7 +9075,7 @@ export interface components {
8915
9075
  referredAt?: string | null;
8916
9076
  /**
8917
9077
  * 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.
9078
+ * @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
9079
  */
8920
9080
  refereeCount?: number | null;
8921
9081
  /** @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 +9092,7 @@ export interface components {
8932
9092
  display?: string | null;
8933
9093
  /**
8934
9094
  * Format: int32
8935
- * @description How far above the caller this ancestor is: 1 (the caller's direct referrer), 2, or 3.
9095
+ * @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
9096
  */
8937
9097
  level?: number | null;
8938
9098
  };
@@ -9081,12 +9241,15 @@ export interface components {
9081
9241
  */
9082
9242
  maintenanceMarginRatio?: string | null;
9083
9243
  /**
9084
- * @deprecated
9085
- * @description DEPRECATED compatibility alias. This value is a maximum absolute base-asset quantity, not a notional. Use maxPositionSize.
9244
+ * @description The most USD notional a position may hold at this bracket's max leverage: the next bracket's lowerBoundNotional, or the market's position cap on the top bracket. A position is valued at the order's price. Below the top bracket the cap is exclusive, since a notional at the next bound already sits in the next bracket. An order at a given leverage may take its position up to the cap of the highest bracket whose maxLeverage allows that leverage.
9245
+ * @example 100000000
9086
9246
  */
9087
9247
  maxPositionNotional?: string | null;
9088
- /** @description Maximum authoritative absolute position size in base-asset quantity. A market-wide cap, repeated on every tier rather than varying per bracket. */
9089
- maxPositionSize?: string | null;
9248
+ /**
9249
+ * @deprecated
9250
+ * @description DEPRECATED and no longer set: positions are capped in notional per bracket. Use maxPositionNotional.
9251
+ */
9252
+ maxPositionSize?: string | null;
9090
9253
  /**
9091
9254
  * Format: uint32
9092
9255
  * @description 1-based bracket index within the market's ladder; 1 is the lowest bracket.
@@ -9999,6 +10162,11 @@ export interface components {
9999
10162
  * @example USDC
10000
10163
  */
10001
10164
  quoteAssetName?: string | null;
10165
+ /**
10166
+ * @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
10167
+ * @example false
10168
+ */
10169
+ isolatedOnly?: boolean | null;
10002
10170
  };
10003
10171
  /**
10004
10172
  * @description Trailing stop leg (0XM-2827). Reduce-only MARKET close whose trigger trails
@@ -10067,7 +10235,8 @@ export interface components {
10067
10235
  /**
10068
10236
  * @description The largest amount a further transfer-out will accept after this one.
10069
10237
  * See `MarginAccountSummary.withdrawable_collateral`: this is an
10070
- * allocation-bounded figure, not clamped equity headroom.
10238
+ * allocation-bounded figure, not clamped equity headroom. Truncated toward
10239
+ * zero at the collateral asset's precision.
10071
10240
  */
10072
10241
  newWithdrawableCollateral?: string | null;
10073
10242
  strategyKey?: string | null;
@@ -10076,6 +10245,11 @@ export interface components {
10076
10245
  asset?: string | null;
10077
10246
  amount?: string | null;
10078
10247
  };
10248
+ TransferCollateralFromSubAccountRequest: {
10249
+ /** @description The caller's sub-account the collateral leaves. */
10250
+ marginAccountId?: string | null;
10251
+ amount?: string | null;
10252
+ };
10079
10253
  TransferCollateralRequest: {
10080
10254
  /** @description Collateral asset symbol or address. */
10081
10255
  asset?: string | null;
@@ -10121,7 +10295,8 @@ export interface components {
10121
10295
  /**
10122
10296
  * @description The largest amount a further transfer-out will accept after this one.
10123
10297
  * See `MarginAccountSummary.withdrawable_collateral`: this is an
10124
- * allocation-bounded figure, not clamped equity headroom.
10298
+ * allocation-bounded figure, not clamped equity headroom. Truncated toward
10299
+ * zero at the collateral asset's precision.
10125
10300
  */
10126
10301
  newWithdrawableCollateral?: string | null;
10127
10302
  strategyKey?: string | null;
@@ -10207,6 +10382,11 @@ export interface components {
10207
10382
  */
10208
10383
  marginAccountId?: string | null;
10209
10384
  };
10385
+ TransferCollateralToSubAccountRequest: {
10386
+ /** @description The caller's sub-account that receives the collateral. */
10387
+ marginAccountId?: string | null;
10388
+ amount?: string | null;
10389
+ };
10210
10390
  TransferRewardsRequest: {
10211
10391
  /**
10212
10392
  * @description Reward token contract address (0x-prefixed) to transfer.
@@ -10770,10 +10950,26 @@ export interface operations {
10770
10950
  get_user_balances: {
10771
10951
  parameters: {
10772
10952
  query?: {
10773
- /** @description Page number (1-indexed) */
10774
- page?: number;
10775
- /** @description Items per page (max 100) */
10953
+ /** @description Items per page (max 1000) */
10776
10954
  pageSize?: number;
10955
+ /**
10956
+ * @description Pagination cursor with two states:
10957
+ * - Omitted or empty string (""): start a cursor walk with no prior
10958
+ * position, from the lowest token address.
10959
+ * - Non-empty: an opaque cursor from a previous response's
10960
+ * `nextPageToken`; results resume immediately after that position.
10961
+ *
10962
+ * This listing has no database page to walk: it reads every balance row,
10963
+ * overlays the matching engine's authoritative amounts (which can add rows
10964
+ * the projection has not written yet and drop rows the engine has zeroed),
10965
+ * and pages that in-memory set. The walk therefore seeks by KEY on
10966
+ * `(token, asset_id)` — immutable, present on every row including a
10967
+ * live-only one — rather than by index, so a balance that appears or
10968
+ * vanishes mid-walk no longer shifts the rows behind it across the resume
10969
+ * point and duplicate or skipped rows. `total` and `totalPages` are exact:
10970
+ * the set is bounded by the asset universe, so there is nothing to cap.
10971
+ */
10972
+ pageToken?: string;
10777
10973
  };
10778
10974
  header?: never;
10779
10975
  path?: never;
@@ -10885,10 +11081,28 @@ export interface operations {
10885
11081
  tradingPairId?: string;
10886
11082
  positionId?: string;
10887
11083
  marginAccountId?: string;
10888
- /** @description Page number (1-indexed) */
10889
- page?: number;
10890
- /** @description Items per page (max 100) */
11084
+ /** @description Items per page (max 1000) */
10891
11085
  pageSize?: number;
11086
+ /**
11087
+ * @description Pagination cursor with two states:
11088
+ * - Omitted or empty string (""): start a cursor walk with no prior
11089
+ * position, from the newest payment.
11090
+ * - Non-empty: an opaque cursor from a previous response's
11091
+ * `nextPageToken`; results resume immediately after that position.
11092
+ *
11093
+ * The walk seeks on `(created_at, id)` descending. Not `period_end`, which
11094
+ * the removed page-number mode led its sort with: that column is nullable
11095
+ * and the risk engine leaves it unset when a payment carries no window,
11096
+ * while `created_at` is always stamped (it falls back to the settlement
11097
+ * instant). The `id` tie-break is new — the removed order had none, so a
11098
+ * page boundary inside one funding window could already repeat or drop a
11099
+ * payment.
11100
+ *
11101
+ * `total` and `totalPages` are populated — bounded by the server count
11102
+ * ceiling, see `totalCapped`. Filters must match the request that produced
11103
+ * the token, or the request is rejected 400.
11104
+ */
11105
+ pageToken?: string;
10892
11106
  };
10893
11107
  header?: never;
10894
11108
  path?: never;
@@ -11396,9 +11610,7 @@ export interface operations {
11396
11610
  get_user_movements: {
11397
11611
  parameters: {
11398
11612
  query?: {
11399
- /** @description Page number (1-indexed) */
11400
- page?: number;
11401
- /** @description Items per page (max 100) */
11613
+ /** @description Items per page (max 1000) */
11402
11614
  pageSize?: number;
11403
11615
  /** @description Transaction type */
11404
11616
  transactionType?: "DEPOSIT" | "WITHDRAWAL" | "TRADE" | "FEE" | "FUNDING" | "LIQUIDATION" | "INTEREST" | "REWARD" | "CHAIN_SYNC";
@@ -11408,6 +11620,19 @@ export interface operations {
11408
11620
  assetId?: string;
11409
11621
  /** @description Sort direction for createdAt */
11410
11622
  orderBy?: "ASC" | "DESC";
11623
+ /**
11624
+ * @description Pagination cursor with two states:
11625
+ * - Omitted or empty string (""): start a cursor walk with no prior
11626
+ * position, from the newest row (or the oldest, when `orderBy` is ASC).
11627
+ * - Non-empty: an opaque cursor from a previous response's
11628
+ * `nextPageToken`; results resume immediately after that position.
11629
+ *
11630
+ * Every walk covers the ledger and funding arms merged. `total` and
11631
+ * `totalPages` are populated — bounded by the server count ceiling, see
11632
+ * `totalCapped`. Filters and `orderBy` must match the request that produced
11633
+ * the token, or the request is rejected 400.
11634
+ */
11635
+ pageToken?: string;
11411
11636
  };
11412
11637
  header?: never;
11413
11638
  path?: never;
@@ -11874,7 +12099,7 @@ export interface operations {
11874
12099
  * - Omitted or empty string (""): start a cursor walk with no prior
11875
12100
  * position, from the newest row.
11876
12101
  * - Non-empty: an opaque cursor from a previous response's
11877
- * `next_page_token`; results resume immediately after that position.
12102
+ * `nextPageToken`; results resume immediately after that position.
11878
12103
  *
11879
12104
  * Every walk covers full trade history — hot and archived rows merged. The
11880
12105
  * response carries no item count: this listing's table is too large to count
@@ -11929,15 +12154,34 @@ export interface operations {
11929
12154
  };
11930
12155
  list_application_balances: {
11931
12156
  parameters: {
11932
- query?: {
11933
- /** @description Page number (1-indexed) */
11934
- page?: number;
11935
- /** @description Items per page (max 100) */
12157
+ query: {
12158
+ /** @description Items per page (max 1000) */
11936
12159
  pageSize?: number;
11937
12160
  /** @description User identifier (UUID) */
11938
12161
  userId?: string;
11939
12162
  /** @description Asset identifier (UUID) */
11940
12163
  assetId?: string;
12164
+ /**
12165
+ * @description Pagination cursor with two states:
12166
+ * - Omitted or empty string (""): start a cursor walk with no prior
12167
+ * position.
12168
+ * - Non-empty: an opaque cursor from a previous response's
12169
+ * `nextPageToken`; results resume immediately after that position.
12170
+ *
12171
+ * Ordered by balance id ascending. NOT by `updated_at`, which the removed
12172
+ * offset mode sorted on: that column changes on every balance movement, so
12173
+ * a walk over it could repeat or skip rows with no concurrent insert at
12174
+ * all.
12175
+ *
12176
+ * `total` and `totalPages` are populated — bounded by the server count
12177
+ * ceiling, see `totalCapped`.
12178
+ *
12179
+ * Filters must match the request that produced the token, or the request
12180
+ * is rejected 400.
12181
+ */
12182
+ pageToken?: string;
12183
+ /** @description Application client ID */
12184
+ clientId: string;
11941
12185
  };
11942
12186
  header?: never;
11943
12187
  path?: never;
@@ -11954,15 +12198,22 @@ export interface operations {
11954
12198
  "application/json": components["schemas"]["ListAppBalancesResponse"];
11955
12199
  };
11956
12200
  };
11957
- /** @description Bad request */
12201
+ /** @description Bad request (missing client_id, invalid filter or page token) */
11958
12202
  400: {
11959
12203
  headers: {
11960
12204
  [name: string]: unknown;
11961
12205
  };
11962
12206
  content?: never;
11963
12207
  };
11964
- /** @description Unauthorized - Invalid or missing x-server-key */
11965
- 401: {
12208
+ /** @description No active application has this client_id */
12209
+ 404: {
12210
+ headers: {
12211
+ [name: string]: unknown;
12212
+ };
12213
+ content?: never;
12214
+ };
12215
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12216
+ 429: {
11966
12217
  headers: {
11967
12218
  [name: string]: unknown;
11968
12219
  };
@@ -12034,10 +12285,8 @@ export interface operations {
12034
12285
  };
12035
12286
  list_application_movements: {
12036
12287
  parameters: {
12037
- query?: {
12038
- /** @description Page number (1-indexed) */
12039
- page?: number;
12040
- /** @description Items per page (max 100) */
12288
+ query: {
12289
+ /** @description Items per page (max 1000) */
12041
12290
  pageSize?: number;
12042
12291
  /** @description User identifier (UUID) */
12043
12292
  userId?: string;
@@ -12047,6 +12296,23 @@ export interface operations {
12047
12296
  entryType?: "CREDIT" | "DEBIT" | "LOCK" | "UNLOCK" | "FEE";
12048
12297
  /** @description Asset identifier (UUID) */
12049
12298
  assetId?: string;
12299
+ /**
12300
+ * @description Pagination cursor with two states:
12301
+ * - Omitted or empty string (""): start a cursor walk with no prior
12302
+ * position, from the newest movement.
12303
+ * - Non-empty: an opaque cursor from a previous response's
12304
+ * `nextPageToken`; results resume immediately after that position.
12305
+ *
12306
+ * The response carries no item count: `user_ledger` is too large to count
12307
+ * behind a filter. A movement with no recorded timestamp is not listed —
12308
+ * the column is nullable, and a NULL has no position in the sort key.
12309
+ *
12310
+ * Filters must match the request that produced the token, or the request
12311
+ * is rejected 400.
12312
+ */
12313
+ pageToken?: string;
12314
+ /** @description Application client ID */
12315
+ clientId: string;
12050
12316
  };
12051
12317
  header?: never;
12052
12318
  path?: never;
@@ -12063,15 +12329,22 @@ export interface operations {
12063
12329
  "application/json": components["schemas"]["ListAppMovementsResponse"];
12064
12330
  };
12065
12331
  };
12066
- /** @description Bad request */
12332
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12067
12333
  400: {
12068
12334
  headers: {
12069
12335
  [name: string]: unknown;
12070
12336
  };
12071
12337
  content?: never;
12072
12338
  };
12073
- /** @description Unauthorized - Invalid or missing x-server-key */
12074
- 401: {
12339
+ /** @description No active application has this client_id */
12340
+ 404: {
12341
+ headers: {
12342
+ [name: string]: unknown;
12343
+ };
12344
+ content?: never;
12345
+ };
12346
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12347
+ 429: {
12075
12348
  headers: {
12076
12349
  [name: string]: unknown;
12077
12350
  };
@@ -12088,10 +12361,8 @@ export interface operations {
12088
12361
  };
12089
12362
  list_application_orders: {
12090
12363
  parameters: {
12091
- query?: {
12092
- /** @description Page number (1-indexed) */
12093
- page?: number;
12094
- /** @description Items per page (max 100) */
12364
+ query: {
12365
+ /** @description Items per page (max 1000) */
12095
12366
  pageSize?: number;
12096
12367
  /** @description Order status (single value or comma-separated list) */
12097
12368
  status?: string;
@@ -12103,6 +12374,23 @@ export interface operations {
12103
12374
  side?: "BUY" | "SELL";
12104
12375
  /** @description Order type */
12105
12376
  orderType?: "LIMIT" | "MARKET" | "STOP_LOSS" | "TAKE_PROFIT" | "STOP_LIMIT" | "TRAILING_STOP";
12377
+ /**
12378
+ * @description Pagination cursor with two states:
12379
+ * - Omitted or empty string (""): start a cursor walk with no prior
12380
+ * position.
12381
+ * - Non-empty: an opaque cursor from a previous response's
12382
+ * `nextPageToken`; results resume immediately after that position.
12383
+ *
12384
+ * Every walk covers full order history — hot and archived rows merged.
12385
+ * The response carries no item count: `orders_all` is too large to count
12386
+ * behind a filter.
12387
+ *
12388
+ * Filters must match the request that produced the token, or the request
12389
+ * is rejected 400.
12390
+ */
12391
+ pageToken?: string;
12392
+ /** @description Application client ID */
12393
+ clientId: string;
12106
12394
  };
12107
12395
  header?: never;
12108
12396
  path?: never;
@@ -12119,15 +12407,22 @@ export interface operations {
12119
12407
  "application/json": components["schemas"]["ListAppOrdersResponse"];
12120
12408
  };
12121
12409
  };
12122
- /** @description Bad request */
12410
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12123
12411
  400: {
12124
12412
  headers: {
12125
12413
  [name: string]: unknown;
12126
12414
  };
12127
12415
  content?: never;
12128
12416
  };
12129
- /** @description Unauthorized - Invalid or missing x-server-key */
12130
- 401: {
12417
+ /** @description No active application has this client_id */
12418
+ 404: {
12419
+ headers: {
12420
+ [name: string]: unknown;
12421
+ };
12422
+ content?: never;
12423
+ };
12424
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12425
+ 429: {
12131
12426
  headers: {
12132
12427
  [name: string]: unknown;
12133
12428
  };
@@ -12144,8 +12439,10 @@ export interface operations {
12144
12439
  };
12145
12440
  get_application_stats: {
12146
12441
  parameters: {
12147
- query?: {
12442
+ query: {
12148
12443
  since?: string;
12444
+ /** @description Application client ID */
12445
+ clientId: string;
12149
12446
  };
12150
12447
  header?: never;
12151
12448
  path?: never;
@@ -12162,15 +12459,22 @@ export interface operations {
12162
12459
  "application/json": components["schemas"]["GetAppStatsResponse"];
12163
12460
  };
12164
12461
  };
12165
- /** @description Bad request */
12462
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12166
12463
  400: {
12167
12464
  headers: {
12168
12465
  [name: string]: unknown;
12169
12466
  };
12170
12467
  content?: never;
12171
12468
  };
12172
- /** @description Unauthorized - Invalid or missing x-server-key */
12173
- 401: {
12469
+ /** @description No active application has this client_id */
12470
+ 404: {
12471
+ headers: {
12472
+ [name: string]: unknown;
12473
+ };
12474
+ content?: never;
12475
+ };
12476
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12477
+ 429: {
12174
12478
  headers: {
12175
12479
  [name: string]: unknown;
12176
12480
  };
@@ -12188,15 +12492,34 @@ export interface operations {
12188
12492
  list_application_users: {
12189
12493
  parameters: {
12190
12494
  query: {
12191
- /** @description Page number (1-indexed) */
12192
- page?: number;
12193
- /** @description Items per page (max 100) */
12495
+ /** @description Items per page (max 1000) */
12194
12496
  pageSize?: number;
12195
12497
  isActive?: boolean;
12196
12498
  /** @description Account type filter */
12197
12499
  accountType?: "master" | "sub";
12198
12500
  /** @description Wallet address */
12199
12501
  address: string;
12502
+ /**
12503
+ * @description Pagination cursor with two states:
12504
+ * - Omitted or empty string (""): start a cursor walk with no prior
12505
+ * position.
12506
+ * - Non-empty: an opaque cursor from a previous response's
12507
+ * `nextPageToken`; results resume immediately after that position.
12508
+ *
12509
+ * Ordered by user id ascending, NOT newest-first: `users.created_at` is
12510
+ * nullable, so it cannot be a total keyset key, and excluding the rows
12511
+ * without one would hide users from the listing an application
12512
+ * reconciles against.
12513
+ *
12514
+ * `total` and `totalPages` are populated — bounded by the server count
12515
+ * ceiling, see `totalCapped`.
12516
+ *
12517
+ * Filters must match the request that produced the token, or the request
12518
+ * is rejected 400.
12519
+ */
12520
+ pageToken?: string;
12521
+ /** @description Application client ID */
12522
+ clientId: string;
12200
12523
  };
12201
12524
  header?: never;
12202
12525
  path?: never;
@@ -12213,15 +12536,22 @@ export interface operations {
12213
12536
  "application/json": components["schemas"]["ListAppUsersResponse"];
12214
12537
  };
12215
12538
  };
12216
- /** @description Bad request */
12539
+ /** @description Bad request (missing client_id, invalid filter or page token) */
12217
12540
  400: {
12218
12541
  headers: {
12219
12542
  [name: string]: unknown;
12220
12543
  };
12221
12544
  content?: never;
12222
12545
  };
12223
- /** @description Unauthorized - Invalid or missing x-server-key */
12224
- 401: {
12546
+ /** @description No active application has this client_id */
12547
+ 404: {
12548
+ headers: {
12549
+ [name: string]: unknown;
12550
+ };
12551
+ content?: never;
12552
+ };
12553
+ /** @description Public read rate limit exceeded for this client IP; retry after the interval in details.retryAfter */
12554
+ 429: {
12225
12555
  headers: {
12226
12556
  [name: string]: unknown;
12227
12557
  };
@@ -12501,7 +12831,7 @@ export interface operations {
12501
12831
  };
12502
12832
  content?: never;
12503
12833
  };
12504
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12834
+ /** @description Refused: neither the revenue share nor builder fees are switched on, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12505
12835
  403: {
12506
12836
  headers: {
12507
12837
  [name: string]: unknown;
@@ -12571,7 +12901,7 @@ export interface operations {
12571
12901
  };
12572
12902
  content?: never;
12573
12903
  };
12574
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12904
+ /** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12575
12905
  403: {
12576
12906
  headers: {
12577
12907
  [name: string]: unknown;
@@ -12619,7 +12949,7 @@ export interface operations {
12619
12949
  };
12620
12950
  content?: never;
12621
12951
  };
12622
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12952
+ /** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12623
12953
  403: {
12624
12954
  headers: {
12625
12955
  [name: string]: unknown;
@@ -12645,10 +12975,48 @@ export interface operations {
12645
12975
  list_buildercode_payouts: {
12646
12976
  parameters: {
12647
12977
  query?: {
12648
- /** @description Page number (1-indexed) */
12649
- page?: number;
12650
- /** @description Items per page (max 100) */
12978
+ /** @description Items per page (max 1000) */
12651
12979
  pageSize?: number;
12980
+ /**
12981
+ * @description Pagination cursor with two states:
12982
+ * - Omitted or empty string (""): start a cursor walk with no prior
12983
+ * position, from the newest credit.
12984
+ * - Non-empty: an opaque cursor from a previous response's
12985
+ * `next_page_token`; results resume immediately after that position.
12986
+ *
12987
+ * The walk seeks on `(created_at, id)` descending, served by
12988
+ * `idx_buildercode_payouts_application_created_id`, whose leading key is the
12989
+ * caller's own application and whose remaining keys are this seek's, both
12990
+ * descending. Both key columns are NOT NULL and fixed for a credit's
12991
+ * lifetime. (Spelled without the column list on purpose: the read contract
12992
+ * test asserts this request message never mentions a caller-selected
12993
+ * identity.)
12994
+ *
12995
+ * This REPLACES the removed mode's `(sequence, sequence_ordinal, created_at,
12996
+ * id)` order, whose two leading columns are nullable — no backfill exists
12997
+ * for credits written before they did — and a nullable leading key cannot be
12998
+ * a total cursor key: the NULL rows sort together at one end, and a seek
12999
+ * through them would need a COALESCE no index covers.
13000
+ *
13001
+ * ORDERING CHANGE, not just a pagination change. The new key is total and
13002
+ * stable — a page can neither skip nor duplicate a credit — but it is NOT
13003
+ * chronological inside one persistor batch. `created_at` defaults to `NOW()`,
13004
+ * which is transaction-start time, so every credit one batch writes shares an
13005
+ * identical timestamp; the `id` tie-break defaults to `gen_random_uuid()`,
13006
+ * which the persistor leaves alone. So within a batch the order is arbitrary
13007
+ * and a LATER fill can be listed ahead of an earlier one. The removed order
13008
+ * led with `sequence` and `sequence_ordinal` precisely because those carry
13009
+ * the engine's fill order, and one entry routinely holds several credits (a
13010
+ * taker sweeping N makers, or a flattened `BatchCreateOrders`). Preserving
13011
+ * fill chronology would need those columns backfilled first, which is not
13012
+ * possible for credits written before they existed. Across batches the order
13013
+ * is still newest-first.
13014
+ *
13015
+ * `total` and `total_pages` are populated and exact, and count the rows the
13016
+ * `kind` filter selects. Filters must match the request that produced the
13017
+ * token, or the request is rejected 400.
13018
+ */
13019
+ pageToken?: string;
12652
13020
  /** @description Only return BuilderCodes payouts of this payout kind: REVENUE_SHARE (the frontend's share of Monaco's fee) or BUILDER_FEE (ordinary builder fees charged to takers and credited to enrolled applications). Omit for every kind. */
12653
13021
  kind?: "REVENUE_SHARE" | "BUILDER_FEE";
12654
13022
  };
@@ -12681,7 +13049,7 @@ export interface operations {
12681
13049
  };
12682
13050
  content?: never;
12683
13051
  };
12684
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
13052
+ /** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12685
13053
  403: {
12686
13054
  headers: {
12687
13055
  [name: string]: unknown;
@@ -12729,7 +13097,7 @@ export interface operations {
12729
13097
  };
12730
13098
  content?: never;
12731
13099
  };
12732
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
13100
+ /** @description Refused: the caller is delegated or is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12733
13101
  403: {
12734
13102
  headers: {
12735
13103
  [name: string]: unknown;
@@ -12777,7 +13145,7 @@ export interface operations {
12777
13145
  };
12778
13146
  content?: never;
12779
13147
  };
12780
- /** @description Refused: BuilderCodes is disabled or the caller is delegated (gRPC: PERMISSION_DENIED) */
13148
+ /** @description Refused: the caller is delegated (gRPC: PERMISSION_DENIED) */
12781
13149
  403: {
12782
13150
  headers: {
12783
13151
  [name: string]: unknown;
@@ -12829,7 +13197,7 @@ export interface operations {
12829
13197
  };
12830
13198
  content?: never;
12831
13199
  };
12832
- /** @description Refused: BuilderCodes is not enabled, or the caller is a delegated-agent session (gRPC: PERMISSION_DENIED) */
13200
+ /** @description Refused: the caller is a delegated-agent session (gRPC: PERMISSION_DENIED) */
12833
13201
  403: {
12834
13202
  headers: {
12835
13203
  [name: string]: unknown;
@@ -14377,10 +14745,24 @@ export interface operations {
14377
14745
  list_managed_market_assignments: {
14378
14746
  parameters: {
14379
14747
  query?: {
14380
- /** @description Page number (1-indexed) */
14381
- page?: number;
14382
- /** @description Items per page (max 100) */
14748
+ /** @description Items per page (max 1000) */
14383
14749
  pageSize?: number;
14750
+ /**
14751
+ * @description Pagination cursor with two states:
14752
+ * - Omitted or empty string (""): start a cursor walk with no prior
14753
+ * position, from the oldest assignment.
14754
+ * - Non-empty: an opaque cursor from a previous response's
14755
+ * `next_page_token`; results resume immediately after that position.
14756
+ *
14757
+ * The walk seeks on `(created_at, id)` ascending — the order this listing
14758
+ * already read in, and the order
14759
+ * `idx_market_launch_maker_inventory (maker_user_id, maker_application_id,
14760
+ * created_at, id)` is built for, so the seek stays an index scan. Both
14761
+ * columns are NOT NULL and fixed for a launch's lifetime. `total` is
14762
+ * populated and exact: a maker's assignment inventory is a small bounded
14763
+ * set.
14764
+ */
14765
+ pageToken?: string;
14384
14766
  };
14385
14767
  header?: never;
14386
14768
  path?: never;
@@ -14475,9 +14857,7 @@ export interface operations {
14475
14857
  list_margin_accounts: {
14476
14858
  parameters: {
14477
14859
  query?: {
14478
- /** @description Page number (1-indexed) */
14479
- page?: number;
14480
- /** @description Items per page (max 100) */
14860
+ /** @description Items per page (max 1000) */
14481
14861
  pageSize?: number;
14482
14862
  /**
14483
14863
  * @description Keep only risk-bucket rows in this state (see `risk_bucket_state`). A
@@ -14486,6 +14866,34 @@ export interface operations {
14486
14866
  state?: string;
14487
14867
  /** @description Trading pair identifier (UUID) */
14488
14868
  tradingPairId?: string;
14869
+ /**
14870
+ * @description Pagination cursor with two states:
14871
+ * - Omitted or empty string (""): start a cursor walk with no prior
14872
+ * position, from the lowest margin account id.
14873
+ * - Non-empty: an opaque cursor from a previous response's
14874
+ * `nextPageToken`; results resume immediately after that position.
14875
+ *
14876
+ * This listing has no database page to walk: one row is a margin account
14877
+ * and one row is a risk bucket, each repriced against live marks and the
14878
+ * engine's bounds, so the set is built in memory and paged there. The walk
14879
+ * seeks by KEY on
14880
+ * `(margin_account_id, trading_pair_id, risk_bucket_id, strategy_key)` —
14881
+ * every component immutable for the row's lifetime, the parent row sorting
14882
+ * ahead of its buckets — rather than by index, so a bucket that opens or
14883
+ * closes mid-walk no longer shifts the rows behind it across the resume
14884
+ * point. The strategy key is part of the key because an auto bucket the
14885
+ * engine has not materialized yet carries no `risk_bucket_id`, and one
14886
+ * account and pair can hold several strategies; such a row sorts under the
14887
+ * id its bucket will carry once the engine projects it, derived from the
14888
+ * account and pair, so provisioning completing mid-walk cannot move the row
14889
+ * across the resume point and serve the same risk bucket twice. `total` is
14890
+ * exact: a user's accounts and buckets are a small bounded set, counted in
14891
+ * memory.
14892
+ *
14893
+ * Filters must match the request that produced the token, or the request is
14894
+ * rejected 400.
14895
+ */
14896
+ pageToken?: string;
14489
14897
  };
14490
14898
  header?: never;
14491
14899
  path?: never;
@@ -14625,10 +15033,21 @@ export interface operations {
14625
15033
  parameters: {
14626
15034
  query?: {
14627
15035
  movementType?: string;
14628
- /** @description Page number (1-indexed) */
14629
- page?: number;
14630
- /** @description Items per page (max 100) */
15036
+ /** @description Items per page (max 1000) */
14631
15037
  pageSize?: number;
15038
+ /**
15039
+ * @description Pagination cursor with two states:
15040
+ * - Omitted or empty string (""): start a cursor walk with no prior
15041
+ * position, from the newest movement — this listing always sorts
15042
+ * newest-first.
15043
+ * - Non-empty: an opaque cursor from a previous response's
15044
+ * `nextPageToken`; results resume immediately after that position.
15045
+ *
15046
+ * The response carries no item count: the underlying ledger is too large to
15047
+ * count behind a filter. `movementType` must match the request that produced
15048
+ * the token, or the request is rejected 400.
15049
+ */
15050
+ pageToken?: string;
14632
15051
  };
14633
15052
  header?: never;
14634
15053
  path: {
@@ -14886,10 +15305,13 @@ export interface operations {
14886
15305
  parameters: {
14887
15306
  query?: {
14888
15307
  movementType?: string;
14889
- /** @description Page number (1-indexed) */
14890
- page?: number;
14891
- /** @description Items per page (max 100) */
15308
+ /** @description Items per page (max 1000) */
14892
15309
  pageSize?: number;
15310
+ /**
15311
+ * @description See `GetMarginAccountMovementsRequest.page_token`: the same cursor walk,
15312
+ * scoped to the caller's parent margin account.
15313
+ */
15314
+ pageToken?: string;
14893
15315
  };
14894
15316
  header?: never;
14895
15317
  path?: never;
@@ -15073,6 +15495,80 @@ export interface operations {
15073
15495
  };
15074
15496
  };
15075
15497
  };
15498
+ transfer_collateral_to_sub_account: {
15499
+ parameters: {
15500
+ query?: never;
15501
+ header?: never;
15502
+ path: {
15503
+ /**
15504
+ * @description The caller's sub-account that receives the collateral.
15505
+ * @example 2b1a5f9c-0000-4000-8000-000000000001
15506
+ */
15507
+ marginAccountId: string;
15508
+ };
15509
+ cookie?: never;
15510
+ };
15511
+ requestBody: {
15512
+ content: {
15513
+ "application/json": components["schemas"]["TransferCollateralToSubAccountRequest"];
15514
+ };
15515
+ };
15516
+ responses: {
15517
+ /** @description OK */
15518
+ 200: {
15519
+ headers: {
15520
+ [name: string]: unknown;
15521
+ };
15522
+ content: {
15523
+ "application/json": components["schemas"]["TransferCollateralResponse"];
15524
+ };
15525
+ };
15526
+ /** @description Movement rate limit exceeded — withdrawals and collateral transfers share a per-user budget; retry after the interval in details.retryAfter */
15527
+ 429: {
15528
+ headers: {
15529
+ [name: string]: unknown;
15530
+ };
15531
+ content?: never;
15532
+ };
15533
+ };
15534
+ };
15535
+ transfer_collateral_from_sub_account: {
15536
+ parameters: {
15537
+ query?: never;
15538
+ header?: never;
15539
+ path: {
15540
+ /**
15541
+ * @description The caller's sub-account the collateral leaves.
15542
+ * @example 2b1a5f9c-0000-4000-8000-000000000001
15543
+ */
15544
+ marginAccountId: string;
15545
+ };
15546
+ cookie?: never;
15547
+ };
15548
+ requestBody: {
15549
+ content: {
15550
+ "application/json": components["schemas"]["TransferCollateralFromSubAccountRequest"];
15551
+ };
15552
+ };
15553
+ responses: {
15554
+ /** @description OK */
15555
+ 200: {
15556
+ headers: {
15557
+ [name: string]: unknown;
15558
+ };
15559
+ content: {
15560
+ "application/json": components["schemas"]["TransferCollateralResponse"];
15561
+ };
15562
+ };
15563
+ /** @description Movement rate limit exceeded — withdrawals and collateral transfers share a per-user budget; retry after the interval in details.retryAfter */
15564
+ 429: {
15565
+ headers: {
15566
+ [name: string]: unknown;
15567
+ };
15568
+ content?: never;
15569
+ };
15570
+ };
15571
+ };
15076
15572
  list_all_funding_history: {
15077
15573
  parameters: {
15078
15574
  query?: {
@@ -15080,12 +15576,30 @@ export interface operations {
15080
15576
  startTime?: number;
15081
15577
  /** @description End time as Unix timestamp (milliseconds) */
15082
15578
  endTime?: number;
15083
- /** @description Page number (1-indexed) */
15084
- page?: number;
15085
- /** @description Items per page (max 100) */
15579
+ /** @description Items per page (max 1000) */
15086
15580
  pageSize?: number;
15087
15581
  /** @description Sort direction for settledAt */
15088
15582
  orderBy?: "ASC" | "DESC";
15583
+ /**
15584
+ * @description Pagination cursor with two states:
15585
+ * - Omitted or empty string (""): start a cursor walk with no prior
15586
+ * position, from the newest settlement (the oldest when `orderBy` is
15587
+ * ASC).
15588
+ * - Non-empty: an opaque cursor from a previous response's
15589
+ * `nextPageToken`; results resume immediately after that position.
15590
+ *
15591
+ * The walk seeks on `(settled_at, id)` in the requested direction.
15592
+ * `settled_at` is NOT NULL and never changes once a window settles, and the
15593
+ * `id` tie-break makes the key total — the removed page-number mode ordered
15594
+ * by `(settled_at, trading_pair_id, epoch)` with no tie-break, so a page
15595
+ * boundary between two settlements sharing that triple could repeat or drop
15596
+ * a row.
15597
+ *
15598
+ * `total` is populated — bounded by the server count ceiling, see
15599
+ * `totalCapped`. Filters and `orderBy` must match the request that produced
15600
+ * the token, or the request is rejected 400.
15601
+ */
15602
+ pageToken?: string;
15089
15603
  };
15090
15604
  header?: never;
15091
15605
  path?: never;
@@ -15271,12 +15785,29 @@ export interface operations {
15271
15785
  startTime?: number;
15272
15786
  /** @description End time as Unix timestamp (milliseconds) */
15273
15787
  endTime?: number;
15274
- /** @description Page number (1-indexed) */
15275
- page?: number;
15276
- /** @description Items per page (max 100) */
15788
+ /** @description Items per page (max 1000) */
15277
15789
  pageSize?: number;
15278
- /** @description Sort direction for createdAt */
15790
+ /** @description Sort direction for settledAt */
15279
15791
  orderBy?: "ASC" | "DESC";
15792
+ /**
15793
+ * @description Pagination cursor with two states:
15794
+ * - Omitted or empty string (""): start a cursor walk with no prior
15795
+ * position, from the newest settlement (the oldest when `orderBy` is
15796
+ * ASC).
15797
+ * - Non-empty: an opaque cursor from a previous response's
15798
+ * `nextPageToken`; results resume immediately after that position.
15799
+ *
15800
+ * The walk seeks on `(settled_at, id)` in the requested direction.
15801
+ * `settled_at` is NOT NULL and never changes once a window settles, and the
15802
+ * `id` tie-break makes the key total — the removed page-number mode ordered
15803
+ * by `epoch` with no tie-break, so a page boundary between two
15804
+ * settlements sharing it could repeat or drop a row.
15805
+ *
15806
+ * `total` is populated — bounded by the server count ceiling, see
15807
+ * `totalCapped`. Filters and `orderBy` must match the request that produced
15808
+ * the token, or the request is rejected 400.
15809
+ */
15810
+ pageToken?: string;
15280
15811
  };
15281
15812
  header?: never;
15282
15813
  path: {
@@ -16844,7 +17375,15 @@ export interface operations {
16844
17375
  };
16845
17376
  get_my_referral_downline: {
16846
17377
  parameters: {
16847
- query?: never;
17378
+ query?: {
17379
+ /** @description `earningsBySource` rows per page (max 500) */
17380
+ pageSize?: number;
17381
+ /**
17382
+ * @description Opaque cursor from a previous response's `nextPageToken`; omit or send an
17383
+ * empty string for the first page.
17384
+ */
17385
+ pageToken?: string;
17386
+ };
16848
17387
  header?: never;
16849
17388
  path?: never;
16850
17389
  cookie?: never;
@@ -16924,7 +17463,7 @@ export interface operations {
16924
17463
  };
16925
17464
  content?: never;
16926
17465
  };
16927
- /** @description `parent` is not the caller or one of the caller's own L1/L2 referees */
17466
+ /** @description `parent` is not the caller or one of the caller's own expandable referees */
16928
17467
  404: {
16929
17468
  headers: {
16930
17469
  [name: string]: unknown;
@@ -17056,10 +17595,53 @@ export interface operations {
17056
17595
  tradingPairId?: string;
17057
17596
  /** @description Order status (single value or comma-separated list) */
17058
17597
  status?: string;
17059
- /** @description Page number (1-indexed) */
17060
- page?: number;
17061
- /** @description Items per page (max 100) */
17598
+ /** @description Items per page (max 1000) */
17062
17599
  pageSize?: number;
17600
+ /**
17601
+ * @description Pagination cursor with two states:
17602
+ * - Omitted or empty string (""): start a cursor walk with no prior
17603
+ * position.
17604
+ * - Non-empty: an opaque cursor from a previous response's
17605
+ * `nextPageToken`; results resume immediately after that position.
17606
+ *
17607
+ * ORDER DEPENDS ON THE FILTER, because the two cases are served from
17608
+ * different places:
17609
+ *
17610
+ * - `status=OPEN` is answered from the matching engine's live view, which
17611
+ * carries no timestamps for a position the persistor has not written
17612
+ * yet. It is ordered by `(marginAccountId, tradingPairId, positionId)`
17613
+ * ascending — stable and total, but UUID order, NOT newest-first.
17614
+ * - Every other filter reads persisted rows, ordered by the IMMUTABLE
17615
+ * `(opened_at, id)` descending: newest-opened first. The removed
17616
+ * page-number mode sorted on `COALESCE(closed_at, last_funding_at,
17617
+ * opened_at)`, which *advances* whenever a position takes a funding
17618
+ * payment or closes, so rows moved across a resume point mid-walk;
17619
+ * `opened_at` never changes after the insert. Order therefore differs
17620
+ * from the removed mode's. One exception: an operator correction may
17621
+ * move an OPEN position's `opened_at` EARLIER, never later, to its
17622
+ * opening fill. A walk in flight while that runs can return such a
17623
+ * position a second time, but cannot skip one: dedupe on `positionId`.
17624
+ *
17625
+ * Those are two separate cursor spaces, so a token is only valid in the one
17626
+ * that minted it, and crossing between them is ASYMMETRIC:
17627
+ *
17628
+ * - A PERSISTED token offered to `status=OPEN` while the engine is
17629
+ * reachable is served: the live branch does not recognise it, declines,
17630
+ * and the persisted walk answers. That is what keeps a walk going which
17631
+ * started on persisted rows because the engine was down at the time and
17632
+ * has since come back.
17633
+ * - A LIVE token offered after the engine becomes unreachable is NOT
17634
+ * served. The live branch cannot answer at all, and the persisted
17635
+ * decoder rejects the `src=live` token, so the request is a 400 and the
17636
+ * walk has to start over. There is no way to carry a live position into
17637
+ * the persisted ordering: the two relations do not share a sort key, and
17638
+ * resuming at a key from the wrong one would skip or repeat rows
17639
+ * silently, which is worse than the restart.
17640
+ *
17641
+ * A token neither relation recognises is rejected 400, and so is one minted
17642
+ * under different filters.
17643
+ */
17644
+ pageToken?: string;
17063
17645
  };
17064
17646
  header?: never;
17065
17647
  path?: never;
@@ -17123,12 +17705,24 @@ export interface operations {
17123
17705
  marginAccountId?: string;
17124
17706
  /** @description Trading pair identifier (UUID) */
17125
17707
  tradingPairId?: string;
17126
- /** @description Page number (1-indexed) */
17127
- page?: number;
17128
- /** @description Items per page (max 100) */
17708
+ /** @description Items per page (max 1000) */
17129
17709
  pageSize?: number;
17130
17710
  /** @description When true, return only DECREASE, CLOSE, and LIQUIDATE execution rows. */
17131
17711
  reductionOnly?: boolean;
17712
+ /**
17713
+ * @description Pagination cursor with two states:
17714
+ * - Omitted or empty string (""): start a cursor walk with no prior
17715
+ * position, from the newest event — this listing always sorts
17716
+ * newest-first.
17717
+ * - Non-empty: an opaque cursor from a previous response's
17718
+ * `nextPageToken`; results resume immediately after that position.
17719
+ *
17720
+ * Every walk covers full position history — hot and archived rows merged.
17721
+ * The response carries no item count: this listing's relation is too large
17722
+ * to count behind a filter. Filters must match the request that produced the
17723
+ * token, or the request is rejected 400.
17724
+ */
17725
+ pageToken?: string;
17132
17726
  };
17133
17727
  header?: never;
17134
17728
  path?: never;
@@ -17521,10 +18115,24 @@ export interface operations {
17521
18115
  get_trades: {
17522
18116
  parameters: {
17523
18117
  query?: {
17524
- /** @description Page number (1-indexed) */
17525
- page?: number;
17526
- /** @description Max trades to return (max 100) */
18118
+ /** @description Max trades to return (max 1000) */
17527
18119
  pageSize?: number;
18120
+ /**
18121
+ * @description Pagination cursor with two states:
18122
+ * - Omitted or empty string (""): start a cursor walk with no prior
18123
+ * position, from the most recent trade (this listing always sorts
18124
+ * newest-first).
18125
+ * - Non-empty: an opaque cursor from a previous response's
18126
+ * `next_page_token`; results resume immediately after that position.
18127
+ *
18128
+ * The walk is a keyset seek on `(executed_at, id)`, both immutable once a
18129
+ * trade is written, so a page can neither repeat nor skip a trade when new
18130
+ * fills land mid-walk — the failure the removed page number had by
18131
+ * construction on a table this endpoint appends to continuously.
18132
+ * `trading_pair_id` is pinned inside the token, so a token minted for one
18133
+ * pair is rejected rather than seeking into another pair's history.
18134
+ */
18135
+ pageToken?: string;
17528
18136
  };
17529
18137
  header?: never;
17530
18138
  path: {
@@ -17615,10 +18223,24 @@ export interface operations {
17615
18223
  list_pending_withdrawals: {
17616
18224
  parameters: {
17617
18225
  query?: {
17618
- /** @description Page number (1-indexed) */
17619
- page?: number;
17620
- /** @description Items per page (max 100) */
18226
+ /** @description Items per page (max 1000) */
17621
18227
  pageSize?: number;
18228
+ /**
18229
+ * @description Pagination cursor with two states:
18230
+ * - Omitted or empty string (""): start a cursor walk with no prior
18231
+ * position, from the newest pending withdrawal.
18232
+ * - Non-empty: an opaque cursor from a previous response's
18233
+ * `next_page_token`; results resume immediately after that position.
18234
+ *
18235
+ * The walk seeks on `(created_at, withdrawal_index)` descending — the order
18236
+ * this listing already read in, served by
18237
+ * `idx_withdrawals_user_created (user_id, created_at DESC)`. `created_at` is
18238
+ * NOT NULL and `withdrawal_index` is the table's primary key, assigned by
18239
+ * the vault in request order, so the key is total and immutable. `total` is
18240
+ * populated and exact: a user's unexecuted withdrawals are a small bounded
18241
+ * set.
18242
+ */
18243
+ pageToken?: string;
17622
18244
  };
17623
18245
  header?: never;
17624
18246
  path?: never;