@dimes-dot-fi/sdk 2.4.0 → 2.7.0
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.
- package/README.md +16 -0
- package/dist/{aliases-Dne14KBa.d.cts → aliases-BI1c3Yt0.d.cts} +981 -787
- package/dist/{aliases-Dne14KBa.d.ts → aliases-BI1c3Yt0.d.ts} +981 -787
- package/dist/{chunk-KNGEIWFR.cjs → chunk-ERM4WP6D.cjs} +8 -4
- package/dist/chunk-ERM4WP6D.cjs.map +1 -0
- package/dist/{chunk-LXZAXWLO.mjs → chunk-GA7ZBK6W.mjs} +8 -4
- package/dist/chunk-GA7ZBK6W.mjs.map +1 -0
- package/dist/{chunk-Q34TMZ5J.mjs → chunk-HJ5EVO5A.mjs} +11 -6
- package/dist/chunk-HJ5EVO5A.mjs.map +1 -0
- package/dist/{chunk-IZI65LZF.cjs → chunk-L273PAD4.cjs} +14 -9
- package/dist/chunk-L273PAD4.cjs.map +1 -0
- package/dist/contract/index.cjs +1487 -136
- package/dist/contract/index.cjs.map +1 -1
- package/dist/contract/index.d.cts +135 -8
- package/dist/contract/index.d.ts +135 -8
- package/dist/contract/index.mjs +1470 -119
- package/dist/contract/index.mjs.map +1 -1
- package/dist/{dimes-client-DJ1d_p31.d.ts → dimes-client-C4SsCNrZ.d.cts} +48 -3
- package/dist/{dimes-client-D9tohawC.d.cts → dimes-client-Ckn8yRG6.d.ts} +48 -3
- package/dist/{dimes-error-E9yPAZb-.d.cts → dimes-error-BRysMNV_.d.cts} +2 -2
- package/dist/{dimes-error-hSoOierP.d.ts → dimes-error-Ke7yuX1m.d.ts} +2 -2
- package/dist/index.cjs +78 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.mjs +74 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{quote-sWguOcoJ.d.cts → quote-06n723we.d.ts} +7 -2
- package/dist/{quote-D4QunMtN.d.ts → quote-CcIqLwKb.d.cts} +7 -2
- package/dist/react/index.cjs +34 -33
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +12 -8
- package/dist/react/index.d.ts +12 -8
- package/dist/react/index.mjs +7 -6
- package/dist/react/index.mjs.map +1 -1
- package/dist/{types-Bvj_WDbX.d.cts → types-B881zrxm.d.cts} +1 -1
- package/dist/{types-BHU4Qq7e.d.ts → types-CcoiGMbT.d.ts} +1 -1
- package/dist/ws/index.d.cts +3 -3
- package/dist/ws/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunk-IZI65LZF.cjs.map +0 -1
- package/dist/chunk-KNGEIWFR.cjs.map +0 -1
- package/dist/chunk-LXZAXWLO.mjs.map +0 -1
- package/dist/chunk-Q34TMZ5J.mjs.map +0 -1
|
@@ -43,1222 +43,1292 @@ interface components {
|
|
|
43
43
|
*/
|
|
44
44
|
polygon_vault_contract_address: string;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
CustomerPositionEntry: {
|
|
47
47
|
/**
|
|
48
|
-
* @description
|
|
49
|
-
* @example
|
|
48
|
+
* @description Entry collateral actually charged, formatted as USD. On a partial fill the vault refunds the unused share at open, and this is net of that refund.
|
|
49
|
+
* @example 2.50
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
collateral_usd: string;
|
|
52
52
|
/**
|
|
53
|
-
* @description
|
|
54
|
-
* @example
|
|
53
|
+
* @description Entry collateral actually charged, in USD pips (10000 pips = $1). On a partial fill the vault refunds the unused share at open, and this is net of that refund.
|
|
54
|
+
* @example 25000
|
|
55
55
|
*/
|
|
56
|
-
|
|
57
|
-
};
|
|
58
|
-
CustomerFeeRatesMarket: {
|
|
56
|
+
collateral_usd_pips: string;
|
|
59
57
|
/**
|
|
60
|
-
* @description
|
|
61
|
-
* @example
|
|
58
|
+
* @description Entry leverage in basis points (20000 = 2x)
|
|
59
|
+
* @example 20000
|
|
62
60
|
*/
|
|
63
|
-
|
|
61
|
+
leverage_bps: number;
|
|
64
62
|
/**
|
|
65
|
-
* @description
|
|
66
|
-
* @example
|
|
63
|
+
* @description Risk mode the position was opened in. adaptive: the live risk engine manages leverage. committed: the position follows the planned unwinds fixed at quote time.
|
|
64
|
+
* @example adaptive
|
|
65
|
+
* @enum {string}
|
|
67
66
|
*/
|
|
68
|
-
|
|
67
|
+
risk_mode: "adaptive" | "committed";
|
|
69
68
|
/**
|
|
70
|
-
* @description
|
|
71
|
-
* @example
|
|
69
|
+
* @description Extra margin locked in the vault on top of collateral, formatted as USD. Zero on adaptive positions.
|
|
70
|
+
* @example 0.00
|
|
72
71
|
*/
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
CustomerFeeRates: {
|
|
76
|
-
/** @description Per-market venue fee fields. Only present when the request includes a `ticker` query parameter. */
|
|
77
|
-
market?: components["schemas"]["CustomerFeeRatesMarket"];
|
|
78
|
-
/** @description Leverage-tiered protocol origination fee schedule. Resolve a leverage to its fee by picking the first tier whose `maxLeverageBps >= leverageBps` (the last tier is the catch-all). */
|
|
79
|
-
origination_fee_tiers: components["schemas"]["CustomerOriginationFeeTier"][];
|
|
72
|
+
locked_margin_usd: string;
|
|
80
73
|
/**
|
|
81
|
-
* @description
|
|
82
|
-
* @example
|
|
74
|
+
* @description Extra margin locked in the vault on top of collateral, in USDC units (1,000,000 units = 1 USDC). Zero on adaptive positions.
|
|
75
|
+
* @example 0
|
|
83
76
|
*/
|
|
84
|
-
|
|
77
|
+
locked_margin_usdc_units: string;
|
|
85
78
|
/**
|
|
86
|
-
* @description
|
|
87
|
-
* @example
|
|
79
|
+
* @description Entry notional formatted as USD
|
|
80
|
+
* @example 5.00
|
|
88
81
|
*/
|
|
89
|
-
|
|
82
|
+
notional_usd: string;
|
|
90
83
|
/**
|
|
91
|
-
* @description
|
|
92
|
-
* @example
|
|
84
|
+
* @description Entry notional in USD pips
|
|
85
|
+
* @example 50000
|
|
93
86
|
*/
|
|
94
|
-
|
|
87
|
+
notional_usd_pips: string;
|
|
95
88
|
/**
|
|
96
|
-
* @description
|
|
97
|
-
* @example
|
|
89
|
+
* @description Time in milliseconds from position creation to on-chain open confirmation. Null until the position is fully opened on chain.
|
|
90
|
+
* @example 12500
|
|
98
91
|
*/
|
|
99
|
-
|
|
92
|
+
open_latency_ms?: number | null;
|
|
100
93
|
/**
|
|
101
|
-
* @description
|
|
102
|
-
* @example
|
|
94
|
+
* @description ISO 8601 timestamp when position was opened
|
|
95
|
+
* @example 2025-01-15T10:30:00.000Z
|
|
103
96
|
*/
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
FeeReportBody: {
|
|
97
|
+
opened_at?: string;
|
|
107
98
|
/**
|
|
108
|
-
* @description
|
|
109
|
-
* @example
|
|
99
|
+
* @description Combined origination fee in basis points. `protocolOriginationFeeBps + partnerOriginationFeeBps === originationFeeBps`.
|
|
100
|
+
* @example 100
|
|
110
101
|
*/
|
|
111
|
-
|
|
102
|
+
origination_fee_bps: number;
|
|
112
103
|
/**
|
|
113
|
-
* @description
|
|
114
|
-
* @example
|
|
104
|
+
* @description Protocol portion of the origination fee in basis points. `protocolOriginationFeeBps + partnerOriginationFeeBps === originationFeeBps`.
|
|
105
|
+
* @example 80
|
|
115
106
|
*/
|
|
116
|
-
|
|
107
|
+
protocol_origination_fee_bps: number;
|
|
117
108
|
/**
|
|
118
|
-
* @description
|
|
119
|
-
* @example
|
|
109
|
+
* @description Partner portion of the origination fee in basis points. `protocolOriginationFeeBps + partnerOriginationFeeBps === originationFeeBps`.
|
|
110
|
+
* @example 20
|
|
120
111
|
*/
|
|
121
|
-
|
|
112
|
+
partner_origination_fee_bps: number;
|
|
122
113
|
/**
|
|
123
|
-
* @description
|
|
124
|
-
* @
|
|
114
|
+
* @description Origination fee actually charged, formatted as USD. On a partial fill the vault refunds the unused share of the reserved fee at open, and this is net of that refund.
|
|
115
|
+
* @example 0.05
|
|
125
116
|
*/
|
|
126
|
-
|
|
117
|
+
origination_fee_usd: string;
|
|
127
118
|
/**
|
|
128
|
-
* @description
|
|
129
|
-
* @example
|
|
119
|
+
* @description Origination fee actually charged, in USD pips. On a partial fill this is net of the open-time refund.
|
|
120
|
+
* @example 500
|
|
130
121
|
*/
|
|
131
|
-
|
|
132
|
-
};
|
|
133
|
-
CustomerFeeReport: {
|
|
122
|
+
origination_fee_usd_pips: string;
|
|
134
123
|
/**
|
|
135
|
-
* @description
|
|
136
|
-
* @example
|
|
124
|
+
* @description Entry price formatted as USD
|
|
125
|
+
* @example 0.50
|
|
137
126
|
*/
|
|
138
|
-
|
|
127
|
+
price_usd: string;
|
|
139
128
|
/**
|
|
140
|
-
* @description
|
|
141
|
-
* @
|
|
129
|
+
* @description Entry price in USD pips
|
|
130
|
+
* @example 5000
|
|
142
131
|
*/
|
|
143
|
-
|
|
132
|
+
price_usd_pips: string;
|
|
144
133
|
/**
|
|
145
|
-
* @description
|
|
146
|
-
* @example
|
|
134
|
+
* @description Effective entry price (actual fill price on the prediction market) formatted as USD, computed as the notional actually spent divided by the tokens actually delivered. On a partial fill this reflects the filled portion only, so it never exceeds $1.00. Null until the fill is recorded on chain.
|
|
135
|
+
* @example 0.5025
|
|
147
136
|
*/
|
|
148
|
-
|
|
137
|
+
effective_entry_price_usd?: string | null;
|
|
149
138
|
/**
|
|
150
|
-
* @description
|
|
151
|
-
* @example
|
|
139
|
+
* @description Effective entry price in USD pips. Null until the fill is recorded on chain.
|
|
140
|
+
* @example 5025
|
|
152
141
|
*/
|
|
153
|
-
|
|
142
|
+
effective_entry_price_usd_pips?: string | null;
|
|
154
143
|
/**
|
|
155
|
-
* @description
|
|
156
|
-
* @example
|
|
144
|
+
* @description Execution slippage between the offer's indicative entry price and the actual fill price, in basis points. Signed: positive means the fill was worse than the quote, negative means the fill was better. Null until the fill is recorded on chain.
|
|
145
|
+
* @example 50
|
|
157
146
|
*/
|
|
158
|
-
|
|
147
|
+
effective_slippage_bps?: number | null;
|
|
159
148
|
/**
|
|
160
|
-
* @description
|
|
161
|
-
* @example
|
|
149
|
+
* @description Original position token units delivered when the position opened (1000000 units = 1 token). Unlike `current.positionTokenUnits` (the live, possibly partially-closed survivor), this is the fixed size credited at open and is the basis for the partial-close minimum. Null until the open fill is recorded on chain.
|
|
150
|
+
* @example 10000000
|
|
162
151
|
*/
|
|
163
|
-
|
|
152
|
+
position_token_units?: string | null;
|
|
164
153
|
/**
|
|
165
|
-
* @description
|
|
166
|
-
* @example
|
|
154
|
+
* @description How much of the requested size was actually filled when the position opened, in basis points (10000 = 100%). Computed as actual open notional / requested notional and FROZEN at open — it does NOT change when the position is partially closed. Use this for an 'opened at X% of requested' badge. Null until the open fill is recorded on chain.
|
|
155
|
+
* @example 9657
|
|
167
156
|
*/
|
|
168
|
-
|
|
157
|
+
initial_fill_bps?: number | null;
|
|
158
|
+
};
|
|
159
|
+
CustomerPositionFailure: {
|
|
169
160
|
/**
|
|
170
|
-
* @description
|
|
171
|
-
* @example
|
|
161
|
+
* @description Failure reason code
|
|
162
|
+
* @example price_exceeded_tolerance
|
|
172
163
|
*/
|
|
173
|
-
|
|
164
|
+
reason: string;
|
|
165
|
+
};
|
|
166
|
+
CustomerPositionUnwind: {
|
|
174
167
|
/**
|
|
175
|
-
* @description
|
|
176
|
-
* @example
|
|
168
|
+
* @description executed: an unwind that landed on-chain, as recorded by the deleveraging itself. planned: a committed-mode rung that fires if the price reaches triggerPriceUsdPips. triggered: a committed-mode rung whose trigger price was reached, stamped with executedAt. superseded: a committed-mode rung that can no longer fire because a partial close already took the position below its target leverage. Rung rows (planned, triggered, superseded) are the signed ladder and are only returned when the request asks for them; they describe what was promised, while executed rows describe what actually happened.
|
|
169
|
+
* @example executed
|
|
170
|
+
* @enum {string}
|
|
177
171
|
*/
|
|
178
|
-
|
|
172
|
+
status: "executed" | "planned" | "superseded" | "triggered";
|
|
179
173
|
/**
|
|
180
|
-
* @description
|
|
181
|
-
* @example
|
|
174
|
+
* @description The market signal that triggered the risk-model inference behind this unwind (e.g. `spread_blowout`, `depth_decay`, `price_drop_severe`). Null for unwinds not tied to an inference run, such as manually triggered deleveraging.
|
|
175
|
+
* @example spread_blowout
|
|
176
|
+
* @enum {string|null}
|
|
182
177
|
*/
|
|
183
|
-
|
|
178
|
+
reason?: "activity_surge" | "cancel_acceleration" | "crypto_move" | "depth_decay" | "depth_drain" | "depth_entry_drain" | "game_start" | "large_holder" | "last_trade_divergence" | "lead_change" | "post_hard_exit_losing" | "position_exposure" | "price_drop_full_exit" | "price_drop_moderate" | "price_drop_severe" | "price_drop_warning" | "spread_blowout" | "spread_spike" | "spread_warning" | "stale_refresh" | "unknown" | null;
|
|
184
179
|
/**
|
|
185
|
-
* @description
|
|
186
|
-
* @example
|
|
180
|
+
* @description Leverage after unwind in basis points (20000 = 2x)
|
|
181
|
+
* @example 30000
|
|
187
182
|
*/
|
|
188
|
-
|
|
183
|
+
after_leverage_bps: number;
|
|
189
184
|
/**
|
|
190
|
-
* @description
|
|
191
|
-
* @example
|
|
185
|
+
* @description Leverage before unwind in basis points (20000 = 2x)
|
|
186
|
+
* @example 60000
|
|
192
187
|
*/
|
|
193
|
-
|
|
188
|
+
before_leverage_bps: number;
|
|
194
189
|
/**
|
|
195
|
-
* @description
|
|
196
|
-
* @example
|
|
190
|
+
* @description ISO 8601 timestamp when the unwind was executed on-chain. Null on planned unwinds, which have not happened yet.
|
|
191
|
+
* @example 2025-06-02T14:30:00.000Z
|
|
197
192
|
*/
|
|
198
|
-
|
|
193
|
+
executed_at?: string | null;
|
|
199
194
|
/**
|
|
200
|
-
* @description
|
|
201
|
-
* @example
|
|
195
|
+
* @description Price at which this planned unwind fires, formatted as USD. Null on executed unwinds.
|
|
196
|
+
* @example 0.42
|
|
202
197
|
*/
|
|
203
|
-
|
|
198
|
+
trigger_price_usd?: string | null;
|
|
204
199
|
/**
|
|
205
|
-
* @description
|
|
206
|
-
* @example
|
|
200
|
+
* @description Price at which this planned unwind fires, in USD pips (10000 pips = $1). Null on executed unwinds.
|
|
201
|
+
* @example 4200
|
|
207
202
|
*/
|
|
208
|
-
|
|
203
|
+
trigger_price_usd_pips?: string | null;
|
|
209
204
|
/**
|
|
210
|
-
* @description
|
|
211
|
-
* @example
|
|
205
|
+
* @description Human-readable explanation of `reason` — a customer-facing sentence describing the market condition that triggered this deleverage. Null whenever `reason` is null.
|
|
206
|
+
* @example The bid-ask spread widened sharply beyond its recent baseline, signalling thinning liquidity.
|
|
212
207
|
*/
|
|
213
|
-
|
|
208
|
+
reason_detail?: string | null;
|
|
209
|
+
};
|
|
210
|
+
CustomerPositionUnwindList: {
|
|
211
|
+
data: components["schemas"]["CustomerPositionUnwind"][];
|
|
212
|
+
has_more: boolean;
|
|
213
|
+
total_count?: number;
|
|
214
214
|
/**
|
|
215
|
-
* @description
|
|
216
|
-
* @example
|
|
215
|
+
* @description Current leverage of the position in basis points (20000 = 2x), null if not yet calculated
|
|
216
|
+
* @example 30000
|
|
217
217
|
*/
|
|
218
|
-
|
|
218
|
+
current_leverage_bps: number | null;
|
|
219
219
|
/**
|
|
220
|
-
* @description
|
|
221
|
-
* @example
|
|
220
|
+
* @description ISO 8601 timestamp when the position was opened on-chain (null if not yet opened)
|
|
221
|
+
* @example 2025-06-01T12:00:00.000Z
|
|
222
222
|
*/
|
|
223
|
-
|
|
223
|
+
originated_at: string | null;
|
|
224
|
+
/**
|
|
225
|
+
* @description Leverage at position origination in basis points (20000 = 2x)
|
|
226
|
+
* @example 60000
|
|
227
|
+
*/
|
|
228
|
+
origination_leverage_bps: number;
|
|
224
229
|
};
|
|
225
|
-
|
|
230
|
+
CustomerCloseAttempt: {
|
|
226
231
|
/**
|
|
227
|
-
* @description
|
|
228
|
-
* @
|
|
232
|
+
* @description Outcome of the close attempt. `deferred` means the close could not complete yet and was postponed.
|
|
233
|
+
* @enum {string}
|
|
229
234
|
*/
|
|
230
|
-
|
|
235
|
+
outcome: "deferred";
|
|
231
236
|
/**
|
|
232
|
-
* @description
|
|
233
|
-
* @
|
|
237
|
+
* @description Why the close was deferred. `awaiting_settlement`: the market resolved before the position could be sold, so the remaining tokens will be redeemed when the market settles rather than sold on the order book.
|
|
238
|
+
* @enum {string}
|
|
234
239
|
*/
|
|
235
|
-
|
|
240
|
+
reason: "awaiting_settlement";
|
|
236
241
|
/**
|
|
237
|
-
* @description
|
|
238
|
-
* @example
|
|
242
|
+
* @description ISO-8601 timestamp of when the close was requested.
|
|
243
|
+
* @example 2026-06-15T17:27:11.736Z
|
|
239
244
|
*/
|
|
240
|
-
|
|
245
|
+
deferred_at: string;
|
|
246
|
+
};
|
|
247
|
+
CustomerPendingOperation: {
|
|
241
248
|
/**
|
|
242
|
-
* @description
|
|
243
|
-
* @
|
|
249
|
+
* @description The lifecycle operation currently in flight on this position. Present whenever the position is mid-operation (open, close, partial close, unwind, liquidate, or settle); null when the position is at rest. Note `status` stays `open` throughout a `partial_close`, so this is the only signal a slice is in flight after a reload.
|
|
250
|
+
* @enum {string}
|
|
244
251
|
*/
|
|
245
|
-
|
|
252
|
+
type: "open" | "close" | "partial_close" | "unwind" | "liquidate" | "settle";
|
|
246
253
|
/**
|
|
247
|
-
* @description
|
|
248
|
-
* @example
|
|
254
|
+
* @description Sub-state of the operation: `requested` (submitted, not yet executing), `initiated` (executing on the venue), `pending` (tokens withdrawn, finalizing on chain), `awaiting_settlement` (a close deferred until the market settles). Null when the operation has no distinct phase.
|
|
255
|
+
* @example initiated
|
|
256
|
+
* @enum {string|null}
|
|
249
257
|
*/
|
|
250
|
-
|
|
258
|
+
phase?: "requested" | "initiated" | "pending" | "awaiting_settlement" | null;
|
|
251
259
|
/**
|
|
252
|
-
* @description
|
|
253
|
-
* @example
|
|
260
|
+
* @description Token units involved in the in-flight operation (1000000 units = 1 token). For `partial_close` this is the slice being closed; for `close`/`liquidate` the units withdrawn; for the awaiting-settlement close the remaining tokens. Null when the operation carries no specific token amount.
|
|
261
|
+
* @example 5000000
|
|
254
262
|
*/
|
|
255
|
-
|
|
263
|
+
token_units?: string | null;
|
|
256
264
|
};
|
|
257
|
-
|
|
265
|
+
CustomerPositionCurrent: {
|
|
258
266
|
/**
|
|
259
|
-
* @description
|
|
260
|
-
* @example
|
|
267
|
+
* @description Current book-value leverage in basis points (20000 = 2x)
|
|
268
|
+
* @example 18000
|
|
261
269
|
*/
|
|
262
|
-
|
|
270
|
+
book_leverage_bps: number;
|
|
263
271
|
/**
|
|
264
|
-
* @description
|
|
265
|
-
* @example
|
|
272
|
+
* @description Current collateral formatted as USD
|
|
273
|
+
* @example 2.50
|
|
266
274
|
*/
|
|
267
|
-
|
|
268
|
-
};
|
|
269
|
-
CustomerFees: {
|
|
275
|
+
collateral_usd: string;
|
|
270
276
|
/**
|
|
271
|
-
* @description
|
|
272
|
-
* @example
|
|
277
|
+
* @description Current collateral in USD pips
|
|
278
|
+
* @example 25000
|
|
273
279
|
*/
|
|
274
|
-
|
|
280
|
+
collateral_usd_pips: string;
|
|
275
281
|
/**
|
|
276
|
-
* @description
|
|
277
|
-
* @example
|
|
282
|
+
* @description Effective collateral formatted as USD
|
|
283
|
+
* @example 2.45
|
|
278
284
|
*/
|
|
279
|
-
|
|
280
|
-
/** @description Origination fee tiers by leverage */
|
|
281
|
-
origination_tiers: components["schemas"]["CustomerOriginationTier"][];
|
|
282
|
-
};
|
|
283
|
-
CustomerMaxMarketLeveragePerNotional: {
|
|
285
|
+
effective_collateral_usd: string;
|
|
284
286
|
/**
|
|
285
|
-
* @description
|
|
286
|
-
* @example
|
|
287
|
+
* @description Effective collateral after fees in USD pips
|
|
288
|
+
* @example 24500
|
|
287
289
|
*/
|
|
288
|
-
|
|
290
|
+
effective_collateral_usd_pips: string;
|
|
289
291
|
/**
|
|
290
|
-
* @
|
|
291
|
-
* @
|
|
292
|
+
* @deprecated
|
|
293
|
+
* @description Current leverage in basis points
|
|
294
|
+
* @example 18000
|
|
292
295
|
*/
|
|
293
|
-
|
|
296
|
+
leverage_bps: number;
|
|
294
297
|
/**
|
|
295
|
-
* @description
|
|
296
|
-
* @example
|
|
298
|
+
* @description Current market-value leverage in basis points, computed from the live oracle price. Null when the position is insolvent (equity <= 0).
|
|
299
|
+
* @example 19500
|
|
297
300
|
*/
|
|
298
|
-
|
|
301
|
+
market_leverage_bps?: number | null;
|
|
299
302
|
/**
|
|
300
|
-
* @description
|
|
301
|
-
* @example
|
|
303
|
+
* @description Current mark price formatted as USD
|
|
304
|
+
* @example 0.55
|
|
302
305
|
*/
|
|
303
|
-
|
|
304
|
-
};
|
|
305
|
-
CustomerSidedMaxMarketLeveragePerNotional: {
|
|
306
|
-
/** @description Per-notional max market leverage for the YES side */
|
|
307
|
-
yes: components["schemas"]["CustomerMaxMarketLeveragePerNotional"];
|
|
308
|
-
/** @description Per-notional max market leverage for the NO side */
|
|
309
|
-
no: components["schemas"]["CustomerMaxMarketLeveragePerNotional"];
|
|
310
|
-
};
|
|
311
|
-
CustomerLeverage: {
|
|
306
|
+
mark_price_usd: string;
|
|
312
307
|
/**
|
|
313
|
-
* @
|
|
314
|
-
* @
|
|
315
|
-
* @example 50000
|
|
308
|
+
* @description Current mark price in USD pips
|
|
309
|
+
* @example 5500
|
|
316
310
|
*/
|
|
317
|
-
|
|
318
|
-
/** @description Max market leverage per side, broken out by position notional. Slippage grows with notional, so larger notionals have lower max leverage. The UI slider should publish the leverage that matches the user's selected notional. */
|
|
319
|
-
max_market_leverage_per_notional: components["schemas"]["CustomerSidedMaxMarketLeveragePerNotional"];
|
|
311
|
+
mark_price_usd_pips: string;
|
|
320
312
|
/**
|
|
321
|
-
* @description
|
|
322
|
-
* @example
|
|
313
|
+
* @description Unrealized PnL net of all fees (origination + pending lifetime + accrued venue) as return on equity in basis points
|
|
314
|
+
* @example 1800
|
|
323
315
|
*/
|
|
324
|
-
|
|
316
|
+
net_unrealized_pnl_bps: number;
|
|
325
317
|
/**
|
|
326
|
-
* @description
|
|
327
|
-
* @example
|
|
318
|
+
* @description Unrealized PnL net of all fees (origination + pending lifetime + accrued venue) formatted as USD
|
|
319
|
+
* @example 0.45
|
|
328
320
|
*/
|
|
329
|
-
|
|
321
|
+
net_unrealized_pnl_usd: string;
|
|
330
322
|
/**
|
|
331
|
-
* @description
|
|
332
|
-
* @example
|
|
323
|
+
* @description Unrealized PnL net of all fees (origination + pending lifetime + accrued venue) in USD pips (can be negative)
|
|
324
|
+
* @example 4500
|
|
333
325
|
*/
|
|
334
|
-
|
|
326
|
+
net_unrealized_pnl_usd_pips: string;
|
|
335
327
|
/**
|
|
336
|
-
* @description
|
|
337
|
-
* @example
|
|
328
|
+
* @description Current notional formatted as USD
|
|
329
|
+
* @example 5.50
|
|
338
330
|
*/
|
|
339
|
-
|
|
340
|
-
};
|
|
341
|
-
CustomerMarketPolymarket: {
|
|
331
|
+
notional_usd: string;
|
|
342
332
|
/**
|
|
343
|
-
* @description
|
|
344
|
-
* @example
|
|
333
|
+
* @description Current notional in USD pips
|
|
334
|
+
* @example 55000
|
|
345
335
|
*/
|
|
346
|
-
|
|
336
|
+
notional_usd_pips: string;
|
|
347
337
|
/**
|
|
348
|
-
* @description
|
|
349
|
-
* @example
|
|
338
|
+
* @description Smallest partial-close slice the contract will accept right now, in token units (1000000 units = 1 token): `max(5 tokens, 20% of the original opened size)`. Null when the position is not partial-closeable (an operation is already in flight, the open fill isn't recorded yet, or the survivor is below the minimum).
|
|
339
|
+
* @example 5000000
|
|
350
340
|
*/
|
|
351
|
-
|
|
341
|
+
min_partial_close_token_units?: string | null;
|
|
352
342
|
/**
|
|
353
|
-
* @description
|
|
354
|
-
* @example
|
|
343
|
+
* @description Largest partial-close slice allowed right now, in token units (1000000 units = 1 token). Two bounds apply and this is the tighter of them: a position may partial-close at most 80% of its original opened size in total over its life (past that only a full close remains), and no single slice may drop the survivor's collateral below the on-chain minimum. Null when the position is not partial-closeable.
|
|
344
|
+
* @example 10000000
|
|
355
345
|
*/
|
|
356
|
-
|
|
346
|
+
max_partial_close_token_units?: string | null;
|
|
357
347
|
/**
|
|
358
|
-
* @description
|
|
359
|
-
* @example
|
|
348
|
+
* @description Position token units held (1000000 units = 1 token)
|
|
349
|
+
* @example 10000000
|
|
360
350
|
*/
|
|
361
|
-
|
|
362
|
-
};
|
|
363
|
-
CustomerSideEligibility: {
|
|
351
|
+
position_token_units: string;
|
|
364
352
|
/**
|
|
365
|
-
* @description
|
|
366
|
-
* @example
|
|
353
|
+
* @description Fraction of the originally opened size still held, in basis points (10000 = 100%). Computed as current token units / original opened token units. This LEGITIMATELY DECREASES after each partial close (e.g. 7000 = 70% remaining after a 30% close) and is not a fill problem. Null until the open fill is recorded on chain.
|
|
354
|
+
* @example 7000
|
|
367
355
|
*/
|
|
368
|
-
|
|
356
|
+
remaining_bps?: number | null;
|
|
369
357
|
/**
|
|
370
|
-
* @description
|
|
371
|
-
* @example
|
|
358
|
+
* @description Total position value formatted as USD
|
|
359
|
+
* @example 3.00
|
|
372
360
|
*/
|
|
373
|
-
|
|
374
|
-
};
|
|
375
|
-
CustomerSidedEligibility: {
|
|
376
|
-
/** @description Eligibility for the YES side */
|
|
377
|
-
yes: components["schemas"]["CustomerSideEligibility"];
|
|
378
|
-
/** @description Eligibility for the NO side */
|
|
379
|
-
no: components["schemas"]["CustomerSideEligibility"];
|
|
380
|
-
};
|
|
381
|
-
CustomerMarketPrices: {
|
|
361
|
+
position_value_usd: string;
|
|
382
362
|
/**
|
|
383
|
-
* @description
|
|
384
|
-
* @example
|
|
363
|
+
* @description Total position value in USD pips
|
|
364
|
+
* @example 30000
|
|
385
365
|
*/
|
|
386
|
-
|
|
366
|
+
position_value_usd_pips: string;
|
|
387
367
|
/**
|
|
388
|
-
* @description
|
|
389
|
-
* @example
|
|
368
|
+
* @description Unrealized PnL as return on equity in basis points (1000 = 10%)
|
|
369
|
+
* @example 2000
|
|
390
370
|
*/
|
|
391
|
-
|
|
371
|
+
unrealized_pnl_bps: number;
|
|
392
372
|
/**
|
|
393
|
-
* @description
|
|
394
|
-
* @example 0.
|
|
373
|
+
* @description Unrealized PnL formatted as USD
|
|
374
|
+
* @example 0.50
|
|
395
375
|
*/
|
|
396
|
-
|
|
376
|
+
unrealized_pnl_usd: string;
|
|
397
377
|
/**
|
|
398
|
-
* @description
|
|
399
|
-
* @example
|
|
378
|
+
* @description Unrealized PnL in USD pips (can be negative)
|
|
379
|
+
* @example 5000
|
|
400
380
|
*/
|
|
401
|
-
|
|
381
|
+
unrealized_pnl_usd_pips: string;
|
|
382
|
+
};
|
|
383
|
+
CustomerPositionOpenFees: {
|
|
402
384
|
/**
|
|
403
|
-
* @description
|
|
404
|
-
* @example 0.
|
|
385
|
+
* @description Accrued lifetime fee formatted as USD
|
|
386
|
+
* @example 0.01
|
|
405
387
|
*/
|
|
406
|
-
|
|
388
|
+
accrued_lifetime_fee_usd: string;
|
|
407
389
|
/**
|
|
408
|
-
* @description
|
|
409
|
-
* @example
|
|
390
|
+
* @description Accrued lifetime fee in USD pips
|
|
391
|
+
* @example 100
|
|
410
392
|
*/
|
|
411
|
-
|
|
393
|
+
accrued_lifetime_fee_usd_pips: string;
|
|
412
394
|
/**
|
|
413
|
-
* @description
|
|
414
|
-
* @example 0.
|
|
395
|
+
* @description Venue (Polymarket) trading fees paid so far on this position, summed across open and any force-unwind exchange transactions, formatted as USD.
|
|
396
|
+
* @example 0.02
|
|
415
397
|
*/
|
|
416
|
-
|
|
398
|
+
accrued_venue_fee_usd: string;
|
|
417
399
|
/**
|
|
418
|
-
* @description
|
|
419
|
-
* @example
|
|
400
|
+
* @description Venue trading fees paid so far on this position in USD pips.
|
|
401
|
+
* @example 200
|
|
420
402
|
*/
|
|
421
|
-
|
|
422
|
-
};
|
|
423
|
-
CustomerMarket: {
|
|
403
|
+
accrued_venue_fee_usd_pips: string;
|
|
424
404
|
/**
|
|
425
|
-
* @description
|
|
426
|
-
* @example
|
|
405
|
+
* @description Lifetime fee APR in basis points
|
|
406
|
+
* @example 500
|
|
427
407
|
*/
|
|
428
|
-
|
|
429
|
-
/** @description Fee configuration */
|
|
430
|
-
fees: components["schemas"]["CustomerFees"];
|
|
408
|
+
lifetime_apr_bps: number;
|
|
431
409
|
/**
|
|
432
|
-
* @description
|
|
433
|
-
* @example
|
|
410
|
+
* @description Pending lifetime fee formatted as USD
|
|
411
|
+
* @example 0.005
|
|
434
412
|
*/
|
|
435
|
-
|
|
436
|
-
/** @description Leverage configuration */
|
|
437
|
-
leverage: components["schemas"]["CustomerLeverage"];
|
|
413
|
+
pending_lifetime_fee_usd: string;
|
|
438
414
|
/**
|
|
439
|
-
* @description
|
|
440
|
-
* @
|
|
415
|
+
* @description Pending lifetime fee in USD pips
|
|
416
|
+
* @example 50
|
|
441
417
|
*/
|
|
442
|
-
|
|
418
|
+
pending_lifetime_fee_usd_pips: string;
|
|
443
419
|
/**
|
|
444
|
-
* @description
|
|
445
|
-
* @
|
|
420
|
+
* @description Sum of all fees accrued or owed so far (origination + accrued lifetime + pending lifetime + accrued venue), formatted as USD. Mirrors closed positions' `fees.totalFeesUsd`.
|
|
421
|
+
* @example 0.085
|
|
446
422
|
*/
|
|
447
|
-
|
|
423
|
+
total_fees_usd: string;
|
|
448
424
|
/**
|
|
449
|
-
* @description
|
|
450
|
-
* @example
|
|
451
|
-
* "politics",
|
|
452
|
-
* "election"
|
|
453
|
-
* ]
|
|
425
|
+
* @description Sum of all fees accrued or owed so far (origination + accrued lifetime + pending lifetime + accrued venue) in USD pips.
|
|
426
|
+
* @example 850
|
|
454
427
|
*/
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
428
|
+
total_fees_usd_pips: string;
|
|
429
|
+
};
|
|
430
|
+
CustomerPositionRisk: {
|
|
458
431
|
/**
|
|
459
|
-
* @
|
|
460
|
-
* @
|
|
461
|
-
* @example will-trump-win-the-2024-election
|
|
432
|
+
* @description Current liquidation price formatted as USD
|
|
433
|
+
* @example 0.35
|
|
462
434
|
*/
|
|
463
|
-
|
|
464
|
-
/** @description Market title */
|
|
465
|
-
title?: string;
|
|
466
|
-
/** @description Latest bid/ask prices for YES and NO sides. Only present when the request includes `expand=prices`. */
|
|
467
|
-
prices?: components["schemas"]["CustomerMarketPrices"] | null;
|
|
435
|
+
current_liquidation_price_usd: string;
|
|
468
436
|
/**
|
|
469
|
-
* @description
|
|
470
|
-
* @example
|
|
437
|
+
* @description Current liquidation price in USD pips
|
|
438
|
+
* @example 3500
|
|
471
439
|
*/
|
|
472
|
-
|
|
440
|
+
current_liquidation_price_usd_pips: string;
|
|
473
441
|
/**
|
|
474
|
-
* @description
|
|
475
|
-
* @example
|
|
442
|
+
* @description Margin health 0-10000 (10000 at entry, 0 at liquidation)
|
|
443
|
+
* @example 7500
|
|
476
444
|
*/
|
|
477
|
-
|
|
445
|
+
health_bps: number;
|
|
478
446
|
/**
|
|
479
|
-
* @description
|
|
480
|
-
* @example
|
|
447
|
+
* @description Buffer to liquidation in basis points
|
|
448
|
+
* @example 500
|
|
481
449
|
*/
|
|
482
|
-
|
|
450
|
+
liquidation_buffer_bps: number;
|
|
483
451
|
/**
|
|
484
|
-
* @description
|
|
485
|
-
* @example
|
|
452
|
+
* @description Liquidation fee in basis points
|
|
453
|
+
* @example 200
|
|
486
454
|
*/
|
|
487
|
-
|
|
455
|
+
liquidation_fee_bps: number;
|
|
488
456
|
/**
|
|
489
|
-
* @description
|
|
490
|
-
* @example 0.
|
|
457
|
+
* @description Dollar distance to liquidation formatted as USD
|
|
458
|
+
* @example 0.50
|
|
491
459
|
*/
|
|
492
|
-
|
|
460
|
+
margin_buffer_usd: string;
|
|
493
461
|
/**
|
|
494
|
-
* @description
|
|
495
|
-
* @example
|
|
462
|
+
* @description Dollar distance to liquidation in USD pips
|
|
463
|
+
* @example 5000
|
|
496
464
|
*/
|
|
497
|
-
|
|
465
|
+
margin_buffer_usd_pips: string;
|
|
466
|
+
};
|
|
467
|
+
CustomerPositionTiming: {
|
|
468
|
+
/** @description Whether settlement is pending (market resolved or voided, settlement not yet executed) */
|
|
469
|
+
is_settlement_pending: boolean;
|
|
470
|
+
/** @description Whether the market was voided (closed with no winner, 50/50 payout at $0.50 per token) */
|
|
471
|
+
is_voided: boolean;
|
|
498
472
|
/**
|
|
499
|
-
* @description
|
|
500
|
-
* @example
|
|
473
|
+
* @description ISO 8601 timestamp when market closes
|
|
474
|
+
* @example 2025-01-20T12:00:00.000Z
|
|
501
475
|
*/
|
|
502
|
-
|
|
476
|
+
market_close_time?: string;
|
|
503
477
|
/**
|
|
504
|
-
* @description
|
|
505
|
-
* @example
|
|
478
|
+
* @description Market status from the prediction market provider. When 'determined' or 'finalized', mark price reflects the settlement outcome ($1 or $0)
|
|
479
|
+
* @example active
|
|
480
|
+
* @enum {string}
|
|
506
481
|
*/
|
|
507
|
-
|
|
482
|
+
market_status: "active" | "amended" | "closed" | "determined" | "disputed" | "finalized" | "inactive" | "initialized";
|
|
508
483
|
/**
|
|
509
|
-
* @description Where this market sits on the road to settlement. `none` — still trading, nothing pending. `awaiting_resolution` — the market has closed and the outcome is decided, but the prediction market provider has not yet published the result on chain, so nothing can be redeemed yet. `settling` — the result is published and
|
|
510
|
-
* @example
|
|
484
|
+
* @description Where this market sits on the road to settlement. `none` — still trading, nothing pending. `awaiting_resolution` — the market has closed and the outcome is decided, but the prediction market provider has not yet published the result on chain, so nothing can be redeemed yet. `settling` — the result is published and we are settling the position. `voided` — the market was voided and every token pays out at $0.50. `unresolved_upstream` — the market disappeared from the provider before publishing a result and may never resolve.
|
|
485
|
+
* @example awaiting_resolution
|
|
511
486
|
* @enum {string}
|
|
512
487
|
*/
|
|
513
488
|
settlement_state: "awaiting_resolution" | "none" | "settling" | "unresolved_upstream" | "voided";
|
|
514
489
|
/**
|
|
515
|
-
* @description
|
|
516
|
-
* @example
|
|
517
|
-
*/
|
|
518
|
-
capacity_max_notional_no_usd?: string | null;
|
|
519
|
-
/**
|
|
520
|
-
* @description Capacity-limited maximum notional for NO side in USD pips (10000 pips = $1)
|
|
521
|
-
* @example 500000000
|
|
522
|
-
*/
|
|
523
|
-
capacity_max_notional_no_usd_pips?: string | null;
|
|
524
|
-
/**
|
|
525
|
-
* @description Capacity-limited maximum notional for YES side formatted as USD
|
|
526
|
-
* @example 50.00
|
|
527
|
-
*/
|
|
528
|
-
capacity_max_notional_yes_usd?: string | null;
|
|
529
|
-
/**
|
|
530
|
-
* @description Capacity-limited maximum notional for YES side in USD pips (10000 pips = $1)
|
|
531
|
-
* @example 500000000
|
|
490
|
+
* @description Minutes until market closes
|
|
491
|
+
* @example 1440
|
|
532
492
|
*/
|
|
533
|
-
|
|
493
|
+
time_to_close_minutes?: number;
|
|
494
|
+
};
|
|
495
|
+
CustomerOpenPosition: {
|
|
496
|
+
/** @description Entry details */
|
|
497
|
+
entry: components["schemas"]["CustomerPositionEntry"];
|
|
498
|
+
/** @description Failure details if the position failed */
|
|
499
|
+
failure?: components["schemas"]["CustomerPositionFailure"];
|
|
534
500
|
/**
|
|
535
|
-
* @description
|
|
536
|
-
* @example
|
|
501
|
+
* @description Position ID
|
|
502
|
+
* @example dm_pos_abc123
|
|
537
503
|
*/
|
|
538
|
-
|
|
504
|
+
id: string;
|
|
539
505
|
/**
|
|
540
|
-
* @description
|
|
541
|
-
* @example
|
|
506
|
+
* @description Name of the partner the position was opened through.
|
|
507
|
+
* @example Acme Markets
|
|
542
508
|
*/
|
|
543
|
-
|
|
509
|
+
partner: string;
|
|
544
510
|
/**
|
|
545
|
-
* @description
|
|
546
|
-
* @
|
|
511
|
+
* @description Prediction market provider
|
|
512
|
+
* @enum {string}
|
|
547
513
|
*/
|
|
548
|
-
|
|
514
|
+
provider: "polymarket";
|
|
549
515
|
/**
|
|
550
|
-
* @description
|
|
551
|
-
* @
|
|
516
|
+
* @description Market side
|
|
517
|
+
* @enum {string}
|
|
552
518
|
*/
|
|
553
|
-
|
|
519
|
+
side: "yes" | "no";
|
|
554
520
|
/**
|
|
555
|
-
* @description
|
|
556
|
-
* @
|
|
521
|
+
* @description Simplified position status. A position that was deleveraged almost entirely and then force-sold for a trivial remainder reports 'settled' once the market resolves against it. The 'status' query parameter still filters on the underlying mechanism, so such a position is returned by status=liquidated.
|
|
522
|
+
* @enum {string}
|
|
557
523
|
*/
|
|
558
|
-
|
|
524
|
+
status: "pending" | "open" | "unwinding" | "closing" | "settling" | "closed" | "settled" | "liquidated" | "cancelled";
|
|
525
|
+
/** @description Inline unwind history. Only present when the request includes `expand=unwinds`; omitted otherwise. */
|
|
526
|
+
unwinds?: components["schemas"]["CustomerPositionUnwindList"] | null;
|
|
527
|
+
/** @description Current position state */
|
|
528
|
+
current: components["schemas"]["CustomerPositionCurrent"];
|
|
529
|
+
/** @description Fee details for open position */
|
|
530
|
+
fees: components["schemas"]["CustomerPositionOpenFees"];
|
|
531
|
+
/** @description Risk metrics */
|
|
532
|
+
risk: components["schemas"]["CustomerPositionRisk"];
|
|
533
|
+
/** @description Timing information */
|
|
534
|
+
timing: components["schemas"]["CustomerPositionTiming"];
|
|
559
535
|
/**
|
|
560
|
-
* @description
|
|
561
|
-
* @example
|
|
536
|
+
* @description Time-weighted average structural leverage in basis points over position lifetime (20000 = 2x)
|
|
537
|
+
* @example 84000
|
|
562
538
|
*/
|
|
563
|
-
|
|
539
|
+
effective_leverage_bps: number;
|
|
564
540
|
/**
|
|
565
|
-
* @description
|
|
566
|
-
* @example
|
|
541
|
+
* @description Market ticker identifier
|
|
542
|
+
* @example TRUMP-2024-WIN
|
|
567
543
|
*/
|
|
568
|
-
|
|
544
|
+
market_ticker: string;
|
|
545
|
+
/** @description Market title */
|
|
546
|
+
market_title?: string;
|
|
547
|
+
/** @description On-chain position key (bytes32) for requestClose", example: "0xabc123... */
|
|
548
|
+
on_chain_position_key: string;
|
|
569
549
|
/**
|
|
570
|
-
* @description
|
|
571
|
-
* @example
|
|
550
|
+
* @description Wallet address (Solana public key or EVM address)
|
|
551
|
+
* @example 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
|
|
572
552
|
*/
|
|
573
|
-
|
|
553
|
+
wallet_address: string;
|
|
554
|
+
/** @description The committed-mode ladder this position was opened on: one row per planned unwind, each with a status of planned, triggered or superseded. Only present when the request includes `expand=planned_unwinds`; omitted otherwise, and empty on adaptive positions. */
|
|
555
|
+
planned_unwinds?: components["schemas"]["CustomerPositionUnwindList"] | null;
|
|
574
556
|
/**
|
|
575
|
-
* @
|
|
576
|
-
* @
|
|
557
|
+
* @deprecated
|
|
558
|
+
* @description Deprecated — use `pendingOperation` (a deferred close now surfaces as `{ type: 'close', phase: 'awaiting_settlement' }`). Details of a close request that could not complete and was deferred. Null unless the customer requested a close that is now waiting on market settlement to redeem the remaining tokens.
|
|
577
559
|
*/
|
|
578
|
-
|
|
579
|
-
/** @description
|
|
580
|
-
|
|
581
|
-
/** @description Subtitle for the YES outcome */
|
|
582
|
-
yes_sub_title?: string;
|
|
560
|
+
close_attempt?: components["schemas"]["CustomerCloseAttempt"] | null;
|
|
561
|
+
/** @description The lifecycle operation currently in flight on this position, or null when the position is at rest. Survives reload (unlike the ephemeral websocket events), so a UI can show that a close / partial close / unwind / settle is in progress after re-fetching REST. */
|
|
562
|
+
pending_operation?: components["schemas"]["CustomerPendingOperation"] | null;
|
|
583
563
|
};
|
|
584
|
-
|
|
585
|
-
/**
|
|
586
|
-
* @description Entry collateral formatted as USD
|
|
587
|
-
* @example 2.50
|
|
588
|
-
*/
|
|
589
|
-
collateral_usd: string;
|
|
590
|
-
/**
|
|
591
|
-
* @description Entry collateral in USD pips (10000 pips = $1)
|
|
592
|
-
* @example 25000
|
|
593
|
-
*/
|
|
594
|
-
collateral_usd_pips: string;
|
|
595
|
-
/**
|
|
596
|
-
* @description Entry leverage in basis points (20000 = 2x)
|
|
597
|
-
* @example 20000
|
|
598
|
-
*/
|
|
599
|
-
leverage_bps: number;
|
|
600
|
-
/**
|
|
601
|
-
* @description Entry notional formatted as USD
|
|
602
|
-
* @example 5.00
|
|
603
|
-
*/
|
|
604
|
-
notional_usd: string;
|
|
605
|
-
/**
|
|
606
|
-
* @description Entry notional in USD pips
|
|
607
|
-
* @example 50000
|
|
608
|
-
*/
|
|
609
|
-
notional_usd_pips: string;
|
|
610
|
-
/**
|
|
611
|
-
* @description Time in milliseconds from position creation to on-chain open confirmation. Null until the position is fully opened on chain.
|
|
612
|
-
* @example 12500
|
|
613
|
-
*/
|
|
614
|
-
open_latency_ms?: number | null;
|
|
564
|
+
CustomerPositionClosedFees: {
|
|
615
565
|
/**
|
|
616
|
-
* @description
|
|
617
|
-
* @example
|
|
566
|
+
* @description Lifetime fee APR in basis points
|
|
567
|
+
* @example 500
|
|
618
568
|
*/
|
|
619
|
-
|
|
569
|
+
lifetime_apr_bps: number;
|
|
620
570
|
/**
|
|
621
|
-
* @
|
|
571
|
+
* @deprecated
|
|
572
|
+
* @description Deprecated — use `entry.originationFeeBps`. Same value, kept for backwards compatibility.
|
|
622
573
|
* @example 100
|
|
623
574
|
*/
|
|
624
575
|
origination_fee_bps: number;
|
|
625
576
|
/**
|
|
626
|
-
* @
|
|
577
|
+
* @deprecated
|
|
578
|
+
* @description Deprecated — use `entry.protocolOriginationFeeBps`. Same value, kept for backwards compatibility.
|
|
627
579
|
* @example 80
|
|
628
580
|
*/
|
|
629
581
|
protocol_origination_fee_bps: number;
|
|
630
582
|
/**
|
|
631
|
-
* @
|
|
583
|
+
* @deprecated
|
|
584
|
+
* @description Deprecated — use `entry.partnerOriginationFeeBps`. Same value, kept for backwards compatibility.
|
|
632
585
|
* @example 20
|
|
633
586
|
*/
|
|
634
587
|
partner_origination_fee_bps: number;
|
|
635
588
|
/**
|
|
636
|
-
* @
|
|
589
|
+
* @deprecated
|
|
590
|
+
* @description Deprecated — use `entry.originationFeeUsd`. Same value, kept for backwards compatibility.
|
|
637
591
|
* @example 0.05
|
|
638
592
|
*/
|
|
639
593
|
origination_fee_usd: string;
|
|
640
594
|
/**
|
|
641
|
-
* @
|
|
595
|
+
* @deprecated
|
|
596
|
+
* @description Deprecated — use `entry.originationFeeUsdPips`. Same value, kept for backwards compatibility.
|
|
642
597
|
* @example 500
|
|
643
598
|
*/
|
|
644
599
|
origination_fee_usd_pips: string;
|
|
645
600
|
/**
|
|
646
|
-
* @description
|
|
647
|
-
* @example 0.
|
|
648
|
-
*/
|
|
649
|
-
price_usd: string;
|
|
650
|
-
/**
|
|
651
|
-
* @description Entry price in USD pips
|
|
652
|
-
* @example 5000
|
|
601
|
+
* @description Total blended fees formatted as USD
|
|
602
|
+
* @example 0.085
|
|
653
603
|
*/
|
|
654
|
-
|
|
604
|
+
total_fees_usd: string;
|
|
655
605
|
/**
|
|
656
|
-
* @description
|
|
657
|
-
* @example
|
|
606
|
+
* @description Total blended fees (origination + lifetime + liquidation + venue) in USD pips
|
|
607
|
+
* @example 850
|
|
658
608
|
*/
|
|
659
|
-
|
|
609
|
+
total_fees_usd_pips: string;
|
|
660
610
|
/**
|
|
661
|
-
* @description
|
|
662
|
-
* @example
|
|
611
|
+
* @description Total lifetime fee formatted as USD
|
|
612
|
+
* @example 0.015
|
|
663
613
|
*/
|
|
664
|
-
|
|
614
|
+
total_lifetime_fee_usd: string;
|
|
665
615
|
/**
|
|
666
|
-
* @description
|
|
667
|
-
* @example
|
|
616
|
+
* @description Total lifetime fee collected in USD pips
|
|
617
|
+
* @example 150
|
|
668
618
|
*/
|
|
669
|
-
|
|
619
|
+
total_lifetime_fee_usd_pips: string;
|
|
670
620
|
/**
|
|
671
|
-
* @description
|
|
672
|
-
* @example
|
|
621
|
+
* @description Total venue (Polymarket) trading fees collected across the position lifetime (open + close/liquidation/settle + force-unwind), formatted as USD.
|
|
622
|
+
* @example 0.02
|
|
673
623
|
*/
|
|
674
|
-
|
|
624
|
+
total_venue_fee_usd: string;
|
|
675
625
|
/**
|
|
676
|
-
* @description
|
|
677
|
-
* @example
|
|
626
|
+
* @description Total venue trading fees collected across the position lifetime in USD pips.
|
|
627
|
+
* @example 200
|
|
678
628
|
*/
|
|
679
|
-
|
|
629
|
+
total_venue_fee_usd_pips: string;
|
|
680
630
|
};
|
|
681
|
-
|
|
631
|
+
CustomerPositionResult: {
|
|
682
632
|
/**
|
|
683
|
-
* @description
|
|
684
|
-
* @example
|
|
633
|
+
* @description ISO 8601 timestamp when position was closed
|
|
634
|
+
* @example 2025-01-16T14:30:00.000Z
|
|
685
635
|
*/
|
|
686
|
-
|
|
687
|
-
};
|
|
688
|
-
CustomerPositionUnwind: {
|
|
636
|
+
closed_at: string;
|
|
689
637
|
/**
|
|
690
|
-
* @description
|
|
691
|
-
* @example
|
|
692
|
-
* @enum {string|null}
|
|
638
|
+
* @description Collected lifetime fee formatted as USD
|
|
639
|
+
* @example 0.015
|
|
693
640
|
*/
|
|
694
|
-
|
|
641
|
+
collected_lifetime_fee_usd: string;
|
|
695
642
|
/**
|
|
696
|
-
* @description
|
|
697
|
-
* @example
|
|
643
|
+
* @description Collected lifetime fee in USD pips
|
|
644
|
+
* @example 150
|
|
698
645
|
*/
|
|
699
|
-
|
|
646
|
+
collected_lifetime_fee_usd_pips: string;
|
|
700
647
|
/**
|
|
701
|
-
* @description
|
|
702
|
-
* @example
|
|
648
|
+
* @description Collected liquidation fee formatted as USD
|
|
649
|
+
* @example 0.00
|
|
703
650
|
*/
|
|
704
|
-
|
|
651
|
+
collected_liquidation_fee_usd: string;
|
|
705
652
|
/**
|
|
706
|
-
* @description
|
|
707
|
-
* @example
|
|
653
|
+
* @description Collected liquidation fee in USD pips
|
|
654
|
+
* @example 0
|
|
708
655
|
*/
|
|
709
|
-
|
|
656
|
+
collected_liquidation_fee_usd_pips: string;
|
|
710
657
|
/**
|
|
711
|
-
* @description
|
|
712
|
-
* @example
|
|
658
|
+
* @description Volume-weighted notional realized across all unwinds and the final close, formatted as USD. Null for reverted or cancelled positions.
|
|
659
|
+
* @example 5.25
|
|
713
660
|
*/
|
|
714
|
-
|
|
715
|
-
};
|
|
716
|
-
CustomerPositionUnwindList: {
|
|
717
|
-
data: components["schemas"]["CustomerPositionUnwind"][];
|
|
718
|
-
has_more: boolean;
|
|
719
|
-
total_count?: number;
|
|
661
|
+
exit_notional_usd?: string | null;
|
|
720
662
|
/**
|
|
721
|
-
* @description
|
|
722
|
-
* @example
|
|
663
|
+
* @description Exit notional in USD pips. Null for reverted or cancelled positions.
|
|
664
|
+
* @example 52500
|
|
723
665
|
*/
|
|
724
|
-
|
|
666
|
+
exit_notional_usd_pips?: string | null;
|
|
725
667
|
/**
|
|
726
|
-
* @description
|
|
727
|
-
* @example
|
|
668
|
+
* @description Whether every amount in this block is settled and will not be restated. False while the closing, liquidating or settling transaction is still in flight, when proceeds have not yet been credited and the PnL figures are provisional. Always true for reverted and cancelled positions, which have no proceeds to credit. Wait for true before booking a result. Absent on responses served by a pod that predates this field, so treat a missing value as not-yet-determined rather than as false.
|
|
669
|
+
* @example true
|
|
728
670
|
*/
|
|
729
|
-
|
|
671
|
+
is_final?: boolean;
|
|
730
672
|
/**
|
|
731
|
-
* @description
|
|
732
|
-
* @example
|
|
673
|
+
* @description Realized PnL net of all fees (origination + lifetime + liquidation + venue) as return on equity in basis points
|
|
674
|
+
* @example 1700
|
|
733
675
|
*/
|
|
734
|
-
|
|
735
|
-
};
|
|
736
|
-
CustomerCloseAttempt: {
|
|
676
|
+
net_realized_pnl_bps: number;
|
|
737
677
|
/**
|
|
738
|
-
* @description
|
|
739
|
-
* @
|
|
678
|
+
* @description Realized PnL net of all fees (origination + lifetime + liquidation + venue) formatted as USD
|
|
679
|
+
* @example 0.435
|
|
740
680
|
*/
|
|
741
|
-
|
|
681
|
+
net_realized_pnl_usd: string;
|
|
742
682
|
/**
|
|
743
|
-
* @description
|
|
744
|
-
* @
|
|
683
|
+
* @description Realized PnL net of all fees (origination + lifetime + liquidation + venue) in USD pips (can be negative)
|
|
684
|
+
* @example 4350
|
|
745
685
|
*/
|
|
746
|
-
|
|
686
|
+
net_realized_pnl_usd_pips: string;
|
|
747
687
|
/**
|
|
748
|
-
* @description
|
|
749
|
-
* @example
|
|
688
|
+
* @description Proceeds formatted as USD
|
|
689
|
+
* @example 3.00
|
|
750
690
|
*/
|
|
751
|
-
|
|
752
|
-
};
|
|
753
|
-
CustomerPendingOperation: {
|
|
691
|
+
proceeds_usd: string;
|
|
754
692
|
/**
|
|
755
|
-
* @description
|
|
756
|
-
* @
|
|
693
|
+
* @description Proceeds returned to user in USD pips
|
|
694
|
+
* @example 30000
|
|
757
695
|
*/
|
|
758
|
-
|
|
696
|
+
proceeds_usd_pips: string;
|
|
759
697
|
/**
|
|
760
|
-
* @description
|
|
761
|
-
* @example
|
|
762
|
-
* @enum {string|null}
|
|
698
|
+
* @description Realized PnL formatted as USD
|
|
699
|
+
* @example 0.50
|
|
763
700
|
*/
|
|
764
|
-
|
|
701
|
+
realized_pnl_usd: string;
|
|
765
702
|
/**
|
|
766
|
-
* @description
|
|
767
|
-
* @example
|
|
703
|
+
* @description Realized PnL in USD pips (can be negative)
|
|
704
|
+
* @example 5000
|
|
768
705
|
*/
|
|
769
|
-
|
|
706
|
+
realized_pnl_usd_pips: string;
|
|
770
707
|
};
|
|
771
|
-
|
|
708
|
+
CustomerClosedPosition: {
|
|
709
|
+
/** @description Entry details */
|
|
710
|
+
entry: components["schemas"]["CustomerPositionEntry"];
|
|
711
|
+
/** @description Failure details if the position failed */
|
|
712
|
+
failure?: components["schemas"]["CustomerPositionFailure"];
|
|
772
713
|
/**
|
|
773
|
-
* @description
|
|
774
|
-
* @example
|
|
714
|
+
* @description Position ID
|
|
715
|
+
* @example dm_pos_abc123
|
|
775
716
|
*/
|
|
776
|
-
|
|
717
|
+
id: string;
|
|
777
718
|
/**
|
|
778
|
-
* @description
|
|
779
|
-
* @example
|
|
719
|
+
* @description Name of the partner the position was opened through.
|
|
720
|
+
* @example Acme Markets
|
|
780
721
|
*/
|
|
781
|
-
|
|
722
|
+
partner: string;
|
|
782
723
|
/**
|
|
783
|
-
* @description
|
|
784
|
-
* @
|
|
724
|
+
* @description Prediction market provider
|
|
725
|
+
* @enum {string}
|
|
785
726
|
*/
|
|
786
|
-
|
|
727
|
+
provider: "polymarket";
|
|
787
728
|
/**
|
|
788
|
-
* @description
|
|
789
|
-
* @
|
|
729
|
+
* @description Market side
|
|
730
|
+
* @enum {string}
|
|
790
731
|
*/
|
|
791
|
-
|
|
732
|
+
side: "yes" | "no";
|
|
792
733
|
/**
|
|
793
|
-
* @description
|
|
794
|
-
* @
|
|
734
|
+
* @description Simplified position status. A position that was deleveraged almost entirely and then force-sold for a trivial remainder reports 'settled' once the market resolves against it. The 'status' query parameter still filters on the underlying mechanism, so such a position is returned by status=liquidated.
|
|
735
|
+
* @enum {string}
|
|
795
736
|
*/
|
|
796
|
-
|
|
737
|
+
status: "pending" | "open" | "unwinding" | "closing" | "settling" | "closed" | "settled" | "liquidated" | "cancelled";
|
|
738
|
+
/** @description Inline unwind history. Only present when the request includes `expand=unwinds`; omitted otherwise. */
|
|
739
|
+
unwinds?: components["schemas"]["CustomerPositionUnwindList"] | null;
|
|
740
|
+
/** @description Fee details for closed position */
|
|
741
|
+
fees: components["schemas"]["CustomerPositionClosedFees"];
|
|
742
|
+
/** @description Position result/outcome */
|
|
743
|
+
result: components["schemas"]["CustomerPositionResult"];
|
|
797
744
|
/**
|
|
798
|
-
* @
|
|
799
|
-
* @
|
|
800
|
-
* @example 18000
|
|
745
|
+
* @description Time-weighted average structural leverage in basis points over position lifetime (20000 = 2x)
|
|
746
|
+
* @example 84000
|
|
801
747
|
*/
|
|
802
|
-
|
|
748
|
+
effective_leverage_bps: number;
|
|
803
749
|
/**
|
|
804
|
-
* @description
|
|
805
|
-
* @example
|
|
750
|
+
* @description Market ticker identifier
|
|
751
|
+
* @example TRUMP-2024-WIN
|
|
806
752
|
*/
|
|
807
|
-
|
|
753
|
+
market_ticker: string;
|
|
754
|
+
/** @description Market title */
|
|
755
|
+
market_title?: string;
|
|
756
|
+
/** @description On-chain position key (bytes32) for requestClose", example: "0xabc123... */
|
|
757
|
+
on_chain_position_key: string;
|
|
808
758
|
/**
|
|
809
|
-
* @description
|
|
810
|
-
* @example
|
|
759
|
+
* @description Wallet address (Solana public key or EVM address)
|
|
760
|
+
* @example 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
|
|
811
761
|
*/
|
|
812
|
-
|
|
762
|
+
wallet_address: string;
|
|
763
|
+
/** @description The committed-mode ladder this position was opened on: one row per planned unwind, each with a status of planned, triggered or superseded. Only present when the request includes `expand=planned_unwinds`; omitted otherwise, and empty on adaptive positions. */
|
|
764
|
+
planned_unwinds?: components["schemas"]["CustomerPositionUnwindList"] | null;
|
|
813
765
|
/**
|
|
814
|
-
* @description
|
|
815
|
-
* @
|
|
766
|
+
* @description Reason the position was closed. Reports 'settled' for a position that was deleveraged almost entirely and then force-sold for a trivial remainder on a market that resolved against it.
|
|
767
|
+
* @enum {string}
|
|
816
768
|
*/
|
|
817
|
-
|
|
769
|
+
close_reason: "cancelled" | "closed" | "liquidated" | "reverted" | "settled";
|
|
818
770
|
/**
|
|
819
|
-
* @description
|
|
820
|
-
* @
|
|
771
|
+
* @description Why the position was reverted before it opened. Non-null only when `close_reason` is `reverted`: `exchange_unavailable` (the prediction-market venue was temporarily unavailable — safe to retry), `slippage_exceeded` (price moved beyond tolerance before the order filled), or `unknown`.
|
|
772
|
+
* @enum {string|null}
|
|
821
773
|
*/
|
|
822
|
-
|
|
774
|
+
revert_reason?: "exchange_unavailable" | "slippage_exceeded" | "unknown" | null;
|
|
775
|
+
};
|
|
776
|
+
CustomerMarketEvent: {
|
|
823
777
|
/**
|
|
824
|
-
* @description
|
|
825
|
-
* @example
|
|
778
|
+
* @description Ticker of the event this market belongs to — the real-world happening the market resolves against, such as one game or one hourly price window. Pass it to GET /events/{event_ticker}/markets to list every market on the same event.
|
|
779
|
+
* @example btc-updown-5m-1786109700
|
|
826
780
|
*/
|
|
827
|
-
|
|
781
|
+
ticker: string;
|
|
828
782
|
/**
|
|
829
|
-
* @description
|
|
830
|
-
* @example
|
|
783
|
+
* @description Human-readable event title, or null when the upstream feed did not supply one.
|
|
784
|
+
* @example Bitcoin Up or Down - August 7, 9:35AM-9:40AM ET
|
|
831
785
|
*/
|
|
832
|
-
|
|
786
|
+
title: string | null;
|
|
833
787
|
/**
|
|
834
|
-
* @description
|
|
835
|
-
* @example
|
|
788
|
+
* @description Ticker of the series this event belongs to, or null when the event has no series. Pass it to GET /series/{series_ticker}/markets to list every market in the series.
|
|
789
|
+
* @example btc-up-or-down-5m
|
|
836
790
|
*/
|
|
837
|
-
|
|
791
|
+
series_ticker: string | null;
|
|
792
|
+
};
|
|
793
|
+
CustomerOriginationTier: {
|
|
838
794
|
/**
|
|
839
|
-
* @description
|
|
840
|
-
* @example
|
|
795
|
+
* @description Origination fee in basis points for this tier
|
|
796
|
+
* @example 100
|
|
841
797
|
*/
|
|
842
|
-
|
|
798
|
+
fee_bps: number;
|
|
843
799
|
/**
|
|
844
|
-
* @description
|
|
845
|
-
* @example
|
|
800
|
+
* @description Maximum leverage in basis points for this tier
|
|
801
|
+
* @example 20000
|
|
846
802
|
*/
|
|
847
|
-
|
|
803
|
+
max_leverage_bps: number;
|
|
804
|
+
};
|
|
805
|
+
CustomerFees: {
|
|
848
806
|
/**
|
|
849
|
-
* @description
|
|
850
|
-
* @example
|
|
807
|
+
* @description Lifetime fee APR in basis points
|
|
808
|
+
* @example 500
|
|
851
809
|
*/
|
|
852
|
-
|
|
810
|
+
lifetime_apr_bps: number;
|
|
853
811
|
/**
|
|
854
|
-
* @description
|
|
855
|
-
* @example
|
|
812
|
+
* @description Liquidation fee in basis points
|
|
813
|
+
* @example 200
|
|
856
814
|
*/
|
|
857
|
-
|
|
815
|
+
liquidation_bps: number;
|
|
816
|
+
/** @description Origination fee tiers by leverage */
|
|
817
|
+
origination_tiers: components["schemas"]["CustomerOriginationTier"][];
|
|
818
|
+
};
|
|
819
|
+
CustomerMaxMarketLeveragePerNotional: {
|
|
858
820
|
/**
|
|
859
|
-
* @description
|
|
860
|
-
* @example
|
|
821
|
+
* @description Maximum market leverage in basis points when the position notional is $100
|
|
822
|
+
* @example 100000
|
|
861
823
|
*/
|
|
862
|
-
|
|
824
|
+
at100_usd_bps: number;
|
|
863
825
|
/**
|
|
864
|
-
* @description
|
|
865
|
-
* @example
|
|
826
|
+
* @description Maximum market leverage in basis points when the position notional is $500
|
|
827
|
+
* @example 80000
|
|
866
828
|
*/
|
|
867
|
-
|
|
829
|
+
at500_usd_bps: number;
|
|
868
830
|
/**
|
|
869
|
-
* @description
|
|
870
|
-
* @example
|
|
831
|
+
* @description Maximum market leverage in basis points when the position notional is $1,000
|
|
832
|
+
* @example 60000
|
|
871
833
|
*/
|
|
872
|
-
|
|
834
|
+
at1000_usd_bps: number;
|
|
873
835
|
/**
|
|
874
|
-
* @description
|
|
875
|
-
* @example
|
|
836
|
+
* @description Maximum market leverage in basis points when the position notional is $10,000
|
|
837
|
+
* @example 30000
|
|
876
838
|
*/
|
|
877
|
-
|
|
839
|
+
at10000_usd_bps: number;
|
|
840
|
+
};
|
|
841
|
+
CustomerSidedMaxMarketLeveragePerNotional: {
|
|
842
|
+
/** @description Per-notional max market leverage for the YES side */
|
|
843
|
+
yes: components["schemas"]["CustomerMaxMarketLeveragePerNotional"];
|
|
844
|
+
/** @description Per-notional max market leverage for the NO side */
|
|
845
|
+
no: components["schemas"]["CustomerMaxMarketLeveragePerNotional"];
|
|
846
|
+
};
|
|
847
|
+
CustomerLeverage: {
|
|
878
848
|
/**
|
|
879
|
-
* @
|
|
880
|
-
* @
|
|
849
|
+
* @deprecated
|
|
850
|
+
* @description Deprecated: use maxYesBps and maxNoBps. Populated as min(maxYesBps, maxNoBps) for backwards compatibility.
|
|
851
|
+
* @example 50000
|
|
881
852
|
*/
|
|
882
|
-
|
|
853
|
+
max_bps: number;
|
|
854
|
+
/** @description Max market leverage per side, broken out by position notional. Slippage grows with notional, so larger notionals have lower max leverage. The UI slider should publish the leverage that matches the user's selected notional. */
|
|
855
|
+
max_market_leverage_per_notional: components["schemas"]["CustomerSidedMaxMarketLeveragePerNotional"];
|
|
883
856
|
/**
|
|
884
|
-
* @description
|
|
885
|
-
* @example
|
|
857
|
+
* @description Maximum leverage in basis points for the NO side
|
|
858
|
+
* @example 50000
|
|
886
859
|
*/
|
|
887
|
-
|
|
888
|
-
};
|
|
889
|
-
CustomerPositionOpenFees: {
|
|
860
|
+
max_no_bps: number;
|
|
890
861
|
/**
|
|
891
|
-
* @description
|
|
892
|
-
* @example
|
|
862
|
+
* @description Maximum leverage in basis points for the YES side
|
|
863
|
+
* @example 50000
|
|
893
864
|
*/
|
|
894
|
-
|
|
865
|
+
max_yes_bps: number;
|
|
895
866
|
/**
|
|
896
|
-
* @description
|
|
897
|
-
* @example
|
|
867
|
+
* @description Minimum leverage in basis points
|
|
868
|
+
* @example 10000
|
|
898
869
|
*/
|
|
899
|
-
|
|
870
|
+
min_bps: number;
|
|
900
871
|
/**
|
|
901
|
-
* @description
|
|
902
|
-
* @example
|
|
872
|
+
* @description Leverage step increment in basis points
|
|
873
|
+
* @example 1000
|
|
903
874
|
*/
|
|
904
|
-
|
|
875
|
+
step_bps: number;
|
|
876
|
+
};
|
|
877
|
+
CustomerMarketPolymarket: {
|
|
905
878
|
/**
|
|
906
|
-
* @description
|
|
907
|
-
* @example
|
|
879
|
+
* @description Polymarket market slug, matching the slug in Polymarket URLs and Gamma API responses.
|
|
880
|
+
* @example will-trump-win-the-2024-election
|
|
908
881
|
*/
|
|
909
|
-
|
|
882
|
+
slug: string;
|
|
910
883
|
/**
|
|
911
|
-
* @description
|
|
912
|
-
* @example
|
|
884
|
+
* @description Polymarket CTF condition ID for this market. Use it to look the market up on Polymarket's CLOB and Gamma APIs. Null for the small number of markets where Polymarket has not exposed a condition ID.
|
|
885
|
+
* @example 0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890
|
|
913
886
|
*/
|
|
914
|
-
|
|
887
|
+
condition_id?: string | null;
|
|
915
888
|
/**
|
|
916
|
-
* @description
|
|
917
|
-
* @example
|
|
889
|
+
* @description Polymarket CLOB token ID for the NO outcome (the ERC1155 position token ID).
|
|
890
|
+
* @example 71321045679252212594626385532706912750332728571942532289631379312455583992563
|
|
918
891
|
*/
|
|
919
|
-
|
|
892
|
+
no_token_id: string;
|
|
920
893
|
/**
|
|
921
|
-
* @description
|
|
922
|
-
* @example
|
|
894
|
+
* @description Polymarket CLOB token ID for the YES outcome (the ERC1155 position token ID).
|
|
895
|
+
* @example 21742633143463906290569050155826241533067272736897614950488156847949938836455
|
|
923
896
|
*/
|
|
924
|
-
|
|
897
|
+
yes_token_id: string;
|
|
898
|
+
};
|
|
899
|
+
CustomerSideEligibility: {
|
|
925
900
|
/**
|
|
926
|
-
* @description
|
|
927
|
-
* @example
|
|
901
|
+
* @description Whether this market is accepting new positions on this side
|
|
902
|
+
* @example true
|
|
928
903
|
*/
|
|
929
|
-
|
|
904
|
+
accepting_new_positions: boolean;
|
|
930
905
|
/**
|
|
931
|
-
* @description
|
|
932
|
-
* @example
|
|
906
|
+
* @description Reason code if this side is not accepting new positions; null when accepting
|
|
907
|
+
* @example QUOTE_MARKET_NOT_ELIGIBLE
|
|
933
908
|
*/
|
|
934
|
-
|
|
909
|
+
rejection_reason_code?: string | null;
|
|
935
910
|
};
|
|
936
|
-
|
|
911
|
+
CustomerSidedEligibility: {
|
|
912
|
+
/** @description Eligibility for the YES side */
|
|
913
|
+
yes: components["schemas"]["CustomerSideEligibility"];
|
|
914
|
+
/** @description Eligibility for the NO side */
|
|
915
|
+
no: components["schemas"]["CustomerSideEligibility"];
|
|
916
|
+
};
|
|
917
|
+
CustomerMarketPrices: {
|
|
937
918
|
/**
|
|
938
|
-
* @description
|
|
939
|
-
* @example 0.
|
|
919
|
+
* @description NO side ask price formatted as USD
|
|
920
|
+
* @example 0.51
|
|
940
921
|
*/
|
|
941
|
-
|
|
922
|
+
no_ask_price_usd: string;
|
|
942
923
|
/**
|
|
943
|
-
* @description
|
|
944
|
-
* @example
|
|
924
|
+
* @description NO side ask price in USD pips (10000 pips = $1)
|
|
925
|
+
* @example 5100
|
|
945
926
|
*/
|
|
946
|
-
|
|
927
|
+
no_ask_price_usd_pips: string;
|
|
947
928
|
/**
|
|
948
|
-
* @description
|
|
949
|
-
* @example
|
|
929
|
+
* @description NO side bid price formatted as USD
|
|
930
|
+
* @example 0.49
|
|
950
931
|
*/
|
|
951
|
-
|
|
932
|
+
no_bid_price_usd: string;
|
|
952
933
|
/**
|
|
953
|
-
* @description
|
|
954
|
-
* @example
|
|
934
|
+
* @description NO side bid price in USD pips (10000 pips = $1)
|
|
935
|
+
* @example 4900
|
|
955
936
|
*/
|
|
956
|
-
|
|
937
|
+
no_bid_price_usd_pips: string;
|
|
957
938
|
/**
|
|
958
|
-
* @description
|
|
959
|
-
* @example
|
|
939
|
+
* @description YES side ask price formatted as USD
|
|
940
|
+
* @example 0.51
|
|
960
941
|
*/
|
|
961
|
-
|
|
942
|
+
yes_ask_price_usd: string;
|
|
962
943
|
/**
|
|
963
|
-
* @description
|
|
964
|
-
* @example
|
|
944
|
+
* @description YES side ask price in USD pips (10000 pips = $1)
|
|
945
|
+
* @example 5100
|
|
965
946
|
*/
|
|
966
|
-
|
|
947
|
+
yes_ask_price_usd_pips: string;
|
|
967
948
|
/**
|
|
968
|
-
* @description
|
|
969
|
-
* @example
|
|
949
|
+
* @description YES side bid price formatted as USD
|
|
950
|
+
* @example 0.49
|
|
970
951
|
*/
|
|
971
|
-
|
|
952
|
+
yes_bid_price_usd: string;
|
|
953
|
+
/**
|
|
954
|
+
* @description YES side bid price in USD pips (10000 pips = $1)
|
|
955
|
+
* @example 4900
|
|
956
|
+
*/
|
|
957
|
+
yes_bid_price_usd_pips: string;
|
|
972
958
|
};
|
|
973
|
-
|
|
974
|
-
/**
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
959
|
+
CustomerMarket: {
|
|
960
|
+
/**
|
|
961
|
+
* @description Market category
|
|
962
|
+
* @example politics
|
|
963
|
+
*/
|
|
964
|
+
category: string;
|
|
965
|
+
/** @description The event this market belongs to. Use its tickers to fetch sibling markets or your own positions scoped to the same event or series. */
|
|
966
|
+
event: components["schemas"]["CustomerMarketEvent"];
|
|
967
|
+
/** @description Fee configuration */
|
|
968
|
+
fees: components["schemas"]["CustomerFees"];
|
|
969
|
+
/**
|
|
970
|
+
* @description Market ID
|
|
971
|
+
* @example dm_mkt_abc123
|
|
972
|
+
*/
|
|
973
|
+
id: string;
|
|
974
|
+
/** @description Leverage configuration */
|
|
975
|
+
leverage: components["schemas"]["CustomerLeverage"];
|
|
976
|
+
/**
|
|
977
|
+
* @description Prediction market provider
|
|
978
|
+
* @enum {string}
|
|
979
|
+
*/
|
|
980
|
+
provider: "polymarket";
|
|
981
|
+
/**
|
|
982
|
+
* @description Current market status
|
|
983
|
+
* @enum {string}
|
|
984
|
+
*/
|
|
985
|
+
status: "active" | "amended" | "closed" | "determined" | "disputed" | "finalized" | "inactive" | "initialized";
|
|
986
|
+
/**
|
|
987
|
+
* @description Market tags for filtering
|
|
988
|
+
* @example [
|
|
989
|
+
* "politics",
|
|
990
|
+
* "election"
|
|
991
|
+
* ]
|
|
992
|
+
*/
|
|
993
|
+
tags: string[];
|
|
994
|
+
/** @description Polymarket identifiers for this market, for mapping our markets onto Polymarket data feeds. Always present (all live markets are Polymarket-sourced). */
|
|
995
|
+
polymarket: components["schemas"]["CustomerMarketPolymarket"];
|
|
996
|
+
/**
|
|
997
|
+
* @deprecated
|
|
998
|
+
* @description Deprecated: use `polymarket.slug`. Market ticker sourced from the upstream trading venue.
|
|
999
|
+
* @example will-trump-win-the-2024-election
|
|
1000
|
+
*/
|
|
1001
|
+
ticker: string;
|
|
1002
|
+
/** @description Market title */
|
|
1003
|
+
title?: string;
|
|
1004
|
+
/** @description Latest bid/ask prices for YES and NO sides. Only present when the request includes `expand=prices`. */
|
|
1005
|
+
prices?: components["schemas"]["CustomerMarketPrices"] | null;
|
|
1006
|
+
/**
|
|
1007
|
+
* @description Whether this market is accepting new positions
|
|
1008
|
+
* @example true
|
|
1009
|
+
*/
|
|
1010
|
+
accepting_new_positions: boolean;
|
|
978
1011
|
/**
|
|
979
1012
|
* @description ISO 8601 timestamp when market closes
|
|
980
1013
|
* @example 2025-01-20T12:00:00.000Z
|
|
981
1014
|
*/
|
|
982
|
-
|
|
1015
|
+
close_time?: string;
|
|
983
1016
|
/**
|
|
984
|
-
* @description
|
|
985
|
-
* @example
|
|
986
|
-
* @enum {string}
|
|
1017
|
+
* @description ISO 8601 timestamp when this market was first discovered and listed on the platform
|
|
1018
|
+
* @example 2025-01-10T08:00:00.000Z
|
|
987
1019
|
*/
|
|
988
|
-
|
|
1020
|
+
discovered_at: string;
|
|
989
1021
|
/**
|
|
990
|
-
* @description
|
|
991
|
-
* @example
|
|
1022
|
+
* @description ISO 8601 timestamp of the latest time a new position can be opened in this market
|
|
1023
|
+
* @example 2025-01-20T11:30:00.000Z
|
|
1024
|
+
*/
|
|
1025
|
+
latest_enter_at?: string;
|
|
1026
|
+
/**
|
|
1027
|
+
* @description Minimum collateral amount formatted as USD
|
|
1028
|
+
* @example 0.02
|
|
1029
|
+
*/
|
|
1030
|
+
min_collateral_usd: string;
|
|
1031
|
+
/**
|
|
1032
|
+
* @description Minimum collateral amount in USD pips (10000 pips = $1)
|
|
1033
|
+
* @example 200000
|
|
1034
|
+
*/
|
|
1035
|
+
min_collateral_usd_pips: string;
|
|
1036
|
+
/**
|
|
1037
|
+
* @description Minimum notional amount formatted as USD
|
|
1038
|
+
* @example 5.00
|
|
1039
|
+
*/
|
|
1040
|
+
min_notional_usd: string;
|
|
1041
|
+
/**
|
|
1042
|
+
* @description Minimum notional amount in USD pips (10000 pips = $1)
|
|
1043
|
+
* @example 50000
|
|
1044
|
+
*/
|
|
1045
|
+
min_notional_usd_pips: string;
|
|
1046
|
+
/**
|
|
1047
|
+
* @description Where this market sits on the road to settlement. `none` — still trading, nothing pending. `awaiting_resolution` — the market has closed and the outcome is decided, but the prediction market provider has not yet published the result on chain, so nothing can be redeemed yet. `settling` — the result is published and open positions are being settled. `voided` — the market was voided and every token pays out at $0.50. `unresolved_upstream` — the market disappeared from the provider before publishing a result and may never resolve.
|
|
1048
|
+
* @example none
|
|
992
1049
|
* @enum {string}
|
|
993
1050
|
*/
|
|
994
1051
|
settlement_state: "awaiting_resolution" | "none" | "settling" | "unresolved_upstream" | "voided";
|
|
995
1052
|
/**
|
|
996
|
-
* @description
|
|
997
|
-
* @example
|
|
1053
|
+
* @description Capacity-limited maximum notional for NO side formatted as USD
|
|
1054
|
+
* @example 50.00
|
|
998
1055
|
*/
|
|
999
|
-
|
|
1000
|
-
};
|
|
1001
|
-
CustomerOpenPosition: {
|
|
1002
|
-
/** @description Entry details */
|
|
1003
|
-
entry: components["schemas"]["CustomerPositionEntry"];
|
|
1004
|
-
/** @description Failure details if the position failed */
|
|
1005
|
-
failure?: components["schemas"]["CustomerPositionFailure"];
|
|
1056
|
+
capacity_max_notional_no_usd?: string | null;
|
|
1006
1057
|
/**
|
|
1007
|
-
* @description
|
|
1008
|
-
* @example
|
|
1058
|
+
* @description Capacity-limited maximum notional for NO side in USD pips (10000 pips = $1)
|
|
1059
|
+
* @example 500000000
|
|
1009
1060
|
*/
|
|
1010
|
-
|
|
1061
|
+
capacity_max_notional_no_usd_pips?: string | null;
|
|
1011
1062
|
/**
|
|
1012
|
-
* @description
|
|
1013
|
-
* @
|
|
1063
|
+
* @description Capacity-limited maximum notional for YES side formatted as USD
|
|
1064
|
+
* @example 50.00
|
|
1014
1065
|
*/
|
|
1015
|
-
|
|
1066
|
+
capacity_max_notional_yes_usd?: string | null;
|
|
1016
1067
|
/**
|
|
1017
|
-
* @description
|
|
1018
|
-
* @
|
|
1068
|
+
* @description Capacity-limited maximum notional for YES side in USD pips (10000 pips = $1)
|
|
1069
|
+
* @example 500000000
|
|
1019
1070
|
*/
|
|
1020
|
-
|
|
1071
|
+
capacity_max_notional_yes_usd_pips?: string | null;
|
|
1021
1072
|
/**
|
|
1022
|
-
* @description
|
|
1023
|
-
* @
|
|
1073
|
+
* @description Maximum notional available for NO side formatted as USD. Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
|
|
1074
|
+
* @example 50.00
|
|
1024
1075
|
*/
|
|
1025
|
-
|
|
1026
|
-
/** @description Inline unwind history. Only present when the request includes `expand=unwinds`; omitted otherwise. */
|
|
1027
|
-
unwinds?: components["schemas"]["CustomerPositionUnwindList"] | null;
|
|
1028
|
-
/** @description Current position state */
|
|
1029
|
-
current: components["schemas"]["CustomerPositionCurrent"];
|
|
1030
|
-
/** @description Fee details for open position */
|
|
1031
|
-
fees: components["schemas"]["CustomerPositionOpenFees"];
|
|
1032
|
-
/** @description Risk metrics */
|
|
1033
|
-
risk: components["schemas"]["CustomerPositionRisk"];
|
|
1034
|
-
/** @description Timing information */
|
|
1035
|
-
timing: components["schemas"]["CustomerPositionTiming"];
|
|
1076
|
+
max_notional_no_usd?: string;
|
|
1036
1077
|
/**
|
|
1037
|
-
* @description
|
|
1038
|
-
* @example
|
|
1078
|
+
* @description Maximum notional available for NO side in USD pips (10000 pips = $1). Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
|
|
1079
|
+
* @example 500000000
|
|
1039
1080
|
*/
|
|
1040
|
-
|
|
1081
|
+
max_notional_no_usd_pips?: string;
|
|
1041
1082
|
/**
|
|
1042
|
-
* @description
|
|
1043
|
-
* @example
|
|
1083
|
+
* @description Maximum notional available for YES side formatted as USD. Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
|
|
1084
|
+
* @example 50.00
|
|
1044
1085
|
*/
|
|
1045
|
-
|
|
1046
|
-
/** @description Market title */
|
|
1047
|
-
market_title?: string;
|
|
1048
|
-
/** @description On-chain position key (bytes32) for requestClose", example: "0xabc123... */
|
|
1049
|
-
on_chain_position_key: string;
|
|
1086
|
+
max_notional_yes_usd?: string;
|
|
1050
1087
|
/**
|
|
1051
|
-
* @description
|
|
1052
|
-
* @example
|
|
1088
|
+
* @description Maximum notional available for YES side in USD pips (10000 pips = $1). Bounded by slippage, capacity, the partner's remaining position limit, and the per-user position limit (assuming a user with no open positions).
|
|
1089
|
+
* @example 500000000
|
|
1053
1090
|
*/
|
|
1054
|
-
|
|
1091
|
+
max_notional_yes_usd_pips?: string;
|
|
1055
1092
|
/**
|
|
1056
|
-
* @
|
|
1057
|
-
* @
|
|
1093
|
+
* @description Slippage-limited maximum notional for NO side formatted as USD
|
|
1094
|
+
* @example 50.00
|
|
1058
1095
|
*/
|
|
1059
|
-
|
|
1060
|
-
/**
|
|
1061
|
-
|
|
1096
|
+
slippage_max_notional_no_usd?: string | null;
|
|
1097
|
+
/**
|
|
1098
|
+
* @description Slippage-limited maximum notional for NO side in USD pips (10000 pips = $1)
|
|
1099
|
+
* @example 500000000
|
|
1100
|
+
*/
|
|
1101
|
+
slippage_max_notional_no_usd_pips?: string | null;
|
|
1102
|
+
/**
|
|
1103
|
+
* @description Slippage-limited maximum notional for YES side formatted as USD
|
|
1104
|
+
* @example 50.00
|
|
1105
|
+
*/
|
|
1106
|
+
slippage_max_notional_yes_usd?: string | null;
|
|
1107
|
+
/**
|
|
1108
|
+
* @description Slippage-limited maximum notional for YES side in USD pips (10000 pips = $1)
|
|
1109
|
+
* @example 500000000
|
|
1110
|
+
*/
|
|
1111
|
+
slippage_max_notional_yes_usd_pips?: string | null;
|
|
1112
|
+
/**
|
|
1113
|
+
* @description Reason code if market is not accepting new positions
|
|
1114
|
+
* @example QUOTE_MARKET_NOT_ELIGIBLE
|
|
1115
|
+
*/
|
|
1116
|
+
rejection_reason_code?: string;
|
|
1117
|
+
/** @description Per-side eligibility. A market may accept positions on one side while rejecting the other (e.g. thin opposite-side liquidity, side max-leverage below the floor). */
|
|
1118
|
+
sided_eligibility: components["schemas"]["CustomerSidedEligibility"];
|
|
1119
|
+
/** @description Subtitle for the YES outcome */
|
|
1120
|
+
yes_sub_title?: string;
|
|
1062
1121
|
};
|
|
1063
|
-
|
|
1122
|
+
CustomerOriginationFeeTier: {
|
|
1064
1123
|
/**
|
|
1065
|
-
* @description
|
|
1066
|
-
* @example
|
|
1124
|
+
* @description Upper leverage bound (inclusive) in basis points for this tier. The last tier is the catch-all.
|
|
1125
|
+
* @example 40000
|
|
1067
1126
|
*/
|
|
1068
|
-
|
|
1127
|
+
max_leverage_bps: number;
|
|
1069
1128
|
/**
|
|
1070
|
-
* @
|
|
1071
|
-
* @
|
|
1072
|
-
* @example 100
|
|
1129
|
+
* @description Protocol origination fee in basis points applied at or below this tier's leverage bound.
|
|
1130
|
+
* @example 200
|
|
1073
1131
|
*/
|
|
1074
|
-
|
|
1132
|
+
fee_bps: number;
|
|
1133
|
+
};
|
|
1134
|
+
CustomerFeeRatesMarket: {
|
|
1075
1135
|
/**
|
|
1076
|
-
* @
|
|
1077
|
-
* @
|
|
1078
|
-
* @example 80
|
|
1136
|
+
* @description Market ticker
|
|
1137
|
+
* @example TRUMP-2024-WIN
|
|
1079
1138
|
*/
|
|
1080
|
-
|
|
1139
|
+
ticker: string;
|
|
1081
1140
|
/**
|
|
1082
|
-
* @
|
|
1083
|
-
* @
|
|
1084
|
-
* @example 20
|
|
1141
|
+
* @description Polymarket venue trading fee rate in basis points (`feeRateBps`).
|
|
1142
|
+
* @example 0
|
|
1085
1143
|
*/
|
|
1086
|
-
|
|
1144
|
+
polymarket_trading_fee_bps: number;
|
|
1145
|
+
/**
|
|
1146
|
+
* @description Polymarket fee-curve exponent (`feeExponent`). `1` for the standard quadratic curve.
|
|
1147
|
+
* @example 1
|
|
1148
|
+
*/
|
|
1149
|
+
polymarket_fee_exponent: number;
|
|
1150
|
+
};
|
|
1151
|
+
CustomerFeeRates: {
|
|
1152
|
+
/** @description Per-market venue fee fields. Only present when the request includes a `ticker` query parameter. */
|
|
1153
|
+
market?: components["schemas"]["CustomerFeeRatesMarket"];
|
|
1154
|
+
/** @description Leverage-tiered protocol origination fee schedule. Resolve a leverage to its fee by picking the first tier whose `maxLeverageBps >= leverageBps` (the last tier is the catch-all). */
|
|
1155
|
+
origination_fee_tiers: components["schemas"]["CustomerOriginationFeeTier"][];
|
|
1156
|
+
/**
|
|
1157
|
+
* @description Maximum combined (protocol + partner) origination fee in basis points enforced on-chain.
|
|
1158
|
+
* @example 1000
|
|
1159
|
+
*/
|
|
1160
|
+
contract_max_origination_fee_bps: number;
|
|
1161
|
+
/**
|
|
1162
|
+
* @description Lifetime fee APR in basis points
|
|
1163
|
+
* @example 2000
|
|
1164
|
+
*/
|
|
1165
|
+
lifetime_fee_apr_bps: number;
|
|
1087
1166
|
/**
|
|
1088
|
-
* @
|
|
1089
|
-
* @
|
|
1090
|
-
* @example 0.05
|
|
1167
|
+
* @description Liquidation fee in basis points
|
|
1168
|
+
* @example 250
|
|
1091
1169
|
*/
|
|
1092
|
-
|
|
1170
|
+
liquidation_fee_bps: number;
|
|
1093
1171
|
/**
|
|
1094
|
-
* @
|
|
1095
|
-
* @
|
|
1096
|
-
* @example 500
|
|
1172
|
+
* @description This partner's origination fee component in basis points, added to the protocol tier fee. `0` by default.
|
|
1173
|
+
* @example 0
|
|
1097
1174
|
*/
|
|
1098
|
-
|
|
1175
|
+
partner_origination_fee_bps: number;
|
|
1099
1176
|
/**
|
|
1100
|
-
* @description
|
|
1101
|
-
* @example 0
|
|
1177
|
+
* @description This partner's Polymarket builder taker fee in basis points (flat percentage of notional). `0` by default.
|
|
1178
|
+
* @example 0
|
|
1102
1179
|
*/
|
|
1103
|
-
|
|
1180
|
+
partner_trading_fee_bps: number;
|
|
1181
|
+
};
|
|
1182
|
+
FeeReportBody: {
|
|
1104
1183
|
/**
|
|
1105
|
-
* @description
|
|
1106
|
-
* @example
|
|
1184
|
+
* @description Leverage in basis points (20000 = 2x, 100000 = 10x). Must be divisible by 2500. Maximum 10x.
|
|
1185
|
+
* @example 50000
|
|
1107
1186
|
*/
|
|
1108
|
-
|
|
1187
|
+
leverage_bps: number;
|
|
1109
1188
|
/**
|
|
1110
|
-
* @description
|
|
1111
|
-
* @example
|
|
1189
|
+
* @description Market ticker
|
|
1190
|
+
* @example TRUMP-2024-WIN
|
|
1112
1191
|
*/
|
|
1113
|
-
|
|
1192
|
+
market_ticker: string;
|
|
1114
1193
|
/**
|
|
1115
|
-
* @description
|
|
1116
|
-
* @example
|
|
1194
|
+
* @description Notional amount in USD pips (10,000 pips = $1.00)
|
|
1195
|
+
* @example 50000
|
|
1117
1196
|
*/
|
|
1118
|
-
|
|
1197
|
+
notional_amount_usd_pips: string;
|
|
1119
1198
|
/**
|
|
1120
|
-
* @description
|
|
1121
|
-
* @
|
|
1199
|
+
* @description Market side (yes or no)
|
|
1200
|
+
* @enum {string}
|
|
1122
1201
|
*/
|
|
1123
|
-
|
|
1202
|
+
effective_side: "yes" | "no";
|
|
1124
1203
|
/**
|
|
1125
|
-
* @description
|
|
1126
|
-
* @example
|
|
1204
|
+
* @description Effective-side entry price in USD pips (10000 pips = $1) to compute against. When omitted, the market's current reference price is used. Provide it to compute deterministically against a known price.
|
|
1205
|
+
* @example 5100
|
|
1127
1206
|
*/
|
|
1128
|
-
|
|
1207
|
+
entry_price_usd_pips?: string;
|
|
1129
1208
|
};
|
|
1130
|
-
|
|
1209
|
+
CustomerFeeReport: {
|
|
1131
1210
|
/**
|
|
1132
|
-
* @description
|
|
1133
|
-
* @example
|
|
1211
|
+
* @description Market ticker
|
|
1212
|
+
* @example TRUMP-2024-WIN
|
|
1134
1213
|
*/
|
|
1135
|
-
|
|
1214
|
+
market_ticker: string;
|
|
1136
1215
|
/**
|
|
1137
|
-
* @description
|
|
1138
|
-
* @
|
|
1216
|
+
* @description Market side
|
|
1217
|
+
* @enum {string}
|
|
1139
1218
|
*/
|
|
1140
|
-
|
|
1219
|
+
effective_side: "yes" | "no";
|
|
1141
1220
|
/**
|
|
1142
|
-
* @description
|
|
1143
|
-
* @example
|
|
1221
|
+
* @description Leverage in basis points (20000 = 2x)
|
|
1222
|
+
* @example 20000
|
|
1144
1223
|
*/
|
|
1145
|
-
|
|
1224
|
+
leverage_bps: number;
|
|
1146
1225
|
/**
|
|
1147
|
-
* @description
|
|
1148
|
-
* @example
|
|
1226
|
+
* @description Entry price used for the computation, in USD pips
|
|
1227
|
+
* @example 5100
|
|
1149
1228
|
*/
|
|
1150
|
-
|
|
1229
|
+
entry_price_usd_pips: string;
|
|
1151
1230
|
/**
|
|
1152
|
-
* @description
|
|
1153
|
-
* @example
|
|
1231
|
+
* @description Notional in USD pips (10000 pips = $1)
|
|
1232
|
+
* @example 500000
|
|
1154
1233
|
*/
|
|
1155
|
-
|
|
1234
|
+
notional_amount_usd_pips: string;
|
|
1156
1235
|
/**
|
|
1157
|
-
* @description
|
|
1158
|
-
* @example
|
|
1236
|
+
* @description Notional in USDC units (1,000,000 = 1 USDC)
|
|
1237
|
+
* @example 50000000
|
|
1159
1238
|
*/
|
|
1160
|
-
|
|
1239
|
+
notional_usdc_units: string;
|
|
1161
1240
|
/**
|
|
1162
|
-
* @description
|
|
1163
|
-
* @example
|
|
1241
|
+
* @description Collateral in USDC units
|
|
1242
|
+
* @example 25000000
|
|
1164
1243
|
*/
|
|
1165
|
-
|
|
1244
|
+
collateral_usdc_units: string;
|
|
1166
1245
|
/**
|
|
1167
|
-
* @description
|
|
1168
|
-
* @example
|
|
1246
|
+
* @description Combined origination fee in basis points
|
|
1247
|
+
* @example 200
|
|
1169
1248
|
*/
|
|
1170
|
-
|
|
1249
|
+
origination_fee_bps: number;
|
|
1171
1250
|
/**
|
|
1172
|
-
* @description
|
|
1173
|
-
* @example
|
|
1251
|
+
* @description Origination fee in USDC units
|
|
1252
|
+
* @example 1000000
|
|
1174
1253
|
*/
|
|
1175
|
-
|
|
1254
|
+
origination_fee_usdc_units: string;
|
|
1176
1255
|
/**
|
|
1177
|
-
* @description
|
|
1178
|
-
* @example
|
|
1256
|
+
* @description Protocol component of the origination fee in basis points
|
|
1257
|
+
* @example 200
|
|
1179
1258
|
*/
|
|
1180
|
-
|
|
1259
|
+
protocol_origination_fee_bps: number;
|
|
1181
1260
|
/**
|
|
1182
|
-
* @description
|
|
1183
|
-
* @example
|
|
1261
|
+
* @description Partner component of the origination fee in basis points
|
|
1262
|
+
* @example 0
|
|
1184
1263
|
*/
|
|
1185
|
-
|
|
1264
|
+
partner_origination_fee_bps: number;
|
|
1186
1265
|
/**
|
|
1187
|
-
* @description
|
|
1188
|
-
* @example
|
|
1266
|
+
* @description Polymarket venue trading fee rate in basis points (`feeRateBps`).
|
|
1267
|
+
* @example 0
|
|
1189
1268
|
*/
|
|
1190
|
-
|
|
1269
|
+
polymarket_trading_fee_bps: number;
|
|
1191
1270
|
/**
|
|
1192
|
-
* @description
|
|
1193
|
-
* @example 0
|
|
1271
|
+
* @description Partner Polymarket builder taker fee in basis points (flat percentage of notional).
|
|
1272
|
+
* @example 0
|
|
1194
1273
|
*/
|
|
1195
|
-
|
|
1274
|
+
partner_trading_fee_bps: number;
|
|
1196
1275
|
/**
|
|
1197
|
-
* @description
|
|
1198
|
-
* @example
|
|
1276
|
+
* @description Expected venue trading fee in USDC units charged to open the position (protocol venue fee + partner builder fee), computed from notional and entry price.
|
|
1277
|
+
* @example 2204118
|
|
1199
1278
|
*/
|
|
1200
|
-
|
|
1201
|
-
};
|
|
1202
|
-
CustomerClosedPosition: {
|
|
1203
|
-
/** @description Entry details */
|
|
1204
|
-
entry: components["schemas"]["CustomerPositionEntry"];
|
|
1205
|
-
/** @description Failure details if the position failed */
|
|
1206
|
-
failure?: components["schemas"]["CustomerPositionFailure"];
|
|
1279
|
+
expected_open_trading_fee_usdc_units: string;
|
|
1207
1280
|
/**
|
|
1208
|
-
* @description
|
|
1209
|
-
* @example
|
|
1281
|
+
* @description Total amount the user must provide to open, in USDC units.
|
|
1282
|
+
* @example 28204118
|
|
1210
1283
|
*/
|
|
1211
|
-
|
|
1284
|
+
total_user_amount_usdc_units: string;
|
|
1212
1285
|
/**
|
|
1213
|
-
* @description
|
|
1214
|
-
* @
|
|
1286
|
+
* @description Deterministic at-entry liquidation price ESTIMATE in USD pips (10000 pips = $1): `entry * (L-1)/L * (1 + liquidationFeeBps/10000)`. This is a closed-form estimate; the binding offer uses a TWAP/inference-based price that may differ.
|
|
1287
|
+
* @example 2629
|
|
1215
1288
|
*/
|
|
1216
|
-
|
|
1289
|
+
estimated_liquidation_price_usd_pips: string;
|
|
1217
1290
|
/**
|
|
1218
|
-
* @description
|
|
1219
|
-
* @
|
|
1291
|
+
* @description Gross maximum gain in USDC units: full value on a win (settlement at $1) minus notional, before fees. Profit over principal; may be negative.
|
|
1292
|
+
* @example 48039215
|
|
1220
1293
|
*/
|
|
1221
|
-
|
|
1294
|
+
gross_max_gain_usdc_units: string;
|
|
1222
1295
|
/**
|
|
1223
|
-
* @description
|
|
1224
|
-
* @
|
|
1296
|
+
* @description Net maximum gain in USDC units: grossMaxGain minus the open trading fee and the origination fee. Assumes a win via settlement (no exit trading fee) and excludes lifetime fees, so it is an upper bound. May be negative.
|
|
1297
|
+
* @example 44835097
|
|
1225
1298
|
*/
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
/** @description Fee details for closed position */
|
|
1230
|
-
fees: components["schemas"]["CustomerPositionClosedFees"];
|
|
1231
|
-
/** @description Position result/outcome */
|
|
1232
|
-
result: components["schemas"]["CustomerPositionResult"];
|
|
1299
|
+
net_max_gain_usdc_units: string;
|
|
1300
|
+
};
|
|
1301
|
+
CustomerLimit: {
|
|
1233
1302
|
/**
|
|
1234
|
-
* @description
|
|
1235
|
-
* @example
|
|
1303
|
+
* @description Total limit formatted as USD
|
|
1304
|
+
* @example 1000.00
|
|
1236
1305
|
*/
|
|
1237
|
-
|
|
1306
|
+
limit_usd: string;
|
|
1238
1307
|
/**
|
|
1239
|
-
* @description
|
|
1240
|
-
* @example
|
|
1308
|
+
* @description Total limit in USD pips (10000 pips = $1)
|
|
1309
|
+
* @example 10000000
|
|
1241
1310
|
*/
|
|
1242
|
-
|
|
1243
|
-
/** @description Market title */
|
|
1244
|
-
market_title?: string;
|
|
1245
|
-
/** @description On-chain position key (bytes32) for requestClose", example: "0xabc123... */
|
|
1246
|
-
on_chain_position_key: string;
|
|
1311
|
+
limit_usd_pips: string;
|
|
1247
1312
|
/**
|
|
1248
|
-
* @description
|
|
1249
|
-
* @example
|
|
1313
|
+
* @description Remaining available limit formatted as USD
|
|
1314
|
+
* @example 750.00
|
|
1250
1315
|
*/
|
|
1251
|
-
|
|
1316
|
+
remaining_usd: string;
|
|
1252
1317
|
/**
|
|
1253
|
-
* @description
|
|
1254
|
-
* @
|
|
1318
|
+
* @description Remaining available limit in USD pips
|
|
1319
|
+
* @example 7500000
|
|
1255
1320
|
*/
|
|
1256
|
-
|
|
1321
|
+
remaining_usd_pips: string;
|
|
1257
1322
|
/**
|
|
1258
|
-
* @description
|
|
1259
|
-
* @
|
|
1323
|
+
* @description Current usage formatted as USD
|
|
1324
|
+
* @example 250.00
|
|
1260
1325
|
*/
|
|
1261
|
-
|
|
1326
|
+
usage_usd: string;
|
|
1327
|
+
/**
|
|
1328
|
+
* @description Current usage in USD pips
|
|
1329
|
+
* @example 2500000
|
|
1330
|
+
*/
|
|
1331
|
+
usage_usd_pips: string;
|
|
1262
1332
|
};
|
|
1263
1333
|
CustomerPartialClose: {
|
|
1264
1334
|
/**
|
|
@@ -1417,10 +1487,75 @@ interface components {
|
|
|
1417
1487
|
*/
|
|
1418
1488
|
allow_partial_fill: boolean;
|
|
1419
1489
|
/**
|
|
1420
|
-
* @description Minimum fill the user will accept, in basis points. Only valid when allowPartialFill=true (rejected otherwise). Must be in [2000,
|
|
1490
|
+
* @description Minimum fill the user will accept, in basis points. Only valid when allowPartialFill=true (rejected otherwise). Must be in [2000, 7000] and divisible by 500 (5% steps). Capped from below by max(2000, ceil(MIN_COLLATERAL × 10000 / requestedCollateral)).
|
|
1421
1491
|
* @example 5000
|
|
1422
1492
|
*/
|
|
1423
1493
|
min_fill_bps?: number;
|
|
1494
|
+
/**
|
|
1495
|
+
* @description Risk mode for the resulting position. adaptive: the live risk engine manages leverage. committed: the quote carries a fixed set of price-triggered unwinds and the user posts extra margin. A committed request is answered in committed mode or not at all — when the market, price or leverage rules the mode out, the quote is rejected with QUOTE_COMMITTED_RISK_MODE_UNAVAILABLE carrying the reason. Take a draft quote first to see whether the mode is on offer.
|
|
1496
|
+
* @default adaptive
|
|
1497
|
+
* @example committed
|
|
1498
|
+
* @enum {string}
|
|
1499
|
+
*/
|
|
1500
|
+
risk_mode: "adaptive" | "committed";
|
|
1501
|
+
};
|
|
1502
|
+
PlannedUnwind: {
|
|
1503
|
+
/**
|
|
1504
|
+
* @description Order in which this unwind fires, starting at 0
|
|
1505
|
+
* @example 0
|
|
1506
|
+
*/
|
|
1507
|
+
sequence: number;
|
|
1508
|
+
/**
|
|
1509
|
+
* @description Price at which this unwind fires, formatted as USD
|
|
1510
|
+
* @example 0.42
|
|
1511
|
+
*/
|
|
1512
|
+
trigger_price_usd: string;
|
|
1513
|
+
/**
|
|
1514
|
+
* @description Price at which this unwind fires, in USD pips (10000 pips = $1)
|
|
1515
|
+
* @example 4200
|
|
1516
|
+
*/
|
|
1517
|
+
trigger_price_usd_pips: string;
|
|
1518
|
+
/**
|
|
1519
|
+
* @description Book leverage the position is unwound to when this fires, in basis points (10000 = 1x)
|
|
1520
|
+
* @example 15000
|
|
1521
|
+
*/
|
|
1522
|
+
target_leverage_bps: number;
|
|
1523
|
+
/**
|
|
1524
|
+
* @description Estimated whole tokens sold to reach the target. An estimate only — the executed amount depends on the fill.
|
|
1525
|
+
* @example 30
|
|
1526
|
+
*/
|
|
1527
|
+
estimated_sell_tokens: string;
|
|
1528
|
+
/**
|
|
1529
|
+
* @description Estimated token units sold to reach the target (1000000 units = 1 token). An estimate only — the executed amount depends on the fill.
|
|
1530
|
+
* @example 30000000
|
|
1531
|
+
*/
|
|
1532
|
+
estimated_sell_token_units: string;
|
|
1533
|
+
};
|
|
1534
|
+
CommittedUnwinds: {
|
|
1535
|
+
/** @description Whether committed mode can be offered for this quote */
|
|
1536
|
+
available: boolean;
|
|
1537
|
+
/**
|
|
1538
|
+
* @description Extra margin the user must post on top of collateral, formatted as USD
|
|
1539
|
+
* @example 67.00
|
|
1540
|
+
*/
|
|
1541
|
+
margin_required_usd?: string | null;
|
|
1542
|
+
/**
|
|
1543
|
+
* @description Extra margin the user must post on top of collateral, in USDC units (1000000 units = 1 USDC)
|
|
1544
|
+
* @example 67000000
|
|
1545
|
+
*/
|
|
1546
|
+
margin_required_usdc_units?: string | null;
|
|
1547
|
+
/**
|
|
1548
|
+
* @description Price at which selling the remaining tokens repays the loan in full, formatted as USD
|
|
1549
|
+
* @example 0.27
|
|
1550
|
+
*/
|
|
1551
|
+
debt_clear_price_usd?: string | null;
|
|
1552
|
+
/**
|
|
1553
|
+
* @description Price at which selling the remaining tokens repays the loan in full, in USD pips
|
|
1554
|
+
* @example 2700
|
|
1555
|
+
*/
|
|
1556
|
+
debt_clear_price_usd_pips?: string | null;
|
|
1557
|
+
/** @description The pre-committed unwinds, in the order they fire. Null when committed mode is unavailable. */
|
|
1558
|
+
planned_unwinds?: components["schemas"]["PlannedUnwind"][] | null;
|
|
1424
1559
|
};
|
|
1425
1560
|
CustomerOfferMaxGain: {
|
|
1426
1561
|
/**
|
|
@@ -1505,6 +1640,12 @@ interface components {
|
|
|
1505
1640
|
* @example 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
|
|
1506
1641
|
*/
|
|
1507
1642
|
polymarket_market_id: string;
|
|
1643
|
+
/**
|
|
1644
|
+
* @description Which Polymarket share ledger the market uses, numbered as the vault numbers it: 1 = Conditional Tokens (CTF), 2 = Polymarket Protocol V2 (PositionManager). Pass it as `protocolVersion` to the vault. A version 2 quote is signed for `createPositionWithVersion` / `createPositionWithMarginAndVersion` (or their push-funded twins) and is rejected by the create functions without a version.
|
|
1645
|
+
* @example 1
|
|
1646
|
+
* @enum {number}
|
|
1647
|
+
*/
|
|
1648
|
+
polymarket_protocol_version: 1 | 2;
|
|
1508
1649
|
/** @description EIP-191 signature for contract create position */
|
|
1509
1650
|
contract_signature: string;
|
|
1510
1651
|
/**
|
|
@@ -1517,6 +1658,24 @@ interface components {
|
|
|
1517
1658
|
* @example 0x1234567890123456789012345678901234567890
|
|
1518
1659
|
*/
|
|
1519
1660
|
polygon_vault_contract_address: string;
|
|
1661
|
+
/**
|
|
1662
|
+
* @description Risk mode this quote was issued in. A committed request is answered in committed mode or rejected, so this only reports adaptive when adaptive was asked for.
|
|
1663
|
+
* @example adaptive
|
|
1664
|
+
* @enum {string}
|
|
1665
|
+
*/
|
|
1666
|
+
risk_mode: "adaptive" | "committed";
|
|
1667
|
+
/** @description Committed-unwind mode for this quote: the pre-committed unwinds and the extra margin they require, or whether the mode can be offered at all. */
|
|
1668
|
+
committed_unwinds?: components["schemas"]["CommittedUnwinds"];
|
|
1669
|
+
/**
|
|
1670
|
+
* @description Extra margin locked in the vault on top of collateral, formatted as USD. Zero on adaptive quotes.
|
|
1671
|
+
* @example 0.00
|
|
1672
|
+
*/
|
|
1673
|
+
margin_usd: string;
|
|
1674
|
+
/**
|
|
1675
|
+
* @description Extra margin locked in the vault on top of collateral, in USDC units (1,000,000 units = 1 USDC). Zero on adaptive quotes. Included in totalUserAmountUsdcUnits.
|
|
1676
|
+
* @example 0
|
|
1677
|
+
*/
|
|
1678
|
+
margin_usdc_units: string;
|
|
1520
1679
|
/**
|
|
1521
1680
|
* @description Expected trading fee formatted as USD
|
|
1522
1681
|
* @example 0.02
|
|
@@ -1714,11 +1873,20 @@ interface components {
|
|
|
1714
1873
|
*/
|
|
1715
1874
|
total_user_amount_usd_pips: string;
|
|
1716
1875
|
/**
|
|
1717
|
-
* @description Total amount user must transfer at
|
|
1876
|
+
* @description Total amount user must transfer at position creation in USDC units (1,000,000 units = 1 USDC). Contract-ready value = collateral + originationFee + expected open trading fee + committed-mode margin.
|
|
1718
1877
|
* @example 2730000
|
|
1719
1878
|
*/
|
|
1720
1879
|
total_user_amount_usdc_units: string;
|
|
1721
1880
|
};
|
|
1881
|
+
PromoteOfferBody: {
|
|
1882
|
+
/**
|
|
1883
|
+
* @description Risk mode for the promoted offer. The draft carries the committed unwinds it was quoted with; this chooses whether the promoted offer opens on them. Omitted means adaptive.
|
|
1884
|
+
* @default adaptive
|
|
1885
|
+
* @example committed
|
|
1886
|
+
* @enum {string}
|
|
1887
|
+
*/
|
|
1888
|
+
risk_mode: "adaptive" | "committed";
|
|
1889
|
+
};
|
|
1722
1890
|
};
|
|
1723
1891
|
responses: never;
|
|
1724
1892
|
parameters: never;
|
|
@@ -1728,7 +1896,23 @@ interface components {
|
|
|
1728
1896
|
}
|
|
1729
1897
|
|
|
1730
1898
|
type Raw = components["schemas"];
|
|
1731
|
-
|
|
1899
|
+
/**
|
|
1900
|
+
* The event a market belongs to — the real-world happening it resolves against (one game, one
|
|
1901
|
+
* hourly price window). `seriesTicker` names the recurring template the event came from, and is
|
|
1902
|
+
* null for events with no series.
|
|
1903
|
+
*
|
|
1904
|
+
* Hand-written rather than derived from `Raw` because `generated.ts` is currently pinned to an API
|
|
1905
|
+
* version that predates this block. Delete this and let `CustomerMarket` supply `event` the next
|
|
1906
|
+
* time the types are regenerated against a spec that has it.
|
|
1907
|
+
*/
|
|
1908
|
+
interface MarketEvent {
|
|
1909
|
+
seriesTicker: string | null;
|
|
1910
|
+
ticker: string;
|
|
1911
|
+
title: string | null;
|
|
1912
|
+
}
|
|
1913
|
+
type Market = CamelizeKeys<Raw["CustomerMarket"]> & {
|
|
1914
|
+
event: MarketEvent;
|
|
1915
|
+
};
|
|
1732
1916
|
type MarketLeverage = CamelizeKeys<Raw["CustomerLeverage"]>;
|
|
1733
1917
|
type MarketMaxLeveragePerNotional = CamelizeKeys<Raw["CustomerMaxMarketLeveragePerNotional"]>;
|
|
1734
1918
|
type MarketSidedMaxLeveragePerNotional = CamelizeKeys<Raw["CustomerSidedMaxMarketLeveragePerNotional"]>;
|
|
@@ -1770,6 +1954,7 @@ type FeeRatesOriginationTier = CamelizeKeys<Raw["CustomerOriginationFeeTier"]>;
|
|
|
1770
1954
|
type FeeRatesMarket = CamelizeKeys<Raw["CustomerFeeRatesMarket"]>;
|
|
1771
1955
|
type FeeRates = CamelizeKeys<Raw["CustomerFeeRates"]>;
|
|
1772
1956
|
type FeeReport = CamelizeKeys<Raw["CustomerFeeReport"]>;
|
|
1957
|
+
type RiskMode = "adaptive" | "committed";
|
|
1773
1958
|
interface CreateQuoteParams {
|
|
1774
1959
|
marketTicker: string;
|
|
1775
1960
|
effectiveSide: "yes" | "no";
|
|
@@ -1779,6 +1964,15 @@ interface CreateQuoteParams {
|
|
|
1779
1964
|
pmProvider?: "polymarket" | "kalshi";
|
|
1780
1965
|
allowPartialFill?: boolean;
|
|
1781
1966
|
minFillBps?: number;
|
|
1967
|
+
/**
|
|
1968
|
+
* Ask for a committed deleverage plan (a fixed ladder of trigger prices, backed by a refundable
|
|
1969
|
+
* margin deposit) instead of the adaptive risk engine. Defaults to `adaptive`.
|
|
1970
|
+
*
|
|
1971
|
+
* A committed request is answered in committed mode or rejected with
|
|
1972
|
+
* `quote_committed_risk_mode_unavailable` — you never get an adaptive quote back from it. Take a
|
|
1973
|
+
* draft first and read `committedUnwinds.available` to know whether the mode is on offer.
|
|
1974
|
+
*/
|
|
1975
|
+
riskMode?: RiskMode;
|
|
1782
1976
|
}
|
|
1783
1977
|
/** @deprecated Renamed to {@link CreateQuoteParams}. Kept as an alias for backward compatibility. */
|
|
1784
1978
|
type CreateOfferParams = CreateQuoteParams;
|
|
@@ -1793,4 +1987,4 @@ declare function isOpenPosition(p: Position): p is OpenPosition;
|
|
|
1793
1987
|
declare function isClosedPosition(p: Position): p is ClosedPosition;
|
|
1794
1988
|
declare function leverageMaxBps(lev: MarketLeverage, side: "yes" | "no"): number;
|
|
1795
1989
|
|
|
1796
|
-
export { type
|
|
1990
|
+
export { type PositionCurrent as A, type PositionEntry as B, type CreateQuoteParams as C, type PositionFailure as D, type PositionOpenFees as E, type FeeRates as F, type PositionPartialClose as G, type PositionResult as H, type PositionRisk as I, type PositionTiming as J, type PositionUnwind as K, isClosedPosition as L, type Market as M, isOpenPosition as N, type Offer as O, type Position as P, type Quote as Q, type RiskMode as R, leverageMaxBps as S, type MarketPolymarket as a, type MarketLeverage as b, type PositionTransactions as c, type PositionUnwindList as d, type PositionPartialCloseList as e, type ContractInfo as f, type CustomerLimit as g, type FeeReportParams as h, type FeeReport as i, type CamelizeKeys as j, type CloseAttempt as k, type ClosedPosition as l, type CreateOfferParams as m, type CreateTokenResult as n, type FeeRatesMarket as o, type FeeRatesOriginationTier as p, type MarketEvent as q, type MarketFees as r, type MarketMaxLeveragePerNotional as s, type MarketPrices as t, type MarketSidedEligibility as u, type MarketSidedMaxLeveragePerNotional as v, type OpenPosition as w, type OriginationTier as x, type PendingOperation as y, type PositionClosedFees as z };
|