@0xmonaco/types 1.0.67 → 1.0.70

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 (42) hide show
  1. package/dist/buildercodes/index.d.ts +4 -4
  2. package/dist/buildercodes/index.js +1 -1
  3. package/dist/buildercodes/responses.d.ts +45 -1
  4. package/dist/buildercodes/responses.js +25 -1
  5. package/dist/copy-trading/index.d.ts +95 -0
  6. package/dist/copy-trading/index.js +8 -0
  7. package/dist/copy-trading/responses.d.ts +373 -0
  8. package/dist/copy-trading/responses.js +268 -0
  9. package/dist/delegated-agents/index.d.ts +7 -0
  10. package/dist/faucet/index.d.ts +3 -2
  11. package/dist/index.d.ts +1 -0
  12. package/dist/index.js +1 -0
  13. package/dist/margin-accounts/index.d.ts +18 -0
  14. package/dist/portfolio/index.d.ts +12 -0
  15. package/dist/positions/index.d.ts +8 -2
  16. package/dist/profile/index.d.ts +44 -41
  17. package/dist/sdk/index.d.ts +4 -1
  18. package/dist/trading/orders.d.ts +6 -0
  19. package/dist/trading/responses.d.ts +10 -57
  20. package/dist/validation/copy-trading.d.ts +113 -0
  21. package/dist/validation/copy-trading.js +141 -0
  22. package/dist/validation/index.d.ts +1 -0
  23. package/dist/validation/index.js +1 -0
  24. package/dist/validation/positions.d.ts +1 -1
  25. package/dist/validation/profile.d.ts +1 -1
  26. package/dist/validation/profile.js +8 -16
  27. package/dist/validation/trading.d.ts +4 -5
  28. package/dist/validation/trading.js +25 -50
  29. package/dist/websocket/client.d.ts +9 -1
  30. package/dist/websocket/events/conditional-order-events.d.ts +34 -14
  31. package/dist/websocket/events/copy-events.d.ts +133 -0
  32. package/dist/websocket/events/copy-events.js +17 -0
  33. package/dist/websocket/events/index.d.ts +1 -0
  34. package/dist/websocket/events/index.js +1 -0
  35. package/dist/websocket/events/orders-events.d.ts +125 -18
  36. package/dist/websocket/snapshots.d.ts +32 -3
  37. package/dist/whitelist/index.d.ts +5 -16
  38. package/dist/whitelist/index.js +2 -8
  39. package/dist/wire/operations.d.ts +1 -1
  40. package/dist/wire/operations.js +13 -0
  41. package/dist/wire/schema.d.ts +1851 -320
  42. package/package.json +2 -2
@@ -878,6 +878,296 @@ export interface paths {
878
878
  patch?: never;
879
879
  trace?: never;
880
880
  };
881
+ "/api/v1/copy-trading/follows": {
882
+ parameters: {
883
+ query?: never;
884
+ header?: never;
885
+ path?: never;
886
+ cookie?: never;
887
+ };
888
+ /**
889
+ * List your follows
890
+ * @description List your follows.
891
+ *
892
+ * Every follow you have made (live and stopped), newest first.
893
+ */
894
+ get: operations["list_my_follows"];
895
+ put?: never;
896
+ /**
897
+ * Follow a lead trader or edit a follow
898
+ * @description Follow a lead trader or edit a follow.
899
+ *
900
+ * Without `followId`, creates a follow: `allocation` moves from your margin
901
+ * account into a new copy account for this leader, and from then on the
902
+ * leader's fills are mirrored into it. With `followId`, edits that follow
903
+ * (it must be yours): the leader comes from the follow, so an edit works even
904
+ * after the leader releases their handle, and `leader` may be empty; a
905
+ * `leader` handle that names a different leader is refused. `copyExisting`
906
+ * copies the leader's open positions into the new copy account at creation
907
+ * (see PreviewFollow for what that costs); it applies only to a create, and
908
+ * an edit that sets it is refused.
909
+ */
910
+ post: operations["upsert_follow"];
911
+ delete?: never;
912
+ options?: never;
913
+ head?: never;
914
+ patch?: never;
915
+ trace?: never;
916
+ };
917
+ "/api/v1/copy-trading/follows/preview": {
918
+ parameters: {
919
+ query?: never;
920
+ header?: never;
921
+ path?: never;
922
+ cookie?: never;
923
+ };
924
+ get?: never;
925
+ put?: never;
926
+ /**
927
+ * Preview copying a lead trader's open positions
928
+ * @description Preview copying a leader's open positions.
929
+ *
930
+ * What a follow with these terms would open if it set `copyExisting`, as
931
+ * totals only: the estimated margin and fees, and how many of the leader's
932
+ * positions would and would not be copied. It names no pair, side or
933
+ * reason. Read-only; nothing is placed or reserved. The same session rules
934
+ * and follow terms rules as following apply, it is refused while copy
935
+ * trading is off, and it spends the order-risk preview budget. At most 64
936
+ * positions are sized; `truncated` says when more matched.
937
+ */
938
+ post: operations["preview_follow"];
939
+ delete?: never;
940
+ options?: never;
941
+ head?: never;
942
+ patch?: never;
943
+ trace?: never;
944
+ };
945
+ "/api/v1/copy-trading/follows/{followId}": {
946
+ parameters: {
947
+ query?: never;
948
+ header?: never;
949
+ path?: never;
950
+ cookie?: never;
951
+ };
952
+ /**
953
+ * Get one of your follows
954
+ * @description Get one of your follows.
955
+ *
956
+ * The follow plus its most recent skipped mirrors (up to 100, newest
957
+ * first). 404 unless the follow is yours.
958
+ */
959
+ get: operations["get_follow"];
960
+ put?: never;
961
+ post?: never;
962
+ delete?: never;
963
+ options?: never;
964
+ head?: never;
965
+ patch?: never;
966
+ trace?: never;
967
+ };
968
+ "/api/v1/copy-trading/follows/{followId}/leader-positions": {
969
+ parameters: {
970
+ query?: never;
971
+ header?: never;
972
+ path?: never;
973
+ cookie?: never;
974
+ };
975
+ /**
976
+ * List the open positions of a followed lead trader
977
+ * @description List the open positions of the leader one of your follows copies.
978
+ *
979
+ * The leader comes from the follow, so this works even after the leader
980
+ * releases their handle. 404 unless the follow is yours; 403 unless it is
981
+ * live (ACTIVE or CLOSE_ONLY).
982
+ */
983
+ get: operations["list_follow_leader_positions"];
984
+ put?: never;
985
+ post?: never;
986
+ delete?: never;
987
+ options?: never;
988
+ head?: never;
989
+ patch?: never;
990
+ trace?: never;
991
+ };
992
+ "/api/v1/copy-trading/follows/{followId}/stop": {
993
+ parameters: {
994
+ query?: never;
995
+ header?: never;
996
+ path?: never;
997
+ cookie?: never;
998
+ };
999
+ get?: never;
1000
+ put?: never;
1001
+ /**
1002
+ * Stop a follow
1003
+ * @description Stop a follow.
1004
+ *
1005
+ * Stops mirroring the leader. Stopping one of your own follows only; the
1006
+ * follow is identified by its id. An exit is never gated beyond ownership,
1007
+ * except that a delegated agent session cannot stop a follow.
1008
+ */
1009
+ post: operations["stop_follow"];
1010
+ delete?: never;
1011
+ options?: never;
1012
+ head?: never;
1013
+ patch?: never;
1014
+ trace?: never;
1015
+ };
1016
+ "/api/v1/copy-trading/leaders": {
1017
+ parameters: {
1018
+ query?: never;
1019
+ header?: never;
1020
+ path?: never;
1021
+ cookie?: never;
1022
+ };
1023
+ /**
1024
+ * List lead traders
1025
+ * @description List lead traders.
1026
+ *
1027
+ * The public leaderboard: every ACTIVE lead trader with their stats for one
1028
+ * window, sorted by the chosen metric (highest first; leaders without a
1029
+ * value for the metric come last). Served from a snapshot refreshed about
1030
+ * once a minute; `asOf` is its time.
1031
+ */
1032
+ get: operations["list_lead_traders"];
1033
+ put?: never;
1034
+ post?: never;
1035
+ delete?: never;
1036
+ options?: never;
1037
+ head?: never;
1038
+ patch?: never;
1039
+ trace?: never;
1040
+ };
1041
+ "/api/v1/copy-trading/leaders/me": {
1042
+ parameters: {
1043
+ query?: never;
1044
+ header?: never;
1045
+ path?: never;
1046
+ cookie?: never;
1047
+ };
1048
+ /**
1049
+ * Get your lead trader profile
1050
+ * @description Get your lead trader profile.
1051
+ *
1052
+ * Your profile, follow summary and stats for every window. 404 when you
1053
+ * are not a lead trader.
1054
+ */
1055
+ get: operations["get_my_lead_trader"];
1056
+ /**
1057
+ * Register as a lead trader or edit your profile
1058
+ * @description Register as a lead trader or edit your profile.
1059
+ *
1060
+ * A registration is checked against the platform's eligibility rules:
1061
+ * account equity, trading history, closed positions, and a claimed custom
1062
+ * TraderCode handle. The profile is replaced as sent: an omitted `bio` or
1063
+ * `minAllocation` clears it and an omitted `status` means ACTIVE; an
1064
+ * omitted `shareBps` keeps the current share (the platform default on a
1065
+ * registration). A follower with a live follow cannot register.
1066
+ */
1067
+ put: operations["upsert_lead_trader"];
1068
+ post?: never;
1069
+ delete?: never;
1070
+ options?: never;
1071
+ head?: never;
1072
+ patch?: never;
1073
+ trace?: never;
1074
+ };
1075
+ "/api/v1/copy-trading/leaders/me/followers": {
1076
+ parameters: {
1077
+ query?: never;
1078
+ header?: never;
1079
+ path?: never;
1080
+ cookie?: never;
1081
+ };
1082
+ /**
1083
+ * List your followers
1084
+ * @description List your current followers.
1085
+ *
1086
+ * Your live followers (ACTIVE or CLOSE_ONLY), newest first. Each follower
1087
+ * appears by wallet address and display string.
1088
+ */
1089
+ get: operations["list_my_followers"];
1090
+ put?: never;
1091
+ post?: never;
1092
+ delete?: never;
1093
+ options?: never;
1094
+ head?: never;
1095
+ patch?: never;
1096
+ trace?: never;
1097
+ };
1098
+ "/api/v1/copy-trading/leaders/{leader}": {
1099
+ parameters: {
1100
+ query?: never;
1101
+ header?: never;
1102
+ path?: never;
1103
+ cookie?: never;
1104
+ };
1105
+ /**
1106
+ * Get a lead trader
1107
+ * @description Get a lead trader's profile.
1108
+ *
1109
+ * Profile, follow summary and stats for every window. `leader` is the
1110
+ * custom TraderCode handle. 404 for an unknown or
1111
+ * suspended leader.
1112
+ */
1113
+ get: operations["get_lead_trader"];
1114
+ put?: never;
1115
+ post?: never;
1116
+ delete?: never;
1117
+ options?: never;
1118
+ head?: never;
1119
+ patch?: never;
1120
+ trace?: never;
1121
+ };
1122
+ "/api/v1/copy-trading/leaders/{leader}/closed-trades": {
1123
+ parameters: {
1124
+ query?: never;
1125
+ header?: never;
1126
+ path?: never;
1127
+ cookie?: never;
1128
+ };
1129
+ /**
1130
+ * List a lead trader's closed trades
1131
+ * @description List a lead trader's closed trades.
1132
+ *
1133
+ * The leader's reducing executions (partial and full closes, liquidations
1134
+ * and auto-deleveraging), newest first.
1135
+ */
1136
+ get: operations["list_lead_trader_closed_trades"];
1137
+ put?: never;
1138
+ post?: never;
1139
+ delete?: never;
1140
+ options?: never;
1141
+ head?: never;
1142
+ patch?: never;
1143
+ trace?: never;
1144
+ };
1145
+ "/api/v1/copy-trading/leaders/{leader}/positions": {
1146
+ parameters: {
1147
+ query?: never;
1148
+ header?: never;
1149
+ path?: never;
1150
+ cookie?: never;
1151
+ };
1152
+ /**
1153
+ * List a followed lead trader's open positions
1154
+ * @description List a lead trader's open positions.
1155
+ *
1156
+ * Visible to the leader's current followers only: the caller must hold a
1157
+ * live follow (ACTIVE or CLOSE_ONLY) of this leader in the session's
1158
+ * application. The leader is addressed by handle; a released handle names
1159
+ * no one (another user may claim it), so it is a 404 even for a current
1160
+ * follower.
1161
+ */
1162
+ get: operations["list_lead_trader_open_positions"];
1163
+ put?: never;
1164
+ post?: never;
1165
+ delete?: never;
1166
+ options?: never;
1167
+ head?: never;
1168
+ patch?: never;
1169
+ trace?: never;
1170
+ };
881
1171
  "/api/v1/delegated-agents": {
882
1172
  parameters: {
883
1173
  query?: never;
@@ -998,9 +1288,9 @@ export interface paths {
998
1288
  *
999
1289
  * Returns the authenticated wallet's remaining faucet requests in the
1000
1290
  * rolling 24h window, when the next request becomes available, and the
1001
- * 5 most recent faucet requests. Quota is wallet-scoped: it aggregates
1002
- * across all user rows sharing the wallet address, matching mint
1003
- * enforcement.
1291
+ * 5 most recent faucet requests. Quota is per wallet and app: the same
1292
+ * wallet has its own quota on each app, and only the calling app's
1293
+ * requests are counted and listed, matching mint enforcement.
1004
1294
  */
1005
1295
  get: operations["get_faucet_info"];
1006
1296
  put?: never;
@@ -1025,7 +1315,8 @@ export interface paths {
1025
1315
  * @description Mint all testnet tokens.
1026
1316
  *
1027
1317
  * Mint all available testnet tokens to the authenticated user's address.
1028
- * Rate limited per 24 hours. The request is synchronous: it returns 200
1318
+ * Rate limited per 24 hours, per wallet and app: the same wallet has its
1319
+ * own quota on each app. The request is synchronous: it returns 200
1029
1320
  * only once every faucet transaction is confirmed on-chain.
1030
1321
  */
1031
1322
  post: operations["mint_tokens"];
@@ -2576,11 +2867,13 @@ export interface paths {
2576
2867
  get?: never;
2577
2868
  put?: never;
2578
2869
  /**
2579
- * Submit whitelist application
2580
- * @description Submit whitelist application.
2870
+ * Whitelist applications closed
2871
+ * @deprecated
2872
+ * @description Public whitelist applications are closed.
2581
2873
  *
2582
- * Submit a whitelist application to join Monaco Protocol. The user will be
2583
- * created with is_active = false and will need to be approved by an admin.
2874
+ * Retained for client compatibility. Every decoded submission is rejected with
2875
+ * HTTP 403 Forbidden / gRPC PERMISSION_DENIED and no applicant data is changed.
2876
+ * Existing applications and administrative approvals remain available.
2584
2877
  */
2585
2878
  post: operations["submit_whitelist"];
2586
2879
  delete?: never;
@@ -3406,6 +3699,40 @@ export interface components {
3406
3699
  * @description RFC 3339 credit timestamp.
3407
3700
  */
3408
3701
  createdAt?: string | null;
3702
+ /**
3703
+ * @description Payout stream this credit belongs to: `REVENUE_SHARE` (the frontend's share of Monaco's fee) or `BUILDER_FEE` (the frontend's own builder fee, paid by the taker). Both land in the same claimable balance.
3704
+ * @example REVENUE_SHARE
3705
+ * @enum {string|null}
3706
+ */
3707
+ kind?: "REVENUE_SHARE" | "BUILDER_FEE" | null;
3708
+ };
3709
+ BuildercodePayoutTokenKindTotal: {
3710
+ /**
3711
+ * @description Credit token contract address.
3712
+ * @example 0x0000000000000000000000000000000000000002
3713
+ */
3714
+ token?: string | null;
3715
+ /**
3716
+ * @description Payout stream these totals cover: `REVENUE_SHARE` or `BUILDER_FEE`.
3717
+ * @example REVENUE_SHARE
3718
+ * @enum {string|null}
3719
+ */
3720
+ kind?: "REVENUE_SHARE" | "BUILDER_FEE" | null;
3721
+ /**
3722
+ * @description Summed credits of this kind in RAW atomic units of this token.
3723
+ * @example 5000000
3724
+ */
3725
+ totalAmount?: string | null;
3726
+ /**
3727
+ * Format: int64
3728
+ * @description Number of credits of this kind included in this total.
3729
+ */
3730
+ payoutCount?: number | null;
3731
+ /**
3732
+ * Format: date-time
3733
+ * @description RFC 3339 timestamp of the newest credit of this kind in this token.
3734
+ */
3735
+ lastCreditedAt?: string | null;
3409
3736
  };
3410
3737
  BuildercodePayoutTokenTotal: {
3411
3738
  /**
@@ -3659,6 +3986,34 @@ export interface components {
3659
3986
  message?: string | null;
3660
3987
  submittedQuantity?: string | null;
3661
3988
  };
3989
+ ClosedTrade: {
3990
+ /**
3991
+ * Format: uuid
3992
+ * @description Trading pair UUID
3993
+ */
3994
+ tradingPairId?: string | null;
3995
+ /** @description LONG or SHORT; empty on legacy rows */
3996
+ positionSide?: string | null;
3997
+ /**
3998
+ * @description DECREASE, CLOSE, LIQUIDATE or ADL
3999
+ * @example CLOSE
4000
+ */
4001
+ action?: string | null;
4002
+ /** @description Closed size in base units */
4003
+ size?: string | null;
4004
+ /** @description Execution price */
4005
+ exitPrice?: string | null;
4006
+ /** @description Average entry price of the position at the close */
4007
+ entryPrice?: string | null;
4008
+ /** @description Gross realized PnL of the execution, in quote units */
4009
+ realizedPnl?: string | null;
4010
+ /** @description Realized PnL net of the execution's fees and funding, in quote units */
4011
+ netRealizedPnl?: string | null;
4012
+ /** @description Net realized PnL as a percentage of the initial margin released by the execution */
4013
+ realizedRoe?: string | null;
4014
+ /** @description Execution time (RFC 3339) */
4015
+ closedAt?: string | null;
4016
+ };
3662
4017
  ConditionalOrder: {
3663
4018
  conditionalOrderId?: string | null;
3664
4019
  /** Format: uuid */
@@ -3691,7 +4046,7 @@ export interface components {
3691
4046
  activatedAt?: string | null;
3692
4047
  /**
3693
4048
  * Format: int64
3694
- * @description Opaque, compare-only revision counter for this conditional order's state: the sequencer step that wrote it. A strictly higher value is strictly newer state for that conditional order. The SAME counter is carried on the `conditional_orders` WebSocket SNAPSHOT frame — but deliberately NOT on the live `conditional_orders` events, which build from the row as it stood before the sequencer acted and so could only report the version the row held BEFORE the change they announce. So seed conditional state from the snapshot frame and REST, reconciling on `(conditionalOrderId, version)` — take the REST row when `snapshot.version >= local.version`, else keep local state — and apply the live events as state without ranking them. Note `>=`, not `>`: equal versions mean the SAME STEP rather than identical state, because one step can write several conditional rows (a trigger writes the triggered row and cancels its OCO sibling under one step). A REST row is that step's FINAL state, so it wins a tie. One consequence to plan for: the snapshot is read from the database, which lags the matching engine, so a transition that fires during the read is in neither the snapshot nor the delivered stream and cannot be ranked — re-read the affected rows if a conditional order's state matters at reconnect. Do not read anything else into the number: it is drawn from the same global sequence plain orders use, so values are sparse, gaps are normal, and it is not comparable across different conditional orders — nor against a plain order's version. Absent means unknown: a row last written before this field existed. Fall back to a full field comparison for those rather than treating absent as version zero.
4049
+ * @description Opaque, compare-only revision counter for this conditional order's state: the sequencer step that wrote it. A strictly higher value is strictly newer state for that conditional order. The SAME counter is carried on every live `conditional_orders` WebSocket event and on the subscribe-time snapshot frame, always the version of the row the frame describes. Reconcile all three on `(conditionalOrderId, version)`: take the incoming row when `incoming.version >= local.version`, else keep local state. Note `>=`, not `>`: equal versions mean the SAME STEP rather than identical state, because one step can write several conditional rows (a trigger writes the triggered row and cancels its OCO sibling under one step). A REST row is that step's FINAL state, so it wins a tie. One consequence to plan for: the snapshot is read from the database, which lags the matching engine, so a transition that fires during the read is in neither the snapshot nor the delivered stream and cannot be ranked — re-read the affected rows if a conditional order's state matters at reconnect. Do not read anything else into the number: it is drawn from the same global sequence plain orders use, so values are sparse, gaps are normal, and it is not comparable across different conditional orders — nor against a plain order's version. Absent means unknown: a row last written before this field existed. Fall back to a full field comparison for those rather than treating absent as version zero.
3695
4050
  * @example 918342
3696
4051
  */
3697
4052
  version?: number | null;
@@ -3709,6 +4064,27 @@ export interface components {
3709
4064
  /** @description TRAILING_STOP only: when tracking began. Absent while the stop is still waiting for activationPrice (state stays ACTIVE in both phases). */
3710
4065
  trailArmedAt?: string | null;
3711
4066
  };
4067
+ /** @description A follow's market filter. */
4068
+ CopyMarketFilter: {
4069
+ /** @description Trading pair UUIDs to copy (at most 256); empty means every market. */
4070
+ tradingPairIds?: string[] | null;
4071
+ };
4072
+ CopySkip: {
4073
+ /**
4074
+ * Format: uuid
4075
+ * @description Trading pair UUID of the leader fill that was not mirrored
4076
+ */
4077
+ tradingPairId?: string | null;
4078
+ /**
4079
+ * @description Why the mirror was skipped, e.g. INSUFFICIENT_MARGIN, BELOW_MIN, MARKET_STATE, LEVERAGE_MISMATCH
4080
+ * @example INSUFFICIENT_MARGIN
4081
+ */
4082
+ reason?: string | null;
4083
+ /** @description The copy quantity that could not be placed, in base units */
4084
+ requestedQuantity?: string | null;
4085
+ /** @description When the mirror was skipped (RFC 3339) */
4086
+ skippedAt?: string | null;
4087
+ };
3712
4088
  CreateDelegatedSessionRequest: {
3713
4089
  /**
3714
4090
  * Format: uuid
@@ -4147,7 +4523,7 @@ export interface components {
4147
4523
  maxOrderNotional?: string | null;
4148
4524
  /**
4149
4525
  * Format: int32
4150
- * @description Maximum concurrent open orders, if set
4526
+ * @description Legacy field; no concurrent open-order cap is enforced. New or updated policies leave it unset.
4151
4527
  */
4152
4528
  maxOpenOrders?: number | null;
4153
4529
  };
@@ -4260,25 +4636,91 @@ export interface components {
4260
4636
  */
4261
4637
  takerFeeBps?: string | null;
4262
4638
  };
4263
- FundingPaymentRecord: {
4639
+ Follow: {
4264
4640
  /**
4265
4641
  * Format: uuid
4266
- * @description Funding payment UUID
4267
- * @example 123e4567-e89b-12d3-a456-426614174000
4642
+ * @description The follow's id
4268
4643
  */
4269
- id?: string | null;
4644
+ followId?: string | null;
4645
+ /** @description The leader followed. */
4646
+ leader?: components["schemas"]["LeadTraderRef"] | null;
4270
4647
  /**
4271
- * Format: uuid
4272
- * @description Margin position UUID
4273
- * @example 123e4567-e89b-12d3-a456-426614174000
4648
+ * @description ACTIVE, CLOSE_ONLY (only reductions mirror) or STOPPED
4649
+ * @example ACTIVE
4274
4650
  */
4275
- positionId?: string | null;
4651
+ status?: string | null;
4652
+ /** @description FOLLOW, CROSS or ISOLATED */
4653
+ marginModePolicy?: string | null;
4654
+ /** @description PROPORTIONAL or FIXED_MARGIN */
4655
+ sizingMode?: string | null;
4656
+ /** @description Margin per leader order for FIXED_MARGIN, in quote units */
4657
+ sizingParam?: string | null;
4658
+ /** @description FOLLOW or FIXED */
4659
+ leverageMode?: string | null;
4660
+ /** @description Leverage for FIXED */
4661
+ fixedLeverage?: string | null;
4662
+ /** @description Collateral allocated to the follow, in quote units */
4663
+ allocation?: string | null;
4664
+ /** @description Copy stop-loss as a fraction of the allocation */
4665
+ slPct?: string | null;
4666
+ /** @description Whether the follow copied the leader's open positions at creation */
4667
+ copyExisting?: boolean | null;
4668
+ /** @description Trading pair UUIDs copied; empty means every market. */
4669
+ tradingPairIds?: string[] | null;
4276
4670
  /**
4277
- * Format: uuid
4278
- * @description Margin account UUID
4279
- * @example 123e4567-e89b-12d3-a456-426614174000
4671
+ * Format: uint32
4672
+ * @description Consecutive mirrors skipped for insufficient margin
4280
4673
  */
4281
- marginAccountId?: string | null;
4674
+ consecutiveSkips?: number | null;
4675
+ /**
4676
+ * Format: uuid
4677
+ * @description The copy account's cross risk bucket in your margin account
4678
+ */
4679
+ copyRiskBucketId?: string | null;
4680
+ /** @description When the follow started (RFC 3339) */
4681
+ startedAt?: string | null;
4682
+ /** @description When the follow stopped (RFC 3339) */
4683
+ stoppedAt?: string | null;
4684
+ /** @description FOLLOWER, STOP_LOSS, SKIP_LIMIT, ADMIN or LEADER_SUSPENDED */
4685
+ stopReason?: string | null;
4686
+ };
4687
+ Follower: {
4688
+ /** @description The follower's wallet address (lowercase hex) */
4689
+ walletAddress?: string | null;
4690
+ /** @description The follower's custom TraderCode handle when claimed, else the wallet address */
4691
+ display?: string | null;
4692
+ /**
4693
+ * @description ACTIVE or CLOSE_ONLY
4694
+ * @example ACTIVE
4695
+ */
4696
+ status?: string | null;
4697
+ /**
4698
+ * @description Collateral allocated to the follow, in quote units
4699
+ * @example 1000
4700
+ */
4701
+ allocation?: string | null;
4702
+ /** @description When the follow started (RFC 3339) */
4703
+ startedAt?: string | null;
4704
+ };
4705
+ FundingPaymentRecord: {
4706
+ /**
4707
+ * Format: uuid
4708
+ * @description Funding payment UUID
4709
+ * @example 123e4567-e89b-12d3-a456-426614174000
4710
+ */
4711
+ id?: string | null;
4712
+ /**
4713
+ * Format: uuid
4714
+ * @description Margin position UUID
4715
+ * @example 123e4567-e89b-12d3-a456-426614174000
4716
+ */
4717
+ positionId?: string | null;
4718
+ /**
4719
+ * Format: uuid
4720
+ * @description Margin account UUID
4721
+ * @example 123e4567-e89b-12d3-a456-426614174000
4722
+ */
4723
+ marginAccountId?: string | null;
4282
4724
  /**
4283
4725
  * Format: uuid
4284
4726
  * @description Trading pair UUID
@@ -4521,8 +4963,10 @@ export interface components {
4521
4963
  * @description RFC 3339 timestamp of the newest credit, or null when none exists.
4522
4964
  */
4523
4965
  lastCreditedAt?: string | null;
4524
- /** @description Per-token earnings totals. Empty when this application has no payouts. */
4966
+ /** @description Per-token earnings totals, summed across every payout kind. Empty when this application has no payouts. */
4525
4967
  byToken?: components["schemas"]["BuildercodePayoutTokenTotal"][] | null;
4968
+ /** @description The same totals split by token AND payout kind. One row per (token, kind) pair with at least one credit; a token's rows sum to its `byToken` total. Empty when this application has no payouts. */
4969
+ byTokenAndKind?: components["schemas"]["BuildercodePayoutTokenKindTotal"][] | null;
4526
4970
  };
4527
4971
  GetBuildercodeRewardsBalanceResponse: {
4528
4972
  /** @description One entry per reward token with a non-zero available balance. */
@@ -4605,6 +5049,17 @@ export interface components {
4605
5049
  */
4606
5050
  recentRequests?: components["schemas"]["FaucetRequestRecord"][] | null;
4607
5051
  };
5052
+ GetFollowResponse: {
5053
+ /** @description The follow. */
5054
+ follow?: components["schemas"]["Follow"] | null;
5055
+ /** @description Most recent skipped mirrors, newest first (up to 100). */
5056
+ recentSkips?: components["schemas"]["CopySkip"][] | null;
5057
+ /**
5058
+ * @description The copy account's equity at the engine's marks, in quote units: its collateral plus the unrealized PnL of its positions. Absent when the engine could not be read. A balance, not trading PnL
5059
+ * @example 1042.75
5060
+ */
5061
+ copyAccountEquity?: string | null;
5062
+ };
4608
5063
  GetFundingStateResponse: {
4609
5064
  /** Format: uuid */
4610
5065
  tradingPairId?: string | null;
@@ -4643,6 +5098,14 @@ export interface components {
4643
5098
  components?: components["schemas"]["IndexComponent"][] | null;
4644
5099
  updatedAt?: string | null;
4645
5100
  };
5101
+ GetLeadTraderResponse: {
5102
+ /** @description The leader's profile. */
5103
+ profile?: components["schemas"]["LeadTraderProfile"] | null;
5104
+ /** @description Current followers and allocation. */
5105
+ followSummary?: components["schemas"]["LeadTraderFollowSummary"] | null;
5106
+ /** @description Stats for 7d, 30d, 90d and all, in that order. */
5107
+ stats?: components["schemas"]["LeadTraderStats"][] | null;
5108
+ };
4646
5109
  GetLimitsResponse: {
4647
5110
  limits?: components["schemas"]["SubAccountLimit"][] | null;
4648
5111
  };
@@ -4691,6 +5154,12 @@ export interface components {
4691
5154
  withdrawableCollateral?: string | null;
4692
5155
  totalPositionNotional?: string | null;
4693
5156
  unrealizedPnl?: string | null;
5157
+ /**
5158
+ * @description On a risk bucket row this is the risk bucket's cash balance (realized
5159
+ * closes, funding and transfers between a copy account's risk buckets land
5160
+ * here), not trading profit; trading PnL comes from position history and
5161
+ * the portfolio PnL endpoints.
5162
+ */
4694
5163
  realizedPnl?: string | null;
4695
5164
  updatedAt?: string | null;
4696
5165
  label?: string | null;
@@ -4708,6 +5177,13 @@ export interface components {
4708
5177
  * rows and persisted-fallback reads.
4709
5178
  */
4710
5179
  availableOrderCollateral?: string | null;
5180
+ /**
5181
+ * Format: uuid
5182
+ * @description On a copy risk bucket row, the id of the follow (copy account) that funds it
5183
+ */
5184
+ copyFollowId?: string | null;
5185
+ /** @description On a copy risk bucket row, the followed leader's custom TraderCode handle, when they still hold one */
5186
+ copyLeaderHandle?: string | null;
4711
5187
  };
4712
5188
  GetMarkPriceResponse: {
4713
5189
  /** Format: uuid */
@@ -4835,7 +5311,7 @@ export interface components {
4835
5311
  movements?: components["schemas"]["LedgerMovement"][] | null;
4836
5312
  /**
4837
5313
  * Format: uint32
4838
- * @description Total number of movements
5314
+ * @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.
4839
5315
  * @example 150
4840
5316
  */
4841
5317
  total?: number | null;
@@ -4853,7 +5329,7 @@ export interface components {
4853
5329
  pageSize?: number | null;
4854
5330
  /**
4855
5331
  * Format: uint32
4856
- * @description Total number of pages
5332
+ * @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
4857
5333
  * @example 8
4858
5334
  */
4859
5335
  totalPages?: number | null;
@@ -5541,6 +6017,11 @@ export interface components {
5541
6017
  /**
5542
6018
  * @description Lifetime realized PnL net of trading fees and funding. Terminal rows
5543
6019
  * only; absent when the position's reducing executions are unavailable.
6020
+ * Deducts whole-life `cum_fees` once. Also absent after close until the
6021
+ * final close is recorded in the PnL sample and the fee history is complete.
6022
+ * A position with no PnL sample stays absent for 28 days after close while
6023
+ * its sample may be pending. Beyond that it serves the closing-execution
6024
+ * net, without opening fees that are no longer available.
5544
6025
  */
5545
6026
  netRealizedPnl?: string | null;
5546
6027
  /**
@@ -5550,7 +6031,8 @@ export interface components {
5550
6031
  * costs rather than posted collateral, and funding is signed, so folding it
5551
6032
  * into the denominator could drive it to zero or negative. Terminal rows
5552
6033
  * only; absent when unavailable, including when the position's reducing
5553
- * executions do not account for its whole lifetime.
6034
+ * executions do not account for its whole lifetime, and under the same
6035
+ * conditions as `net_realized_pnl`.
5554
6036
  */
5555
6037
  realizedRoe?: string | null;
5556
6038
  /**
@@ -5583,7 +6065,8 @@ export interface components {
5583
6065
  * Null when the opening-fill fees are unavailable — before the position's
5584
6066
  * first PnL sample flushes, after its samples age out of PnL retention, or
5585
6067
  * for positions predating the PnL service — rather than an understated
5586
- * partial.
6068
+ * partial. On a terminal row it is also null until the final close is
6069
+ * recorded in the position's PnL sample, or while fee data is incomplete.
5587
6070
  */
5588
6071
  cumFees?: string | null;
5589
6072
  /**
@@ -5891,43 +6374,18 @@ export interface components {
5891
6374
  };
5892
6375
  GetUserTradesResponse: {
5893
6376
  trades?: components["schemas"]["UserTrade"][] | null;
5894
- /**
5895
- * @deprecated
5896
- * @description Deprecated: current page number (legacy offset mode only; 0 in cursor mode)
5897
- * @example 1
5898
- */
5899
- page?: string | null;
5900
6377
  /**
5901
6378
  * @description Items per page
5902
6379
  * @example 20
5903
6380
  */
5904
6381
  pageSize?: string | null;
5905
6382
  /**
5906
- * @deprecated
5907
- * @description Deprecated: total matching trades (legacy page-number mode only; 0 in cursor mode). Exact up to pageSize x 10,000 rows and saturates there. Use pageToken cursor pagination instead.
5908
- * @example 150
5909
- */
5910
- total?: string | null;
5911
- /**
5912
- * @deprecated
5913
- * @description Deprecated: total pages at this pageSize (legacy page-number mode only; 0 in cursor mode). Exact up to 10,000 and saturates there. Use pageToken cursor pagination instead.
5914
- * @example 8
5915
- */
5916
- totalPages?: string | null;
5917
- /**
5918
- * @description Cursor for the next page. Empty on every page-number (legacy) response —
5919
- * page-number mode never mints a token, full page or not, since resuming
5920
- * a client from a legacy-minted position could silently strand archived
5921
- * history newer than wherever that page happened to end. To walk full
5922
- * history, start a cursor-mode request with `page_token` present but
5923
- * empty (`""`); from then on the token is present whenever that page
5924
- * returned any rows (AIP-158 "maybe more" semantics), not only when the
5925
- * page is exactly full. Empty only when a cursor-mode page returned zero
5926
- * rows, which is the sole proof the walk is exhausted; a non-empty token
5927
- * does not guarantee further results, so keep following it until a
5928
- * response returns zero rows and an empty token. The two modes never
5929
- * bridge: a page-number response's empty token is not "done," it simply
5930
- * means page-number mode does not participate in cursor continuation.
6383
+ * @description Cursor for the next page. Present whenever that page returned any rows
6384
+ * (AIP-158 "maybe more" semantics), not only when the page is exactly full.
6385
+ * Empty only when a page returned zero rows, which is the sole proof the
6386
+ * walk is exhausted; a non-empty token does not guarantee further results,
6387
+ * so keep following it until a response returns zero rows and an empty
6388
+ * token.
5931
6389
  */
5932
6390
  nextPageToken?: string | null;
5933
6391
  };
@@ -5960,6 +6418,136 @@ export interface components {
5960
6418
  */
5961
6419
  source?: string | null;
5962
6420
  };
6421
+ /** @description Current followers and the collateral they have allocated. Window-free. */
6422
+ LeadTraderFollowSummary: {
6423
+ /**
6424
+ * Format: uint32
6425
+ * @description Live follows (ACTIVE or CLOSE_ONLY)
6426
+ * @example 12
6427
+ */
6428
+ followerCount?: number | null;
6429
+ /**
6430
+ * @description Collateral allocated by live follows, in quote units (AUM as allocated, not marked)
6431
+ * @example 25000
6432
+ */
6433
+ allocated?: string | null;
6434
+ /**
6435
+ * @description Equity of live follows' copy accounts at the engine's marks, in quote units (AUM marked: collateral plus unrealized PnL of copy positions). Absent when it could not be read. Not trading PnL
6436
+ * @example 25400.5
6437
+ */
6438
+ aumEquity?: string | null;
6439
+ };
6440
+ LeadTraderListing: {
6441
+ /** @description The leader's profile. */
6442
+ profile?: components["schemas"]["LeadTraderProfile"] | null;
6443
+ /** @description Current followers and allocation. */
6444
+ followSummary?: components["schemas"]["LeadTraderFollowSummary"] | null;
6445
+ /** @description Stats for the requested window. */
6446
+ stats?: components["schemas"]["LeadTraderStats"] | null;
6447
+ };
6448
+ LeadTraderOpenPosition: {
6449
+ /**
6450
+ * Format: uuid
6451
+ * @description Trading pair UUID
6452
+ */
6453
+ tradingPairId?: string | null;
6454
+ /** @description LONG or SHORT */
6455
+ side?: string | null;
6456
+ /** @description Position size in base units */
6457
+ size?: string | null;
6458
+ /** @description Average entry price */
6459
+ entryPrice?: string | null;
6460
+ /** @description Current mark price */
6461
+ markPrice?: string | null;
6462
+ /** @description Unrealized PnL at the mark, in quote units */
6463
+ unrealizedPnl?: string | null;
6464
+ /** @description Position leverage */
6465
+ leverage?: string | null;
6466
+ /** @description CROSS or ISOLATED */
6467
+ marginMode?: string | null;
6468
+ };
6469
+ LeadTraderProfile: {
6470
+ /** @description Who the leader is. */
6471
+ leader?: components["schemas"]["LeadTraderRef"] | null;
6472
+ /**
6473
+ * @description ACTIVE (accepting follows), PAUSED (existing follows keep mirroring, no new follows) or SUSPENDED (only on your own profile)
6474
+ * @example ACTIVE
6475
+ */
6476
+ status?: string | null;
6477
+ /**
6478
+ * Format: uint32
6479
+ * @description The leader's share of followers' realized profit, in basis points
6480
+ * @example 1000
6481
+ */
6482
+ shareBps?: number | null;
6483
+ /** @description Free-text profile description; empty when none */
6484
+ bio?: string | null;
6485
+ /**
6486
+ * @description The leader's minimum follow allocation in quote units, when above the platform floor
6487
+ * @example 1000
6488
+ */
6489
+ minAllocation?: string | null;
6490
+ /**
6491
+ * @description Registration time (RFC 3339)
6492
+ * @example 2026-09-23T12:00:00Z
6493
+ */
6494
+ registeredAt?: string | null;
6495
+ };
6496
+ /** @description A lead trader as the public sees them: never an internal id. */
6497
+ LeadTraderRef: {
6498
+ /**
6499
+ * @description The leader's wallet address (lowercase hex)
6500
+ * @example 0x1234567890abcdef1234567890abcdef12345678
6501
+ */
6502
+ walletAddress?: string | null;
6503
+ /**
6504
+ * @description The leader's custom TraderCode handle, when claimed
6505
+ * @example alpha_trader
6506
+ */
6507
+ handle?: string | null;
6508
+ /**
6509
+ * @description The handle when claimed, else the wallet address (every listed or addressable leader has a handle)
6510
+ * @example alpha_trader
6511
+ */
6512
+ display?: string | null;
6513
+ };
6514
+ /**
6515
+ * @description A leader's trading performance over one window, from the account PnL
6516
+ * rollups. Bucket balances never feed these numbers.
6517
+ */
6518
+ LeadTraderStats: {
6519
+ /**
6520
+ * @description 7d, 30d, 90d or all
6521
+ * @example 30d
6522
+ */
6523
+ window?: string | null;
6524
+ /**
6525
+ * @description Trading PnL over the window in quote units: realized plus unrealized, net of fees and funding
6526
+ * @example 1250.5
6527
+ */
6528
+ pnl?: string | null;
6529
+ /**
6530
+ * @description PnL as a percentage of the highest base balance (starting equity plus net deposits) over the window; absent when that base is not positive
6531
+ * @example 12.5
6532
+ */
6533
+ roiPct?: string | null;
6534
+ /**
6535
+ * @description Largest peak-to-trough fall of cumulative PnL over the window, as a percentage of the highest base balance; sampled at the window's rollup interval (1h for 7d, 4h for 30d and 90d, 1d for all)
6536
+ * @example 4.2
6537
+ */
6538
+ maxDrawdownPct?: string | null;
6539
+ /**
6540
+ * @description Winning closes as a percentage of winning plus losing closes over the window; absent when there were none
6541
+ * @example 61.5
6542
+ */
6543
+ winRatePct?: string | null;
6544
+ /**
6545
+ * Format: uint32
6546
+ * @description Closes over the window, break-even included
6547
+ * @example 40
6548
+ */
6549
+ closedTrades?: number | null;
6550
+ };
5963
6551
  LedgerMovement: {
5964
6552
  /**
5965
6553
  * Format: uuid
@@ -6237,23 +6825,17 @@ export interface components {
6237
6825
  orders?: components["schemas"]["ConditionalOrder"][] | null;
6238
6826
  /**
6239
6827
  * Format: uint32
6240
- * @description Matching conditional orders in page-number (offset) mode: 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 conditional orders than the listing can page through reads the cap, not its lifetime total. 0 in cursor (pageToken) mode, which runs no COUNT (AIP-158).
6828
+ * @description Matching conditional orders, counted up to a server ceiling of 10,000 and saturating there, so a caller with more than that reads the cap rather than a lifetime total.
6241
6829
  * @example 3
6242
6830
  */
6243
6831
  total?: number | null;
6244
- /**
6245
- * Format: uint32
6246
- * @deprecated
6247
- * @description Deprecated: current page number (legacy offset mode only; 0 in cursor mode)
6248
- */
6249
- page?: number | null;
6250
6832
  /** Format: uint32 */
6251
6833
  pageSize?: number | null;
6252
6834
  /**
6253
6835
  * @description Cursor for the next page, minted only when a further page exists — the
6254
6836
  * read over-fetches one row to decide, so there is no "maybe more" state.
6255
- * Empty on every page-number (legacy) response, and empty on the final
6256
- * cursor page (including a full final page, since nothing follows it).
6837
+ * Empty on the final page (including a full final page, since nothing
6838
+ * follows it).
6257
6839
  * Follow it until it comes back empty; that empty token is the definitive
6258
6840
  * end of the walk, so no extra zero-row request is needed. Do not feed the
6259
6841
  * empty token back as `page_token` — an empty input `page_token` restarts
@@ -6269,6 +6851,9 @@ export interface components {
6269
6851
  /** @description The calling owner's delegated agents */
6270
6852
  agents?: components["schemas"]["DelegatedAgent"][] | null;
6271
6853
  };
6854
+ ListFollowLeaderPositionsResponse: {
6855
+ positions?: components["schemas"]["LeadTraderOpenPosition"][] | null;
6856
+ };
6272
6857
  ListFundingHistoryResponse: {
6273
6858
  records?: components["schemas"]["FundingRecord"][] | null;
6274
6859
  /** Format: uint32 */
@@ -6282,7 +6867,7 @@ export interface components {
6282
6867
  records?: components["schemas"]["FundingPaymentRecord"][] | null;
6283
6868
  /**
6284
6869
  * Format: uint32
6285
- * @description Total matching funding payment records
6870
+ * @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.
6286
6871
  * @example 2
6287
6872
  */
6288
6873
  total?: number | null;
@@ -6300,11 +6885,26 @@ export interface components {
6300
6885
  pageSize?: number | null;
6301
6886
  /**
6302
6887
  * Format: uint32
6303
- * @description Total number of pages
6888
+ * @description Number of pages at the requested page size. Exact up to 10,000 and saturates there, the last page this listing can reach.
6304
6889
  * @example 1
6305
6890
  */
6306
6891
  totalPages?: number | null;
6307
6892
  };
6893
+ ListLeadTraderClosedTradesResponse: {
6894
+ closedTrades?: components["schemas"]["ClosedTrade"][] | null;
6895
+ /** @description Cursor for the next page; empty when there are no more. */
6896
+ nextPageToken?: string | null;
6897
+ };
6898
+ ListLeadTraderOpenPositionsResponse: {
6899
+ positions?: components["schemas"]["LeadTraderOpenPosition"][] | null;
6900
+ };
6901
+ ListLeadTradersResponse: {
6902
+ leaders?: components["schemas"]["LeadTraderListing"][] | null;
6903
+ /** @description Cursor for the next page; empty when there are no more. */
6904
+ nextPageToken?: string | null;
6905
+ /** @description Time of the leaderboard snapshot these rows come from (RFC 3339) */
6906
+ asOf?: string | null;
6907
+ };
6308
6908
  ListManagedMarketAssignmentsResponse: {
6309
6909
  /** @description Expected assignments, including phases currently unable to quote. */
6310
6910
  items?: components["schemas"]["ManagedMarketAssignment"][] | null;
@@ -6325,6 +6925,16 @@ export interface components {
6325
6925
  /** Format: uint32 */
6326
6926
  pageSize?: number | null;
6327
6927
  };
6928
+ ListMyFollowersResponse: {
6929
+ followers?: components["schemas"]["Follower"][] | null;
6930
+ /** @description Cursor for the next page; empty when there are no more. */
6931
+ nextPageToken?: string | null;
6932
+ };
6933
+ ListMyFollowsResponse: {
6934
+ follows?: components["schemas"]["Follow"][] | null;
6935
+ /** @description Cursor for the next page; empty when there are no more. */
6936
+ nextPageToken?: string | null;
6937
+ };
6328
6938
  ListOrdersResponse: {
6329
6939
  orders?: components["schemas"]["GetOrderResponse"][] | null;
6330
6940
  /**
@@ -6333,13 +6943,6 @@ export interface components {
6333
6943
  * @example 150
6334
6944
  */
6335
6945
  total?: number | null;
6336
- /**
6337
- * Format: uint32
6338
- * @deprecated
6339
- * @description Deprecated: current page number (legacy offset mode only; 0 in cursor mode)
6340
- * @example 1
6341
- */
6342
- page?: number | null;
6343
6946
  /**
6344
6947
  * Format: uint32
6345
6948
  * @description Items per page
@@ -6353,19 +6956,12 @@ export interface components {
6353
6956
  */
6354
6957
  totalPages?: number | null;
6355
6958
  /**
6356
- * @description Cursor for the next page. Empty on every page-number (legacy) response —
6357
- * page-number mode never mints a token, full page or not, since resuming
6358
- * a client from a legacy-minted position could silently strand archived
6359
- * history newer than wherever that page happened to end. To walk full
6360
- * history, start a cursor-mode request with `page_token` present but
6361
- * empty (`""`); from then on the token is present whenever that page
6362
- * returned any rows (AIP-158 "maybe more" semantics), not only when the
6363
- * page is exactly full. Empty only when a cursor-mode page returned zero
6364
- * rows, which is the sole proof the walk is exhausted; a non-empty token
6365
- * does not guarantee further results, so keep following it until a
6366
- * response returns zero rows and an empty token. The two modes never
6367
- * bridge: a page-number response's empty token is not "done," it simply
6368
- * means page-number mode does not participate in cursor continuation.
6959
+ * @description Cursor for the next page. Present whenever that page returned any rows
6960
+ * (AIP-158 "maybe more" semantics), not only when the page is exactly full.
6961
+ * Empty only when a page returned zero rows, which is the sole proof the
6962
+ * walk is exhausted; a non-empty token does not guarantee further results,
6963
+ * so keep following it until a response returns zero rows and an empty
6964
+ * token.
6369
6965
  */
6370
6966
  nextPageToken?: string | null;
6371
6967
  /**
@@ -6468,17 +7064,10 @@ export interface components {
6468
7064
  orders?: components["schemas"]["TwapOrder"][] | null;
6469
7065
  /**
6470
7066
  * Format: uint32
6471
- * @description Matching TWAP orders in page-number (offset) mode: 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 TWAP orders than the listing can page through reads the cap, not its lifetime total. 0 in cursor (pageToken) mode, which runs no COUNT (AIP-158).
7067
+ * @description Matching TWAP orders, counted up to a server ceiling of 10,000 and saturating there, so a caller with more than that reads the cap rather than a lifetime total.
6472
7068
  * @example 3
6473
7069
  */
6474
7070
  total?: number | null;
6475
- /**
6476
- * Format: uint32
6477
- * @deprecated
6478
- * @description Deprecated: current page number (legacy offset mode only; 0 in cursor mode)
6479
- * @example 1
6480
- */
6481
- page?: number | null;
6482
7071
  /**
6483
7072
  * Format: uint32
6484
7073
  * @description Items per page
@@ -6488,8 +7077,8 @@ export interface components {
6488
7077
  /**
6489
7078
  * @description Cursor for the next page, minted only when a further page exists — the
6490
7079
  * read over-fetches one row to decide, so there is no "maybe more" state.
6491
- * Empty on every page-number (legacy) response, and empty on the final
6492
- * cursor page (including a full final page, since nothing follows it).
7080
+ * Empty on the final page (including a full final page, since nothing
7081
+ * follows it).
6493
7082
  * Follow it until it comes back empty; that empty token is the definitive
6494
7083
  * end of the walk, so no extra zero-row request is needed. Do not feed the
6495
7084
  * empty token back as `page_token` — an empty input `page_token` restarts
@@ -6573,6 +7162,12 @@ export interface components {
6573
7162
  withdrawableCollateral?: string | null;
6574
7163
  totalPositionNotional?: string | null;
6575
7164
  unrealizedPnl?: string | null;
7165
+ /**
7166
+ * @description On a risk bucket row this is the risk bucket's cash balance (realized
7167
+ * closes, funding and transfers between a copy account's risk buckets land
7168
+ * here), not trading profit; trading PnL comes from position history and
7169
+ * the portfolio PnL endpoints.
7170
+ */
6576
7171
  realizedPnl?: string | null;
6577
7172
  updatedAt?: string | null;
6578
7173
  label?: string | null;
@@ -6621,6 +7216,13 @@ export interface components {
6621
7216
  * neither of the gate's terms is reconstructable.
6622
7217
  */
6623
7218
  availableOrderCollateral?: string | null;
7219
+ /**
7220
+ * Format: uuid
7221
+ * @description On a copy risk bucket row, the id of the follow (copy account) that funds it
7222
+ */
7223
+ copyFollowId?: string | null;
7224
+ /** @description On a copy risk bucket row, the followed leader's custom TraderCode handle, when they still hold one */
7225
+ copyLeaderHandle?: string | null;
6624
7226
  };
6625
7227
  MatchResult: {
6626
7228
  /**
@@ -7076,6 +7678,13 @@ export interface components {
7076
7678
  * against another.
7077
7679
  */
7078
7680
  tradingPairId?: string | null;
7681
+ /**
7682
+ * Format: uuid
7683
+ * @description On a copy risk bucket row, the id of the follow (copy account) that funds it
7684
+ */
7685
+ copyFollowId?: string | null;
7686
+ /** @description On a copy risk bucket row, the followed leader's custom TraderCode handle, when they still hold one */
7687
+ copyLeaderHandle?: string | null;
7079
7688
  };
7080
7689
  PortfolioSeriesWindow: {
7081
7690
  /**
@@ -7219,6 +7828,11 @@ export interface components {
7219
7828
  /**
7220
7829
  * @description Lifetime realized PnL net of trading fees and funding. Terminal rows
7221
7830
  * only; absent when the position's reducing executions are unavailable.
7831
+ * Deducts whole-life `cum_fees` once. Also absent after close until the
7832
+ * final close is recorded in the PnL sample and the fee history is complete.
7833
+ * A position with no PnL sample stays absent for 28 days after close while
7834
+ * its sample may be pending. Beyond that it serves the closing-execution
7835
+ * net, without opening fees that are no longer available.
7222
7836
  */
7223
7837
  netRealizedPnl?: string | null;
7224
7838
  /**
@@ -7228,7 +7842,8 @@ export interface components {
7228
7842
  * costs rather than posted collateral, and funding is signed, so folding it
7229
7843
  * into the denominator could drive it to zero or negative. Terminal rows
7230
7844
  * only; absent when unavailable, including when the position's reducing
7231
- * executions do not account for its whole lifetime.
7845
+ * executions do not account for its whole lifetime, and under the same
7846
+ * conditions as `net_realized_pnl`.
7232
7847
  */
7233
7848
  realizedRoe?: string | null;
7234
7849
  /**
@@ -7261,7 +7876,8 @@ export interface components {
7261
7876
  * Null when the opening-fill fees are unavailable — before the position's
7262
7877
  * first PnL sample flushes, after its samples age out of PnL retention, or
7263
7878
  * for positions predating the PnL service — rather than an understated
7264
- * partial.
7879
+ * partial. On a terminal row it is also null until the final close is
7880
+ * recorded in the position's PnL sample, or while fee data is incomplete.
7265
7881
  */
7266
7882
  cumFees?: string | null;
7267
7883
  /**
@@ -7345,6 +7961,75 @@ export interface components {
7345
7961
  */
7346
7962
  cumFees?: string | null;
7347
7963
  };
7964
+ PreviewFollowRequest: {
7965
+ /**
7966
+ * @description The leader's custom TraderCode handle
7967
+ * @example alpha_trader
7968
+ */
7969
+ leader?: string | null;
7970
+ /**
7971
+ * @description FOLLOW (default), CROSS or ISOLATED
7972
+ * @example FOLLOW
7973
+ */
7974
+ marginModePolicy?: string | null;
7975
+ /**
7976
+ * @description PROPORTIONAL (default) or FIXED_MARGIN
7977
+ * @example PROPORTIONAL
7978
+ */
7979
+ sizingMode?: string | null;
7980
+ /** @description Margin per leader order in quote units; required for FIXED_MARGIN, omitted otherwise */
7981
+ sizingParam?: string | null;
7982
+ /**
7983
+ * @description FOLLOW (default) or FIXED
7984
+ * @example FOLLOW
7985
+ */
7986
+ leverageMode?: string | null;
7987
+ /** @description Leverage for every copy; required for FIXED, omitted otherwise */
7988
+ fixedLeverage?: string | null;
7989
+ /**
7990
+ * @description Collateral the copy account would start with, in quote units
7991
+ * @example 1000
7992
+ */
7993
+ allocation?: string | null;
7994
+ /** @description Markets to copy; omit to copy every market the leader trades. */
7995
+ markets?: components["schemas"]["CopyMarketFilter"] | null;
7996
+ };
7997
+ /**
7998
+ * @description What following with `copyExisting` would open, as totals only. The caller
7999
+ * of a preview is never a follower of the leader (copyExisting applies only
8000
+ * on a create), so the response names no pair, side, size, mark or skip
8001
+ * reason, and a leader whose positions cannot be copied at all gives
8002
+ * `copiedPositions = 0` with no reason. The totals are rounded UP to cents
8003
+ * (the settlement currency's display precision). A residual aggregate signal
8004
+ * remains: the counts and the rounded totals across varied allocations
8005
+ * bound the size of the leader's book, never its markets or direction.
8006
+ */
8007
+ PreviewFollowResponse: {
8008
+ /**
8009
+ * @description Estimated collateral the copied positions would reserve at placement, in quote units, rounded up to cents
8010
+ * @example 125.40
8011
+ */
8012
+ estimatedMargin?: string | null;
8013
+ /**
8014
+ * @description Estimated taker fees of the copies, in quote units, rounded up to cents
8015
+ * @example 0.35
8016
+ */
8017
+ estimatedFee?: string | null;
8018
+ /**
8019
+ * Format: uint32
8020
+ * @description The leader's positions (in the copied markets) that would be copied
8021
+ * @example 2
8022
+ */
8023
+ copiedPositions?: number | null;
8024
+ /**
8025
+ * Format: uint32
8026
+ * @description The leader's positions (in the copied markets) that would not be copied
8027
+ * @example 1
8028
+ */
8029
+ skippedPositions?: number | null;
8030
+ /** @description True when the leader holds more positions in the copied markets than one preview sizes (64); the totals and counts cover the first ones only */
8031
+ truncated?: boolean | null;
8032
+ };
7348
8033
  PriceChange: {
7349
8034
  /**
7350
8035
  * @description Price 24 hours ago
@@ -8232,6 +8917,13 @@ export interface components {
8232
8917
  */
8233
8918
  slippageToleranceBps?: number | null;
8234
8919
  };
8920
+ StopFollowResponse: {
8921
+ /**
8922
+ * Format: uuid
8923
+ * @description The stopped follow's id
8924
+ */
8925
+ followId?: string | null;
8926
+ };
8235
8927
  SubAccount: {
8236
8928
  /**
8237
8929
  * Format: uuid
@@ -8346,13 +9038,13 @@ export interface components {
8346
9038
  };
8347
9039
  SubmitWhitelistResponse: {
8348
9040
  /**
8349
- * @description Human-readable status message
9041
+ * @description Legacy success message; submissions now return HTTP 403 / gRPC PERMISSION_DENIED
8350
9042
  * @example Your whitelist application has been submitted successfully! We'll review it and get back to you soon.
8351
9043
  */
8352
9044
  message?: string | null;
8353
9045
  /**
8354
9046
  * Format: uuid
8355
- * @description Created user UUID (pending approval)
9047
+ * @description Legacy created user UUID; retired submissions do not create users
8356
9048
  * @example 123e4567-e89b-12d3-a456-426614174000
8357
9049
  */
8358
9050
  userId?: string | null;
@@ -9086,7 +9778,7 @@ export interface components {
9086
9778
  * @description Agent wallet address (EVM, 42 chars including 0x)
9087
9779
  * @example 0x742d35cc6634c0532925a3b8d4060f31e2c3d8b5
9088
9780
  */
9089
- agentAddress?: string | null;
9781
+ agentAddress: string;
9090
9782
  /**
9091
9783
  * @description Optional human-friendly label for the agent
9092
9784
  * @example market-maker-bot
@@ -9098,26 +9790,26 @@ export interface components {
9098
9790
  */
9099
9791
  expiresAt?: string | null;
9100
9792
  /**
9101
- * @description Actions the agent may perform: CREATE_ORDER, CANCEL_ORDER, REPLACE_ORDER
9793
+ * @description Required JSON array of actions the agent may perform: CREATE_ORDER, CANCEL_ORDER, REPLACE_ORDER. An empty array permits no actions.
9102
9794
  * @example [
9103
9795
  * "CREATE_ORDER",
9104
9796
  * "CANCEL_ORDER"
9105
9797
  * ]
9106
9798
  */
9107
- allowedActions?: string[] | null;
9108
- /** @description Trading pair UUIDs the agent may trade. An order is allowed if its market or its margin account is permitted. */
9109
- allowedTradingPairIds?: string[] | null;
9110
- /** @description Margin account UUIDs the agent may trade against. An order is allowed if its market or its margin account is permitted. */
9799
+ allowedActions: string[];
9800
+ /** @description Required JSON array of trading pair UUIDs. An order is allowed if its market or its margin account is permitted. Send [] for account-only scope; both scopes empty permit no orders. */
9801
+ allowedTradingPairIds: string[];
9802
+ /** @description Optional JSON array of additional margin account UUIDs. Omitted, null, or [] adds no account scope; it does not grant access to every account. An order is allowed if its market or its margin account is permitted. */
9111
9803
  allowedMarginAccountIds?: string[] | null;
9112
9804
  /**
9113
- * @description Permitted order types (LIMIT, MARKET). Empty means unrestricted.
9805
+ * @description Optional JSON array of permitted order types (LIMIT, MARKET). Omitted, null, or [] means unrestricted order types.
9114
9806
  * @example [
9115
9807
  * "LIMIT"
9116
9808
  * ]
9117
9809
  */
9118
9810
  allowedOrderTypes?: string[] | null;
9119
9811
  /**
9120
- * @description Permitted time-in-force values (GTC, IOC, FOK). Empty means unrestricted.
9812
+ * @description Optional JSON array of permitted time-in-force values (GTC, IOC, FOK). Omitted, null, or [] means unrestricted time in force.
9121
9813
  * @example [
9122
9814
  * "GTC"
9123
9815
  * ]
@@ -9135,11 +9827,104 @@ export interface components {
9135
9827
  maxOrderNotional?: string | null;
9136
9828
  /**
9137
9829
  * Format: int32
9138
- * @description Maximum concurrent open orders. Omit for no limit.
9139
- * @example 100
9830
+ * @description Unsupported legacy field. Requests that set maxOpenOrders are rejected; no concurrent open-order cap is enforced. Omit this field.
9140
9831
  */
9141
9832
  maxOpenOrders?: number | null;
9142
9833
  };
9834
+ UpsertFollowRequest: {
9835
+ /**
9836
+ * Format: uuid
9837
+ * @description Omit to create a follow; set to edit one of your follows
9838
+ */
9839
+ followId?: string | null;
9840
+ /**
9841
+ * @description The leader's custom TraderCode handle; required on a create, optional on an edit (a consistency check when it resolves)
9842
+ * @example alpha_trader
9843
+ */
9844
+ leader?: string | null;
9845
+ /**
9846
+ * @description FOLLOW (default: the leader's risk bucket mode per market), CROSS or ISOLATED
9847
+ * @example FOLLOW
9848
+ */
9849
+ marginModePolicy?: string | null;
9850
+ /**
9851
+ * @description PROPORTIONAL (default: scaled by copy account equity over the leader's equity) or FIXED_MARGIN
9852
+ * @example PROPORTIONAL
9853
+ */
9854
+ sizingMode?: string | null;
9855
+ /** @description Margin per leader order in quote units; required for FIXED_MARGIN, omitted otherwise */
9856
+ sizingParam?: string | null;
9857
+ /**
9858
+ * @description FOLLOW (default: the leader's leverage) or FIXED
9859
+ * @example FOLLOW
9860
+ */
9861
+ leverageMode?: string | null;
9862
+ /** @description Leverage for every copy; required for FIXED, omitted otherwise */
9863
+ fixedLeverage?: string | null;
9864
+ /**
9865
+ * @description Collateral for the copy account, in quote units, at or above the minimum
9866
+ * @example 1000
9867
+ */
9868
+ allocation?: string | null;
9869
+ /**
9870
+ * @description Copy stop-loss as a fraction of the allocation in (0, 1]; omitted means none
9871
+ * @example 0.25
9872
+ */
9873
+ slPct?: string | null;
9874
+ /** @description On a create, also copy the leader's currently open positions into the new copy account, sized like any mirrored fill (PreviewFollow shows the cost). Default false. Refused on an edit */
9875
+ copyExisting?: boolean | null;
9876
+ /** @description Markets to copy; omit to copy every market the leader trades. */
9877
+ markets?: components["schemas"]["CopyMarketFilter"] | null;
9878
+ };
9879
+ UpsertFollowResponse: {
9880
+ /**
9881
+ * Format: uuid
9882
+ * @description The follow's id
9883
+ */
9884
+ followId?: string | null;
9885
+ /**
9886
+ * Format: uuid
9887
+ * @description The copy account: the cross risk bucket in your margin account that holds this follow's collateral and positions
9888
+ */
9889
+ copyRiskBucketId?: string | null;
9890
+ /** @description True when this call created the follow, false when it edited one */
9891
+ created?: boolean | null;
9892
+ };
9893
+ UpsertLeadTraderRequest: {
9894
+ /**
9895
+ * Format: uint32
9896
+ * @description Profit share in basis points, within the platform's range; omitted keeps the current share (the platform default on a registration)
9897
+ * @example 1000
9898
+ */
9899
+ shareBps?: number | null;
9900
+ /** @description Free-text profile description, at most 2,000 bytes; omitted clears it */
9901
+ bio?: string | null;
9902
+ /**
9903
+ * @description ACTIVE (default) or PAUSED
9904
+ * @example ACTIVE
9905
+ */
9906
+ status?: string | null;
9907
+ /**
9908
+ * @description Minimum follow allocation in quote units, at or above the platform floor; omitted clears it
9909
+ * @example 1000
9910
+ */
9911
+ minAllocation?: string | null;
9912
+ };
9913
+ UpsertLeadTraderResponse: {
9914
+ /** @description True when this call registered you, false when it edited your profile */
9915
+ created?: boolean | null;
9916
+ /**
9917
+ * @description Your status after the call
9918
+ * @example ACTIVE
9919
+ */
9920
+ status?: string | null;
9921
+ /**
9922
+ * Format: uint32
9923
+ * @description Your profit share after the call, in basis points
9924
+ * @example 1000
9925
+ */
9926
+ shareBps?: number | null;
9927
+ };
9143
9928
  UserInfo: {
9144
9929
  /**
9145
9930
  * Format: uuid
@@ -9169,9 +9954,21 @@ export interface components {
9169
9954
  price?: string | null;
9170
9955
  quantity?: string | null;
9171
9956
  liquidityRole?: string | null;
9957
+ /**
9958
+ * @description Total fee this user paid on the trade, in raw quote units: for a taker,
9959
+ * Monaco's taker fee plus the frontend's builder fee; for a maker, the maker
9960
+ * fee (negative for a rebate). Equals `monaco_fee + builder_fee`.
9961
+ */
9172
9962
  fee?: string | null;
9173
9963
  realizedPnl?: string | null;
9174
9964
  timestamp?: string | null;
9965
+ /** @description Monaco's component of `fee`, in raw quote units. */
9966
+ monacoFee?: string | null;
9967
+ /**
9968
+ * @description The frontend's builder fee component of `fee`, in raw quote units. Always
9969
+ * "0" for a maker: builder fees are charged to takers only.
9970
+ */
9971
+ builderFee?: string | null;
9175
9972
  };
9176
9973
  VerifyRequest: {
9177
9974
  /**
@@ -10331,31 +11128,20 @@ export interface operations {
10331
11128
  get_user_trades: {
10332
11129
  parameters: {
10333
11130
  query?: {
10334
- /**
10335
- * @deprecated
10336
- * @description Deprecated: page number for legacy offset pagination (1-indexed). Use pageToken cursor pagination instead.
10337
- */
10338
- page?: number;
10339
11131
  /** @description Items per page (max: 100 in page-number mode; up to 1000 when pageToken is present) */
10340
11132
  pageSize?: number;
10341
11133
  /** @description Trading pair identifier (UUID) */
10342
11134
  tradingPairId?: string;
10343
11135
  /**
10344
- * @description Pagination cursor with three distinct states:
10345
- * - Omitted: legacy page-number pagination via `page`, limited to recent
10346
- * history once the archive window is enabled.
10347
- * - Empty string (""): start a cursor walk with no prior position, from
10348
- * the newest row (this endpoint always sorts newest-first).
11136
+ * @description Pagination cursor with two states:
11137
+ * - Omitted or empty string (""): start a cursor walk with no prior
11138
+ * position, from the newest row.
10349
11139
  * - Non-empty: an opaque cursor from a previous response's
10350
11140
  * `next_page_token`; results resume immediately after that position.
10351
11141
  *
10352
- * In either cursor-walk state (empty or non-empty), `page` is ignored, the
10353
- * response omits exact totals (total/total_pages/page are 0), and results
10354
- * cover full trade history — hot and archived rows merged — unlike
10355
- * page-number mode, which only ever sees recent history. Clients that need
10356
- * complete trade history must use the cursor form (start with an empty
10357
- * string, then follow next_page_token) rather than `page`. Filters must
10358
- * match the request that produced the token.
11142
+ * Every walk covers full trade history — hot and archived rows merged. The
11143
+ * response carries no item count: this listing's table is too large to count
11144
+ * behind a filter. Filters must match the request that produced the token.
10359
11145
  */
10360
11146
  pageToken?: string;
10361
11147
  };
@@ -10686,19 +11472,779 @@ export interface operations {
10686
11472
  headers: {
10687
11473
  [name: string]: unknown;
10688
11474
  };
10689
- content: {
10690
- "application/json": components["schemas"]["ListAppUsersResponse"];
10691
- };
11475
+ content: {
11476
+ "application/json": components["schemas"]["ListAppUsersResponse"];
11477
+ };
11478
+ };
11479
+ /** @description Bad request */
11480
+ 400: {
11481
+ headers: {
11482
+ [name: string]: unknown;
11483
+ };
11484
+ content?: never;
11485
+ };
11486
+ /** @description Unauthorized - Invalid or missing x-server-key */
11487
+ 401: {
11488
+ headers: {
11489
+ [name: string]: unknown;
11490
+ };
11491
+ content?: never;
11492
+ };
11493
+ /** @description Internal server error */
11494
+ 500: {
11495
+ headers: {
11496
+ [name: string]: unknown;
11497
+ };
11498
+ content?: never;
11499
+ };
11500
+ };
11501
+ };
11502
+ create_challenge: {
11503
+ parameters: {
11504
+ query?: never;
11505
+ header?: never;
11506
+ path?: never;
11507
+ cookie?: never;
11508
+ };
11509
+ requestBody: {
11510
+ content: {
11511
+ "application/json": components["schemas"]["ChallengeRequest"];
11512
+ };
11513
+ };
11514
+ responses: {
11515
+ /** @description OK */
11516
+ 200: {
11517
+ headers: {
11518
+ [name: string]: unknown;
11519
+ };
11520
+ content: {
11521
+ "application/json": components["schemas"]["ChallengeResponse"];
11522
+ };
11523
+ };
11524
+ /** @description Invalid request parameters */
11525
+ 400: {
11526
+ headers: {
11527
+ [name: string]: unknown;
11528
+ };
11529
+ content?: never;
11530
+ };
11531
+ /** @description Origin not allowed for this application */
11532
+ 403: {
11533
+ headers: {
11534
+ [name: string]: unknown;
11535
+ };
11536
+ content?: never;
11537
+ };
11538
+ /** @description Invalid clientId */
11539
+ 404: {
11540
+ headers: {
11541
+ [name: string]: unknown;
11542
+ };
11543
+ content?: never;
11544
+ };
11545
+ /** @description Authentication rate limit exceeded — challenge and verify share one per-client-address budget (60 requests/min sustained, burst 120); retry after the interval in details.retryAfter */
11546
+ 429: {
11547
+ headers: {
11548
+ [name: string]: unknown;
11549
+ };
11550
+ content?: never;
11551
+ };
11552
+ /** @description Internal server error */
11553
+ 500: {
11554
+ headers: {
11555
+ [name: string]: unknown;
11556
+ };
11557
+ content?: never;
11558
+ };
11559
+ };
11560
+ };
11561
+ refresh_session: {
11562
+ parameters: {
11563
+ query?: never;
11564
+ header?: never;
11565
+ path?: never;
11566
+ cookie?: never;
11567
+ };
11568
+ requestBody: {
11569
+ content: {
11570
+ "application/json": components["schemas"]["RefreshRequest"];
11571
+ };
11572
+ };
11573
+ responses: {
11574
+ /** @description OK */
11575
+ 200: {
11576
+ headers: {
11577
+ [name: string]: unknown;
11578
+ };
11579
+ content: {
11580
+ "application/json": components["schemas"]["RefreshResponse"];
11581
+ };
11582
+ };
11583
+ /** @description Missing, invalid, or expired session signature */
11584
+ 401: {
11585
+ headers: {
11586
+ [name: string]: unknown;
11587
+ };
11588
+ content?: never;
11589
+ };
11590
+ /** @description Session not found */
11591
+ 404: {
11592
+ headers: {
11593
+ [name: string]: unknown;
11594
+ };
11595
+ content?: never;
11596
+ };
11597
+ /** @description Internal server error */
11598
+ 500: {
11599
+ headers: {
11600
+ [name: string]: unknown;
11601
+ };
11602
+ content?: never;
11603
+ };
11604
+ };
11605
+ };
11606
+ revoke_session: {
11607
+ parameters: {
11608
+ query?: never;
11609
+ header?: never;
11610
+ path?: never;
11611
+ cookie?: never;
11612
+ };
11613
+ requestBody: {
11614
+ content: {
11615
+ "application/json": components["schemas"]["RevokeRequest"];
11616
+ };
11617
+ };
11618
+ responses: {
11619
+ /** @description OK */
11620
+ 200: {
11621
+ headers: {
11622
+ [name: string]: unknown;
11623
+ };
11624
+ content: {
11625
+ "application/json": components["schemas"]["RevokeResponse"];
11626
+ };
11627
+ };
11628
+ /** @description Request body must be empty */
11629
+ 400: {
11630
+ headers: {
11631
+ [name: string]: unknown;
11632
+ };
11633
+ content?: never;
11634
+ };
11635
+ /** @description Missing or invalid session signature */
11636
+ 401: {
11637
+ headers: {
11638
+ [name: string]: unknown;
11639
+ };
11640
+ content?: never;
11641
+ };
11642
+ /** @description Session not found */
11643
+ 404: {
11644
+ headers: {
11645
+ [name: string]: unknown;
11646
+ };
11647
+ content?: never;
11648
+ };
11649
+ /** @description Internal server error */
11650
+ 500: {
11651
+ headers: {
11652
+ [name: string]: unknown;
11653
+ };
11654
+ content?: never;
11655
+ };
11656
+ };
11657
+ };
11658
+ verify_signature: {
11659
+ parameters: {
11660
+ query?: never;
11661
+ header?: never;
11662
+ path?: never;
11663
+ cookie?: never;
11664
+ };
11665
+ requestBody: {
11666
+ content: {
11667
+ "application/json": components["schemas"]["VerifyRequest"];
11668
+ };
11669
+ };
11670
+ responses: {
11671
+ /** @description OK */
11672
+ 200: {
11673
+ headers: {
11674
+ [name: string]: unknown;
11675
+ };
11676
+ content: {
11677
+ "application/json": components["schemas"]["VerifyResponse"];
11678
+ };
11679
+ };
11680
+ /** @description Invalid request parameters, nonce expired, or already used */
11681
+ 400: {
11682
+ headers: {
11683
+ [name: string]: unknown;
11684
+ };
11685
+ content?: never;
11686
+ };
11687
+ /** @description Invalid signature */
11688
+ 401: {
11689
+ headers: {
11690
+ [name: string]: unknown;
11691
+ };
11692
+ content?: never;
11693
+ };
11694
+ /** @description Origin not allowed for this application */
11695
+ 403: {
11696
+ headers: {
11697
+ [name: string]: unknown;
11698
+ };
11699
+ content?: never;
11700
+ };
11701
+ /** @description Invalid nonce or clientId */
11702
+ 404: {
11703
+ headers: {
11704
+ [name: string]: unknown;
11705
+ };
11706
+ content?: never;
11707
+ };
11708
+ /** @description Authentication rate limit exceeded — challenge and verify share one per-client-address budget (60 requests/min sustained, burst 120), checked before the signature; retry after the interval in details.retryAfter */
11709
+ 429: {
11710
+ headers: {
11711
+ [name: string]: unknown;
11712
+ };
11713
+ content?: never;
11714
+ };
11715
+ /** @description Internal server error */
11716
+ 500: {
11717
+ headers: {
11718
+ [name: string]: unknown;
11719
+ };
11720
+ content?: never;
11721
+ };
11722
+ /** @description Contract-wallet (EIP-1271) verification could not be completed for an eligible address: the chain did not answer, did not answer within the deadline, or the server was at its concurrent-verification capacity and declined to ask. Retryable, and not a verdict on the signature. */
11723
+ 503: {
11724
+ headers: {
11725
+ [name: string]: unknown;
11726
+ };
11727
+ content?: never;
11728
+ };
11729
+ };
11730
+ };
11731
+ get_buildercodes_config: {
11732
+ parameters: {
11733
+ query?: never;
11734
+ header?: never;
11735
+ path?: never;
11736
+ cookie?: never;
11737
+ };
11738
+ requestBody?: never;
11739
+ responses: {
11740
+ /** @description OK */
11741
+ 200: {
11742
+ headers: {
11743
+ [name: string]: unknown;
11744
+ };
11745
+ content: {
11746
+ "application/json": components["schemas"]["GetBuildercodesConfigResponse"];
11747
+ };
11748
+ };
11749
+ /** @description Authentication required */
11750
+ 401: {
11751
+ headers: {
11752
+ [name: string]: unknown;
11753
+ };
11754
+ content?: never;
11755
+ };
11756
+ /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
11757
+ 403: {
11758
+ headers: {
11759
+ [name: string]: unknown;
11760
+ };
11761
+ content?: never;
11762
+ };
11763
+ /** @description Authenticated application not found (gRPC: NOT_FOUND) */
11764
+ 404: {
11765
+ headers: {
11766
+ [name: string]: unknown;
11767
+ };
11768
+ content?: never;
11769
+ };
11770
+ /** @description Internal server error */
11771
+ 500: {
11772
+ headers: {
11773
+ [name: string]: unknown;
11774
+ };
11775
+ content?: never;
11776
+ };
11777
+ };
11778
+ };
11779
+ list_buildercode_payouts: {
11780
+ parameters: {
11781
+ query?: {
11782
+ /** @description Page number (1-indexed) */
11783
+ page?: number;
11784
+ /** @description Items per page (max 100) */
11785
+ pageSize?: number;
11786
+ /** @description Only return BuilderCodes payouts of this payout kind: REVENUE_SHARE (the frontend's share of Monaco's fee) or BUILDER_FEE (the frontend's own builder fee). Omit for every kind. */
11787
+ kind?: "REVENUE_SHARE" | "BUILDER_FEE";
11788
+ };
11789
+ header?: never;
11790
+ path?: never;
11791
+ cookie?: never;
11792
+ };
11793
+ requestBody?: never;
11794
+ responses: {
11795
+ /** @description OK */
11796
+ 200: {
11797
+ headers: {
11798
+ [name: string]: unknown;
11799
+ };
11800
+ content: {
11801
+ "application/json": components["schemas"]["ListBuildercodePayoutsResponse"];
11802
+ };
11803
+ };
11804
+ /** @description Invalid pagination */
11805
+ 400: {
11806
+ headers: {
11807
+ [name: string]: unknown;
11808
+ };
11809
+ content?: never;
11810
+ };
11811
+ /** @description Authentication required */
11812
+ 401: {
11813
+ headers: {
11814
+ [name: string]: unknown;
11815
+ };
11816
+ content?: never;
11817
+ };
11818
+ /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
11819
+ 403: {
11820
+ headers: {
11821
+ [name: string]: unknown;
11822
+ };
11823
+ content?: never;
11824
+ };
11825
+ /** @description Authenticated application not found (gRPC: NOT_FOUND) */
11826
+ 404: {
11827
+ headers: {
11828
+ [name: string]: unknown;
11829
+ };
11830
+ content?: never;
11831
+ };
11832
+ /** @description Internal server error */
11833
+ 500: {
11834
+ headers: {
11835
+ [name: string]: unknown;
11836
+ };
11837
+ content?: never;
11838
+ };
11839
+ };
11840
+ };
11841
+ get_buildercode_payout_summary: {
11842
+ parameters: {
11843
+ query?: never;
11844
+ header?: never;
11845
+ path?: never;
11846
+ cookie?: never;
11847
+ };
11848
+ requestBody?: never;
11849
+ responses: {
11850
+ /** @description OK */
11851
+ 200: {
11852
+ headers: {
11853
+ [name: string]: unknown;
11854
+ };
11855
+ content: {
11856
+ "application/json": components["schemas"]["GetBuildercodePayoutSummaryResponse"];
11857
+ };
11858
+ };
11859
+ /** @description Authentication required */
11860
+ 401: {
11861
+ headers: {
11862
+ [name: string]: unknown;
11863
+ };
11864
+ content?: never;
11865
+ };
11866
+ /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
11867
+ 403: {
11868
+ headers: {
11869
+ [name: string]: unknown;
11870
+ };
11871
+ content?: never;
11872
+ };
11873
+ /** @description Authenticated application not found (gRPC: NOT_FOUND) */
11874
+ 404: {
11875
+ headers: {
11876
+ [name: string]: unknown;
11877
+ };
11878
+ content?: never;
11879
+ };
11880
+ /** @description Internal server error */
11881
+ 500: {
11882
+ headers: {
11883
+ [name: string]: unknown;
11884
+ };
11885
+ content?: never;
11886
+ };
11887
+ };
11888
+ };
11889
+ get_buildercode_rewards_balance: {
11890
+ parameters: {
11891
+ query?: never;
11892
+ header?: never;
11893
+ path?: never;
11894
+ cookie?: never;
11895
+ };
11896
+ requestBody?: never;
11897
+ responses: {
11898
+ /** @description OK */
11899
+ 200: {
11900
+ headers: {
11901
+ [name: string]: unknown;
11902
+ };
11903
+ content: {
11904
+ "application/json": components["schemas"]["GetBuildercodeRewardsBalanceResponse"];
11905
+ };
11906
+ };
11907
+ /** @description Authentication required */
11908
+ 401: {
11909
+ headers: {
11910
+ [name: string]: unknown;
11911
+ };
11912
+ content?: never;
11913
+ };
11914
+ /** @description Refused: BuilderCodes is disabled or the caller is delegated (gRPC: PERMISSION_DENIED) */
11915
+ 403: {
11916
+ headers: {
11917
+ [name: string]: unknown;
11918
+ };
11919
+ content?: never;
11920
+ };
11921
+ /** @description Internal server error */
11922
+ 500: {
11923
+ headers: {
11924
+ [name: string]: unknown;
11925
+ };
11926
+ content?: never;
11927
+ };
11928
+ };
11929
+ };
11930
+ claim_buildercode_rewards: {
11931
+ parameters: {
11932
+ query?: never;
11933
+ header?: never;
11934
+ path?: never;
11935
+ cookie?: never;
11936
+ };
11937
+ requestBody: {
11938
+ content: {
11939
+ "application/json": components["schemas"]["ClaimBuildercodeRewardsRequest"];
11940
+ };
11941
+ };
11942
+ responses: {
11943
+ /** @description OK */
11944
+ 200: {
11945
+ headers: {
11946
+ [name: string]: unknown;
11947
+ };
11948
+ content: {
11949
+ "application/json": components["schemas"]["ClaimBuildercodeRewardsResponse"];
11950
+ };
11951
+ };
11952
+ /** @description Invalid token or amount */
11953
+ 400: {
11954
+ headers: {
11955
+ [name: string]: unknown;
11956
+ };
11957
+ content?: never;
11958
+ };
11959
+ /** @description Authentication required */
11960
+ 401: {
11961
+ headers: {
11962
+ [name: string]: unknown;
11963
+ };
11964
+ content?: never;
11965
+ };
11966
+ /** @description Refused: BuilderCodes is not enabled, or the caller is a delegated-agent session (gRPC: PERMISSION_DENIED) */
11967
+ 403: {
11968
+ headers: {
11969
+ [name: string]: unknown;
11970
+ };
11971
+ content?: never;
11972
+ };
11973
+ /** @description Insufficient BuilderCodes payout balance, including a wallet that never accrued one (gRPC: FAILED_PRECONDITION) */
11974
+ 409: {
11975
+ headers: {
11976
+ [name: string]: unknown;
11977
+ };
11978
+ content?: never;
11979
+ };
11980
+ /** @description Internal server error */
11981
+ 500: {
11982
+ headers: {
11983
+ [name: string]: unknown;
11984
+ };
11985
+ content?: never;
11986
+ };
11987
+ /** @description Matching engine unavailable or slow to answer. Outcome UNKNOWN, not a rejection — the claim may still commit and there is no idempotency key, so treat it as pending and do not retry automatically; a balance read does not settle it, because an admitted claim may still be queued. Two tagged cases are the exception, both refused before the claim can be admitted and so provably non-committing, and both safe to retry: a maintenance block (`error: OPERATIONS_BLOCKED`; gRPC metadata `x-maintenance-blocked: true`) and a sequencer overload (`code: OVERLOADED`) (gRPC: UNAVAILABLE) */
11988
+ 503: {
11989
+ headers: {
11990
+ [name: string]: unknown;
11991
+ };
11992
+ content?: never;
11993
+ };
11994
+ };
11995
+ };
11996
+ list_my_follows: {
11997
+ parameters: {
11998
+ query?: {
11999
+ /** @description Items per page (max 1000) */
12000
+ pageSize?: number;
12001
+ /**
12002
+ * @description Opaque cursor from a previous response's `nextPageToken`; omit for the
12003
+ * first page.
12004
+ */
12005
+ pageToken?: string;
12006
+ };
12007
+ header?: never;
12008
+ path?: never;
12009
+ cookie?: never;
12010
+ };
12011
+ requestBody?: never;
12012
+ responses: {
12013
+ /** @description OK */
12014
+ 200: {
12015
+ headers: {
12016
+ [name: string]: unknown;
12017
+ };
12018
+ content: {
12019
+ "application/json": components["schemas"]["ListMyFollowsResponse"];
12020
+ };
12021
+ };
12022
+ /** @description Invalid query parameters or page token */
12023
+ 400: {
12024
+ headers: {
12025
+ [name: string]: unknown;
12026
+ };
12027
+ content?: never;
12028
+ };
12029
+ /** @description Authentication required */
12030
+ 401: {
12031
+ headers: {
12032
+ [name: string]: unknown;
12033
+ };
12034
+ content?: never;
12035
+ };
12036
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12037
+ 429: {
12038
+ headers: {
12039
+ [name: string]: unknown;
12040
+ };
12041
+ content?: never;
12042
+ };
12043
+ /** @description Internal server error */
12044
+ 500: {
12045
+ headers: {
12046
+ [name: string]: unknown;
12047
+ };
12048
+ content?: never;
12049
+ };
12050
+ };
12051
+ };
12052
+ upsert_follow: {
12053
+ parameters: {
12054
+ query?: never;
12055
+ header?: never;
12056
+ path?: never;
12057
+ cookie?: never;
12058
+ };
12059
+ requestBody: {
12060
+ content: {
12061
+ "application/json": components["schemas"]["UpsertFollowRequest"];
12062
+ };
12063
+ };
12064
+ responses: {
12065
+ /** @description OK */
12066
+ 200: {
12067
+ headers: {
12068
+ [name: string]: unknown;
12069
+ };
12070
+ content: {
12071
+ "application/json": components["schemas"]["UpsertFollowResponse"];
12072
+ };
12073
+ };
12074
+ /** @description Invalid request, or refused by a follow rule (the message names the rule) */
12075
+ 400: {
12076
+ headers: {
12077
+ [name: string]: unknown;
12078
+ };
12079
+ content?: never;
12080
+ };
12081
+ /** @description Authentication required */
12082
+ 401: {
12083
+ headers: {
12084
+ [name: string]: unknown;
12085
+ };
12086
+ content?: never;
12087
+ };
12088
+ /** @description Delegated agent or sub-account sessions cannot follow */
12089
+ 403: {
12090
+ headers: {
12091
+ [name: string]: unknown;
12092
+ };
12093
+ content?: never;
12094
+ };
12095
+ /** @description Lead trader or follow not found */
12096
+ 404: {
12097
+ headers: {
12098
+ [name: string]: unknown;
12099
+ };
12100
+ content?: never;
12101
+ };
12102
+ /** @description Copy trading is not available */
12103
+ 409: {
12104
+ headers: {
12105
+ [name: string]: unknown;
12106
+ };
12107
+ content?: never;
12108
+ };
12109
+ /** @description Internal server error */
12110
+ 500: {
12111
+ headers: {
12112
+ [name: string]: unknown;
12113
+ };
12114
+ content?: never;
12115
+ };
12116
+ /** @description Matching engine unavailable; retry */
12117
+ 503: {
12118
+ headers: {
12119
+ [name: string]: unknown;
12120
+ };
12121
+ content?: never;
12122
+ };
12123
+ };
12124
+ };
12125
+ preview_follow: {
12126
+ parameters: {
12127
+ query?: never;
12128
+ header?: never;
12129
+ path?: never;
12130
+ cookie?: never;
12131
+ };
12132
+ requestBody: {
12133
+ content: {
12134
+ "application/json": components["schemas"]["PreviewFollowRequest"];
12135
+ };
12136
+ };
12137
+ responses: {
12138
+ /** @description OK */
12139
+ 200: {
12140
+ headers: {
12141
+ [name: string]: unknown;
12142
+ };
12143
+ content: {
12144
+ "application/json": components["schemas"]["PreviewFollowResponse"];
12145
+ };
12146
+ };
12147
+ /** @description Invalid request, or terms a follow would refuse (the message names the rule) */
12148
+ 400: {
12149
+ headers: {
12150
+ [name: string]: unknown;
12151
+ };
12152
+ content?: never;
12153
+ };
12154
+ /** @description Authentication required */
12155
+ 401: {
12156
+ headers: {
12157
+ [name: string]: unknown;
12158
+ };
12159
+ content?: never;
12160
+ };
12161
+ /** @description Delegated agent or sub-account sessions cannot follow */
12162
+ 403: {
12163
+ headers: {
12164
+ [name: string]: unknown;
12165
+ };
12166
+ content?: never;
12167
+ };
12168
+ /** @description Lead trader not found */
12169
+ 404: {
12170
+ headers: {
12171
+ [name: string]: unknown;
12172
+ };
12173
+ content?: never;
12174
+ };
12175
+ /** @description Copy trading is not available */
12176
+ 409: {
12177
+ headers: {
12178
+ [name: string]: unknown;
12179
+ };
12180
+ content?: never;
12181
+ };
12182
+ /** @description Read or order-risk preview rate limit exceeded; retry after the interval in details.retryAfter */
12183
+ 429: {
12184
+ headers: {
12185
+ [name: string]: unknown;
12186
+ };
12187
+ content?: never;
12188
+ };
12189
+ /** @description Internal server error */
12190
+ 500: {
12191
+ headers: {
12192
+ [name: string]: unknown;
12193
+ };
12194
+ content?: never;
12195
+ };
12196
+ /** @description Matching engine unavailable or its preview capacity is busy; retry */
12197
+ 503: {
12198
+ headers: {
12199
+ [name: string]: unknown;
12200
+ };
12201
+ content?: never;
12202
+ };
12203
+ };
12204
+ };
12205
+ get_follow: {
12206
+ parameters: {
12207
+ query?: never;
12208
+ header?: never;
12209
+ path: {
12210
+ followId: string;
12211
+ };
12212
+ cookie?: never;
12213
+ };
12214
+ requestBody?: never;
12215
+ responses: {
12216
+ /** @description OK */
12217
+ 200: {
12218
+ headers: {
12219
+ [name: string]: unknown;
12220
+ };
12221
+ content: {
12222
+ "application/json": components["schemas"]["GetFollowResponse"];
12223
+ };
12224
+ };
12225
+ /** @description Invalid follow id */
12226
+ 400: {
12227
+ headers: {
12228
+ [name: string]: unknown;
12229
+ };
12230
+ content?: never;
12231
+ };
12232
+ /** @description Authentication required */
12233
+ 401: {
12234
+ headers: {
12235
+ [name: string]: unknown;
12236
+ };
12237
+ content?: never;
10692
12238
  };
10693
- /** @description Bad request */
10694
- 400: {
12239
+ /** @description Follow not found */
12240
+ 404: {
10695
12241
  headers: {
10696
12242
  [name: string]: unknown;
10697
12243
  };
10698
12244
  content?: never;
10699
12245
  };
10700
- /** @description Unauthorized - Invalid or missing x-server-key */
10701
- 401: {
12246
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12247
+ 429: {
10702
12248
  headers: {
10703
12249
  [name: string]: unknown;
10704
12250
  };
@@ -10713,18 +12259,16 @@ export interface operations {
10713
12259
  };
10714
12260
  };
10715
12261
  };
10716
- create_challenge: {
12262
+ list_follow_leader_positions: {
10717
12263
  parameters: {
10718
12264
  query?: never;
10719
12265
  header?: never;
10720
- path?: never;
10721
- cookie?: never;
10722
- };
10723
- requestBody: {
10724
- content: {
10725
- "application/json": components["schemas"]["ChallengeRequest"];
12266
+ path: {
12267
+ followId: string;
10726
12268
  };
12269
+ cookie?: never;
10727
12270
  };
12271
+ requestBody?: never;
10728
12272
  responses: {
10729
12273
  /** @description OK */
10730
12274
  200: {
@@ -10732,31 +12276,38 @@ export interface operations {
10732
12276
  [name: string]: unknown;
10733
12277
  };
10734
12278
  content: {
10735
- "application/json": components["schemas"]["ChallengeResponse"];
12279
+ "application/json": components["schemas"]["ListFollowLeaderPositionsResponse"];
10736
12280
  };
10737
12281
  };
10738
- /** @description Invalid request parameters */
12282
+ /** @description Invalid follow id */
10739
12283
  400: {
10740
12284
  headers: {
10741
12285
  [name: string]: unknown;
10742
12286
  };
10743
12287
  content?: never;
10744
12288
  };
10745
- /** @description Origin not allowed for this application */
12289
+ /** @description Authentication required */
12290
+ 401: {
12291
+ headers: {
12292
+ [name: string]: unknown;
12293
+ };
12294
+ content?: never;
12295
+ };
12296
+ /** @description The follow is stopped */
10746
12297
  403: {
10747
12298
  headers: {
10748
12299
  [name: string]: unknown;
10749
12300
  };
10750
12301
  content?: never;
10751
12302
  };
10752
- /** @description Invalid clientId */
12303
+ /** @description Follow not found */
10753
12304
  404: {
10754
12305
  headers: {
10755
12306
  [name: string]: unknown;
10756
12307
  };
10757
12308
  content?: never;
10758
12309
  };
10759
- /** @description Authentication rate limit exceeded — challenge and verify share one per-client-address budget (60 requests/min sustained, burst 120); retry after the interval in details.retryAfter */
12310
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10760
12311
  429: {
10761
12312
  headers: {
10762
12313
  [name: string]: unknown;
@@ -10770,20 +12321,25 @@ export interface operations {
10770
12321
  };
10771
12322
  content?: never;
10772
12323
  };
12324
+ /** @description Matching engine unavailable; retry */
12325
+ 503: {
12326
+ headers: {
12327
+ [name: string]: unknown;
12328
+ };
12329
+ content?: never;
12330
+ };
10773
12331
  };
10774
12332
  };
10775
- refresh_session: {
12333
+ stop_follow: {
10776
12334
  parameters: {
10777
12335
  query?: never;
10778
12336
  header?: never;
10779
- path?: never;
10780
- cookie?: never;
10781
- };
10782
- requestBody: {
10783
- content: {
10784
- "application/json": components["schemas"]["RefreshRequest"];
12337
+ path: {
12338
+ followId: string;
10785
12339
  };
12340
+ cookie?: never;
10786
12341
  };
12342
+ requestBody?: never;
10787
12343
  responses: {
10788
12344
  /** @description OK */
10789
12345
  200: {
@@ -10791,17 +12347,31 @@ export interface operations {
10791
12347
  [name: string]: unknown;
10792
12348
  };
10793
12349
  content: {
10794
- "application/json": components["schemas"]["RefreshResponse"];
12350
+ "application/json": components["schemas"]["StopFollowResponse"];
10795
12351
  };
10796
12352
  };
10797
- /** @description Missing, invalid, or expired session signature */
12353
+ /** @description Invalid follow id, or refused by the engine (the message names the rule) */
12354
+ 400: {
12355
+ headers: {
12356
+ [name: string]: unknown;
12357
+ };
12358
+ content?: never;
12359
+ };
12360
+ /** @description Authentication required */
10798
12361
  401: {
10799
12362
  headers: {
10800
12363
  [name: string]: unknown;
10801
12364
  };
10802
12365
  content?: never;
10803
12366
  };
10804
- /** @description Session not found */
12367
+ /** @description Delegated agent sessions cannot stop a follow */
12368
+ 403: {
12369
+ headers: {
12370
+ [name: string]: unknown;
12371
+ };
12372
+ content?: never;
12373
+ };
12374
+ /** @description Follow not found */
10805
12375
  404: {
10806
12376
  headers: {
10807
12377
  [name: string]: unknown;
@@ -10815,20 +12385,35 @@ export interface operations {
10815
12385
  };
10816
12386
  content?: never;
10817
12387
  };
12388
+ /** @description Matching engine unavailable; retry */
12389
+ 503: {
12390
+ headers: {
12391
+ [name: string]: unknown;
12392
+ };
12393
+ content?: never;
12394
+ };
10818
12395
  };
10819
12396
  };
10820
- revoke_session: {
12397
+ list_lead_traders: {
10821
12398
  parameters: {
10822
- query?: never;
12399
+ query?: {
12400
+ /** @description Metric to rank by, highest first */
12401
+ sort?: "roi" | "pnl" | "followers" | "allocated" | "win_rate";
12402
+ /** @description Stats window */
12403
+ window?: "7d" | "30d" | "90d" | "all";
12404
+ /** @description Items per page (max 100) */
12405
+ pageSize?: number;
12406
+ /**
12407
+ * @description Opaque cursor from a previous response's `nextPageToken`; omit for the
12408
+ * first page. Sort and window must match the request that produced it.
12409
+ */
12410
+ pageToken?: string;
12411
+ };
10823
12412
  header?: never;
10824
12413
  path?: never;
10825
12414
  cookie?: never;
10826
12415
  };
10827
- requestBody: {
10828
- content: {
10829
- "application/json": components["schemas"]["RevokeRequest"];
10830
- };
10831
- };
12416
+ requestBody?: never;
10832
12417
  responses: {
10833
12418
  /** @description OK */
10834
12419
  200: {
@@ -10836,30 +12421,16 @@ export interface operations {
10836
12421
  [name: string]: unknown;
10837
12422
  };
10838
12423
  content: {
10839
- "application/json": components["schemas"]["RevokeResponse"];
12424
+ "application/json": components["schemas"]["ListLeadTradersResponse"];
10840
12425
  };
10841
12426
  };
10842
- /** @description Request body must be empty */
12427
+ /** @description Invalid query parameters or page token */
10843
12428
  400: {
10844
12429
  headers: {
10845
12430
  [name: string]: unknown;
10846
12431
  };
10847
12432
  content?: never;
10848
12433
  };
10849
- /** @description Missing or invalid session signature */
10850
- 401: {
10851
- headers: {
10852
- [name: string]: unknown;
10853
- };
10854
- content?: never;
10855
- };
10856
- /** @description Session not found */
10857
- 404: {
10858
- headers: {
10859
- [name: string]: unknown;
10860
- };
10861
- content?: never;
10862
- };
10863
12434
  /** @description Internal server error */
10864
12435
  500: {
10865
12436
  headers: {
@@ -10869,18 +12440,14 @@ export interface operations {
10869
12440
  };
10870
12441
  };
10871
12442
  };
10872
- verify_signature: {
12443
+ get_my_lead_trader: {
10873
12444
  parameters: {
10874
12445
  query?: never;
10875
12446
  header?: never;
10876
12447
  path?: never;
10877
12448
  cookie?: never;
10878
12449
  };
10879
- requestBody: {
10880
- content: {
10881
- "application/json": components["schemas"]["VerifyRequest"];
10882
- };
10883
- };
12450
+ requestBody?: never;
10884
12451
  responses: {
10885
12452
  /** @description OK */
10886
12453
  200: {
@@ -10888,38 +12455,24 @@ export interface operations {
10888
12455
  [name: string]: unknown;
10889
12456
  };
10890
12457
  content: {
10891
- "application/json": components["schemas"]["VerifyResponse"];
10892
- };
10893
- };
10894
- /** @description Invalid request parameters, nonce expired, or already used */
10895
- 400: {
10896
- headers: {
10897
- [name: string]: unknown;
12458
+ "application/json": components["schemas"]["GetLeadTraderResponse"];
10898
12459
  };
10899
- content?: never;
10900
12460
  };
10901
- /** @description Invalid signature */
12461
+ /** @description Authentication required */
10902
12462
  401: {
10903
12463
  headers: {
10904
12464
  [name: string]: unknown;
10905
12465
  };
10906
12466
  content?: never;
10907
12467
  };
10908
- /** @description Origin not allowed for this application */
10909
- 403: {
10910
- headers: {
10911
- [name: string]: unknown;
10912
- };
10913
- content?: never;
10914
- };
10915
- /** @description Invalid nonce or clientId */
12468
+ /** @description You are not a lead trader */
10916
12469
  404: {
10917
12470
  headers: {
10918
12471
  [name: string]: unknown;
10919
12472
  };
10920
12473
  content?: never;
10921
12474
  };
10922
- /** @description Authentication rate limit exceeded — challenge and verify share one per-client-address budget (60 requests/min sustained, burst 120), checked before the signature; retry after the interval in details.retryAfter */
12475
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
10923
12476
  429: {
10924
12477
  headers: {
10925
12478
  [name: string]: unknown;
@@ -10933,23 +12486,20 @@ export interface operations {
10933
12486
  };
10934
12487
  content?: never;
10935
12488
  };
10936
- /** @description Contract-wallet (EIP-1271) verification could not be completed for an eligible address: the chain did not answer, did not answer within the deadline, or the server was at its concurrent-verification capacity and declined to ask. Retryable, and not a verdict on the signature. */
10937
- 503: {
10938
- headers: {
10939
- [name: string]: unknown;
10940
- };
10941
- content?: never;
10942
- };
10943
12489
  };
10944
12490
  };
10945
- get_buildercodes_config: {
12491
+ upsert_lead_trader: {
10946
12492
  parameters: {
10947
12493
  query?: never;
10948
12494
  header?: never;
10949
12495
  path?: never;
10950
12496
  cookie?: never;
10951
12497
  };
10952
- requestBody?: never;
12498
+ requestBody: {
12499
+ content: {
12500
+ "application/json": components["schemas"]["UpsertLeadTraderRequest"];
12501
+ };
12502
+ };
10953
12503
  responses: {
10954
12504
  /** @description OK */
10955
12505
  200: {
@@ -10957,9 +12507,16 @@ export interface operations {
10957
12507
  [name: string]: unknown;
10958
12508
  };
10959
12509
  content: {
10960
- "application/json": components["schemas"]["GetBuildercodesConfigResponse"];
12510
+ "application/json": components["schemas"]["UpsertLeadTraderResponse"];
10961
12511
  };
10962
12512
  };
12513
+ /** @description Invalid request, or refused by an eligibility rule such as one lead profile per wallet (the message names the rule) */
12514
+ 400: {
12515
+ headers: {
12516
+ [name: string]: unknown;
12517
+ };
12518
+ content?: never;
12519
+ };
10963
12520
  /** @description Authentication required */
10964
12521
  401: {
10965
12522
  headers: {
@@ -10967,15 +12524,15 @@ export interface operations {
10967
12524
  };
10968
12525
  content?: never;
10969
12526
  };
10970
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
12527
+ /** @description Delegated agent or sub-account sessions cannot register */
10971
12528
  403: {
10972
12529
  headers: {
10973
12530
  [name: string]: unknown;
10974
12531
  };
10975
12532
  content?: never;
10976
12533
  };
10977
- /** @description Authenticated application not found (gRPC: NOT_FOUND) */
10978
- 404: {
12534
+ /** @description Copy trading is not available */
12535
+ 409: {
10979
12536
  headers: {
10980
12537
  [name: string]: unknown;
10981
12538
  };
@@ -10988,15 +12545,25 @@ export interface operations {
10988
12545
  };
10989
12546
  content?: never;
10990
12547
  };
12548
+ /** @description Matching engine unavailable; retry */
12549
+ 503: {
12550
+ headers: {
12551
+ [name: string]: unknown;
12552
+ };
12553
+ content?: never;
12554
+ };
10991
12555
  };
10992
12556
  };
10993
- list_buildercode_payouts: {
12557
+ list_my_followers: {
10994
12558
  parameters: {
10995
12559
  query?: {
10996
- /** @description Page number (1-indexed) */
10997
- page?: number;
10998
- /** @description Items per page (max 100) */
12560
+ /** @description Items per page (max 1000) */
10999
12561
  pageSize?: number;
12562
+ /**
12563
+ * @description Opaque cursor from a previous response's `nextPageToken`; omit for the
12564
+ * first page.
12565
+ */
12566
+ pageToken?: string;
11000
12567
  };
11001
12568
  header?: never;
11002
12569
  path?: never;
@@ -11010,10 +12577,10 @@ export interface operations {
11010
12577
  [name: string]: unknown;
11011
12578
  };
11012
12579
  content: {
11013
- "application/json": components["schemas"]["ListBuildercodePayoutsResponse"];
12580
+ "application/json": components["schemas"]["ListMyFollowersResponse"];
11014
12581
  };
11015
12582
  };
11016
- /** @description Invalid pagination */
12583
+ /** @description Invalid query parameters or page token */
11017
12584
  400: {
11018
12585
  headers: {
11019
12586
  [name: string]: unknown;
@@ -11027,15 +12594,8 @@ export interface operations {
11027
12594
  };
11028
12595
  content?: never;
11029
12596
  };
11030
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
11031
- 403: {
11032
- headers: {
11033
- [name: string]: unknown;
11034
- };
11035
- content?: never;
11036
- };
11037
- /** @description Authenticated application not found (gRPC: NOT_FOUND) */
11038
- 404: {
12597
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12598
+ 429: {
11039
12599
  headers: {
11040
12600
  [name: string]: unknown;
11041
12601
  };
@@ -11050,11 +12610,13 @@ export interface operations {
11050
12610
  };
11051
12611
  };
11052
12612
  };
11053
- get_buildercode_payout_summary: {
12613
+ get_lead_trader: {
11054
12614
  parameters: {
11055
12615
  query?: never;
11056
12616
  header?: never;
11057
- path?: never;
12617
+ path: {
12618
+ leader: string;
12619
+ };
11058
12620
  cookie?: never;
11059
12621
  };
11060
12622
  requestBody?: never;
@@ -11065,24 +12627,10 @@ export interface operations {
11065
12627
  [name: string]: unknown;
11066
12628
  };
11067
12629
  content: {
11068
- "application/json": components["schemas"]["GetBuildercodePayoutSummaryResponse"];
11069
- };
11070
- };
11071
- /** @description Authentication required */
11072
- 401: {
11073
- headers: {
11074
- [name: string]: unknown;
11075
- };
11076
- content?: never;
11077
- };
11078
- /** @description Refused: BuilderCodes is disabled, the caller is delegated, or the caller is not this application's payout wallet (gRPC: PERMISSION_DENIED) */
11079
- 403: {
11080
- headers: {
11081
- [name: string]: unknown;
12630
+ "application/json": components["schemas"]["GetLeadTraderResponse"];
11082
12631
  };
11083
- content?: never;
11084
12632
  };
11085
- /** @description Authenticated application not found (gRPC: NOT_FOUND) */
12633
+ /** @description Lead trader not found */
11086
12634
  404: {
11087
12635
  headers: {
11088
12636
  [name: string]: unknown;
@@ -11098,11 +12646,21 @@ export interface operations {
11098
12646
  };
11099
12647
  };
11100
12648
  };
11101
- get_buildercode_rewards_balance: {
12649
+ list_lead_trader_closed_trades: {
11102
12650
  parameters: {
11103
- query?: never;
12651
+ query?: {
12652
+ /** @description Items per page (max 100) */
12653
+ pageSize?: number;
12654
+ /**
12655
+ * @description Opaque cursor from a previous response's `nextPageToken`; omit for the
12656
+ * first page.
12657
+ */
12658
+ pageToken?: string;
12659
+ };
11104
12660
  header?: never;
11105
- path?: never;
12661
+ path: {
12662
+ leader: string;
12663
+ };
11106
12664
  cookie?: never;
11107
12665
  };
11108
12666
  requestBody?: never;
@@ -11113,18 +12671,18 @@ export interface operations {
11113
12671
  [name: string]: unknown;
11114
12672
  };
11115
12673
  content: {
11116
- "application/json": components["schemas"]["GetBuildercodeRewardsBalanceResponse"];
12674
+ "application/json": components["schemas"]["ListLeadTraderClosedTradesResponse"];
11117
12675
  };
11118
12676
  };
11119
- /** @description Authentication required */
11120
- 401: {
12677
+ /** @description Invalid query parameters or page token */
12678
+ 400: {
11121
12679
  headers: {
11122
12680
  [name: string]: unknown;
11123
12681
  };
11124
12682
  content?: never;
11125
12683
  };
11126
- /** @description Refused: BuilderCodes is disabled or the caller is delegated (gRPC: PERMISSION_DENIED) */
11127
- 403: {
12684
+ /** @description Lead trader not found */
12685
+ 404: {
11128
12686
  headers: {
11129
12687
  [name: string]: unknown;
11130
12688
  };
@@ -11139,18 +12697,16 @@ export interface operations {
11139
12697
  };
11140
12698
  };
11141
12699
  };
11142
- claim_buildercode_rewards: {
12700
+ list_lead_trader_open_positions: {
11143
12701
  parameters: {
11144
12702
  query?: never;
11145
12703
  header?: never;
11146
- path?: never;
11147
- cookie?: never;
11148
- };
11149
- requestBody: {
11150
- content: {
11151
- "application/json": components["schemas"]["ClaimBuildercodeRewardsRequest"];
12704
+ path: {
12705
+ leader: string;
11152
12706
  };
12707
+ cookie?: never;
11153
12708
  };
12709
+ requestBody?: never;
11154
12710
  responses: {
11155
12711
  /** @description OK */
11156
12712
  200: {
@@ -11158,32 +12714,32 @@ export interface operations {
11158
12714
  [name: string]: unknown;
11159
12715
  };
11160
12716
  content: {
11161
- "application/json": components["schemas"]["ClaimBuildercodeRewardsResponse"];
12717
+ "application/json": components["schemas"]["ListLeadTraderOpenPositionsResponse"];
11162
12718
  };
11163
12719
  };
11164
- /** @description Invalid token or amount */
11165
- 400: {
12720
+ /** @description Authentication required */
12721
+ 401: {
11166
12722
  headers: {
11167
12723
  [name: string]: unknown;
11168
12724
  };
11169
12725
  content?: never;
11170
12726
  };
11171
- /** @description Authentication required */
11172
- 401: {
12727
+ /** @description Only current followers of this leader can see open positions */
12728
+ 403: {
11173
12729
  headers: {
11174
12730
  [name: string]: unknown;
11175
12731
  };
11176
12732
  content?: never;
11177
12733
  };
11178
- /** @description Refused: BuilderCodes is not enabled, or the caller is a delegated-agent session (gRPC: PERMISSION_DENIED) */
11179
- 403: {
12734
+ /** @description Lead trader not found */
12735
+ 404: {
11180
12736
  headers: {
11181
12737
  [name: string]: unknown;
11182
12738
  };
11183
12739
  content?: never;
11184
12740
  };
11185
- /** @description Insufficient BuilderCodes payout balance, including a wallet that never accrued one (gRPC: FAILED_PRECONDITION) */
11186
- 409: {
12741
+ /** @description Read rate limit exceeded — every authenticated read draws one request from the account's read budget; retry after the interval in details.retryAfter */
12742
+ 429: {
11187
12743
  headers: {
11188
12744
  [name: string]: unknown;
11189
12745
  };
@@ -11196,7 +12752,7 @@ export interface operations {
11196
12752
  };
11197
12753
  content?: never;
11198
12754
  };
11199
- /** @description Matching engine unavailable or slow to answer. Outcome UNKNOWN, not a rejection — the claim may still commit and there is no idempotency key, so treat it as pending and do not retry automatically; a balance read does not settle it, because an admitted claim may still be queued. Two tagged cases are the exception, both refused before the claim can be admitted and so provably non-committing, and both safe to retry: a maintenance block (`error: OPERATIONS_BLOCKED`; gRPC metadata `x-maintenance-blocked: true`) and a sequencer overload (`code: OVERLOADED`) (gRPC: UNAVAILABLE) */
12755
+ /** @description Matching engine unavailable; retry */
11200
12756
  503: {
11201
12757
  headers: {
11202
12758
  [name: string]: unknown;
@@ -12778,11 +14334,6 @@ export interface operations {
12778
14334
  get_orders: {
12779
14335
  parameters: {
12780
14336
  query?: {
12781
- /**
12782
- * @deprecated
12783
- * @description Deprecated: page number for legacy offset pagination (1-indexed). Use pageToken cursor pagination instead.
12784
- */
12785
- page?: number;
12786
14337
  /** @description Items per page (max 100 in page-number mode; up to 1000 when pageToken is present) */
12787
14338
  pageSize?: number;
12788
14339
  /** @description Order status (single value or comma-separated list) */
@@ -12795,21 +14346,15 @@ export interface operations {
12795
14346
  /** @description Sort direction for createdAt */
12796
14347
  orderBy?: "ASC" | "DESC";
12797
14348
  /**
12798
- * @description Pagination cursor with three distinct states:
12799
- * - Omitted: legacy page-number pagination via `page`, limited to recent
12800
- * history once the archive window is enabled.
12801
- * - Empty string (""): start a cursor walk with no prior position, from
12802
- * the newest row (or the oldest, when `orderBy` is ASC).
14349
+ * @description Pagination cursor with two states:
14350
+ * - Omitted or empty string (""): start a cursor walk with no prior
14351
+ * position, from the newest row (or the oldest, when `orderBy` is ASC).
12803
14352
  * - Non-empty: an opaque cursor from a previous response's
12804
14353
  * `next_page_token`; results resume immediately after that position.
12805
14354
  *
12806
- * In either cursor-walk state (empty or non-empty), `page` is ignored (it
12807
- * comes back as 0), but `total` and `total_pages` ARE populated — bounded by
12808
- * the server count ceiling, see `total_capped`. Results cover full order
12809
- * history — hot and archived rows merged — unlike page-number mode, which
12810
- * only ever sees recent history. Clients that need complete order history
12811
- * must use the cursor form (start with an empty string, then follow
12812
- * next_page_token) rather than `page`. Filters and orderBy must match the
14355
+ * `total` and `total_pages` are populated — bounded by the server count
14356
+ * ceiling, see `total_capped`. Every walk covers full order history — hot
14357
+ * and archived rows merged. Filters and orderBy must match the
12813
14358
  * request that produced the token.
12814
14359
  */
12815
14360
  pageToken?: string;
@@ -13246,24 +14791,17 @@ export interface operations {
13246
14791
  /** @description Trading pair identifier (UUID) */
13247
14792
  tradingPairId?: string;
13248
14793
  state?: string;
13249
- /**
13250
- * @deprecated
13251
- * @description Deprecated: page number for legacy offset pagination (1-indexed). Use pageToken cursor pagination instead.
13252
- */
13253
- page?: number;
13254
14794
  /** @description Items per page (max 100 in page-number mode; up to 1000 when pageToken is present) */
13255
14795
  pageSize?: number;
13256
14796
  /**
13257
- * @description Pagination cursor with three distinct states:
13258
- * - Omitted: legacy page-number pagination via `page`.
13259
- * - Empty string (""): start a cursor walk with no prior position, from
13260
- * the newest conditional order.
14797
+ * @description Pagination cursor with two states:
14798
+ * - Omitted or empty string (""): start a cursor walk with no prior
14799
+ * position, from the newest conditional order.
13261
14800
  * - Non-empty: an opaque cursor from a previous response's
13262
14801
  * `next_page_token`; results resume immediately after that position.
13263
14802
  *
13264
- * In either cursor-walk state (empty or non-empty), `page` is ignored and
13265
- * `total` is not populated — both come back 0, because cursor mode runs no
13266
- * COUNT (AIP-158). Cursor pages are keyset seeks on `(createdAt, id)`, so a
14803
+ * `total` is the matching row count, bounded at a server ceiling of 10,000
14804
+ * and saturating there. Pages are keyset seeks on `(createdAt, id)`, so a
13267
14805
  * page size up to 1000 is allowed. Filters must match the request that
13268
14806
  * produced the token; a token replayed against different filters is
13269
14807
  * rejected.
@@ -13357,27 +14895,20 @@ export interface operations {
13357
14895
  list_twap_orders: {
13358
14896
  parameters: {
13359
14897
  query?: {
13360
- /**
13361
- * @deprecated
13362
- * @description Deprecated: page number for legacy offset pagination (1-indexed). Use pageToken cursor pagination instead.
13363
- */
13364
- page?: number;
13365
14898
  /** @description Items per page (max 100 in page-number mode; up to 1000 when pageToken is present) */
13366
14899
  pageSize?: number;
13367
14900
  state?: string;
13368
14901
  /** @description Trading pair identifier (UUID) */
13369
14902
  tradingPairId?: string;
13370
14903
  /**
13371
- * @description Pagination cursor with three distinct states:
13372
- * - Omitted: legacy page-number pagination via `page`.
13373
- * - Empty string (""): start a cursor walk with no prior position, from
13374
- * the newest TWAP parent.
14904
+ * @description Pagination cursor with two states:
14905
+ * - Omitted or empty string (""): start a cursor walk with no prior
14906
+ * position, from the newest TWAP parent.
13375
14907
  * - Non-empty: an opaque cursor from a previous response's
13376
14908
  * `next_page_token`; results resume immediately after that position.
13377
14909
  *
13378
- * In either cursor-walk state (empty or non-empty), `page` is ignored and
13379
- * `total` is not populated — both come back 0, because cursor mode runs no
13380
- * COUNT (AIP-158). Cursor pages are keyset seeks on `(createdAt, id)`, so a
14910
+ * `total` is the matching row count, bounded at a server ceiling of 10,000
14911
+ * and saturating there. Pages are keyset seeks on `(createdAt, id)`, so a
13381
14912
  * page size up to 1000 is allowed. Filters must match the request that
13382
14913
  * produced the token; a token replayed against different filters is
13383
14914
  * rejected.
@@ -14724,8 +16255,8 @@ export interface operations {
14724
16255
  };
14725
16256
  content?: never;
14726
16257
  };
14727
- /** @description Wallet address or email already registered */
14728
- 409: {
16258
+ /** @description Public whitelist applications are closed. No applicant data is changed. */
16259
+ 403: {
14729
16260
  headers: {
14730
16261
  [name: string]: unknown;
14731
16262
  };