@dimes-dot-fi/sdk 2.1.0 → 2.3.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/dist/{aliases-BJyM8ydu.d.cts → aliases-Dne14KBa.d.cts} +125 -11
- package/dist/{aliases-BJyM8ydu.d.ts → aliases-Dne14KBa.d.ts} +125 -11
- package/dist/{chunk-PZCBUVPD.mjs → chunk-4OKYU5D7.mjs} +5 -2
- package/dist/{chunk-PZCBUVPD.mjs.map → chunk-4OKYU5D7.mjs.map} +1 -1
- package/dist/{chunk-5VHDXPRV.mjs → chunk-7SGBJTUW.mjs} +2 -2
- package/dist/{chunk-72LTVPD2.cjs → chunk-E6YJDY4F.cjs} +5 -2
- package/dist/chunk-E6YJDY4F.cjs.map +1 -0
- package/dist/{chunk-7SAMK7CS.cjs → chunk-GY6L2QGR.cjs} +5 -5
- package/dist/{chunk-7SAMK7CS.cjs.map → chunk-GY6L2QGR.cjs.map} +1 -1
- package/dist/{chunk-T67Z74J3.mjs → chunk-IJO5E22G.mjs} +2 -2
- package/dist/{chunk-PK2PRTQW.mjs → chunk-TYR33WJW.mjs} +9 -4
- package/dist/chunk-TYR33WJW.mjs.map +1 -0
- package/dist/{chunk-FAW2C5AM.cjs → chunk-UPNJRN65.cjs} +4 -4
- package/dist/{chunk-FAW2C5AM.cjs.map → chunk-UPNJRN65.cjs.map} +1 -1
- package/dist/{chunk-53U53KZ2.cjs → chunk-UYDXDYEP.cjs} +9 -4
- package/dist/chunk-UYDXDYEP.cjs.map +1 -0
- package/dist/contract/index.cjs +21 -14
- package/dist/contract/index.cjs.map +1 -1
- package/dist/contract/index.d.cts +3 -3
- package/dist/contract/index.d.ts +3 -3
- package/dist/contract/index.mjs +9 -2
- package/dist/contract/index.mjs.map +1 -1
- package/dist/{dimes-client-ntybPwHK.d.cts → dimes-client-D9tohawC.d.cts} +2 -1
- package/dist/{dimes-client-DLbPP30g.d.ts → dimes-client-DJ1d_p31.d.ts} +2 -1
- package/dist/{dimes-error-BhKtCgba.d.cts → dimes-error-E9yPAZb-.d.cts} +1 -1
- package/dist/{dimes-error-DjxvjzCZ.d.ts → dimes-error-hSoOierP.d.ts} +1 -1
- package/dist/index.cjs +14 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.mjs +10 -5
- package/dist/index.mjs.map +1 -1
- package/dist/{quote-BoTWtznc.d.ts → quote-D4QunMtN.d.ts} +2 -2
- package/dist/{quote-Bc9H5-2H.d.cts → quote-sWguOcoJ.d.cts} +2 -2
- package/dist/react/index.cjs +30 -12
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +7 -5
- package/dist/react/index.d.ts +7 -5
- package/dist/react/index.mjs +25 -7
- package/dist/react/index.mjs.map +1 -1
- package/dist/{types-ClHQbIcY.d.ts → types-BHU4Qq7e.d.ts} +6 -3
- package/dist/{types-Co-2bQSi.d.cts → types-Bvj_WDbX.d.cts} +6 -3
- package/dist/ws/index.cjs +3 -3
- package/dist/ws/index.d.cts +3 -3
- package/dist/ws/index.d.ts +3 -3
- package/dist/ws/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-53U53KZ2.cjs.map +0 -1
- package/dist/chunk-72LTVPD2.cjs.map +0 -1
- package/dist/chunk-PK2PRTQW.mjs.map +0 -1
- /package/dist/{chunk-5VHDXPRV.mjs.map → chunk-7SGBJTUW.mjs.map} +0 -0
- /package/dist/{chunk-T67Z74J3.mjs.map → chunk-IJO5E22G.mjs.map} +0 -0
|
@@ -439,7 +439,7 @@ interface components {
|
|
|
439
439
|
* @description Prediction market provider
|
|
440
440
|
* @enum {string}
|
|
441
441
|
*/
|
|
442
|
-
provider: "
|
|
442
|
+
provider: "polymarket";
|
|
443
443
|
/**
|
|
444
444
|
* @description Current market status
|
|
445
445
|
* @enum {string}
|
|
@@ -505,6 +505,12 @@ interface components {
|
|
|
505
505
|
* @example 50000
|
|
506
506
|
*/
|
|
507
507
|
min_notional_usd_pips: string;
|
|
508
|
+
/**
|
|
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 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.
|
|
510
|
+
* @example none
|
|
511
|
+
* @enum {string}
|
|
512
|
+
*/
|
|
513
|
+
settlement_state: "awaiting_resolution" | "none" | "settling" | "unresolved_upstream" | "voided";
|
|
508
514
|
/**
|
|
509
515
|
* @description Capacity-limited maximum notional for NO side formatted as USD
|
|
510
516
|
* @example 50.00
|
|
@@ -666,6 +672,11 @@ interface components {
|
|
|
666
672
|
* @example 10000000
|
|
667
673
|
*/
|
|
668
674
|
position_token_units?: string | null;
|
|
675
|
+
/**
|
|
676
|
+
* @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.
|
|
677
|
+
* @example 9657
|
|
678
|
+
*/
|
|
679
|
+
initial_fill_bps?: number | null;
|
|
669
680
|
};
|
|
670
681
|
CustomerPositionFailure: {
|
|
671
682
|
/**
|
|
@@ -675,6 +686,12 @@ interface components {
|
|
|
675
686
|
reason: string;
|
|
676
687
|
};
|
|
677
688
|
CustomerPositionUnwind: {
|
|
689
|
+
/**
|
|
690
|
+
* @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.
|
|
691
|
+
* @example spread_blowout
|
|
692
|
+
* @enum {string|null}
|
|
693
|
+
*/
|
|
694
|
+
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;
|
|
678
695
|
/**
|
|
679
696
|
* @description Leverage after unwind in basis points (20000 = 2x)
|
|
680
697
|
* @example 30000
|
|
@@ -690,6 +707,11 @@ interface components {
|
|
|
690
707
|
* @example 2025-06-02T14:30:00.000Z
|
|
691
708
|
*/
|
|
692
709
|
executed_at: string;
|
|
710
|
+
/**
|
|
711
|
+
* @description Human-readable explanation of `reason` — a customer-facing sentence describing the market condition that triggered this deleverage. Null whenever `reason` is null.
|
|
712
|
+
* @example The bid-ask spread widened sharply beyond its recent baseline, signalling thinning liquidity.
|
|
713
|
+
*/
|
|
714
|
+
reason_detail?: string | null;
|
|
693
715
|
};
|
|
694
716
|
CustomerPositionUnwindList: {
|
|
695
717
|
data: components["schemas"]["CustomerPositionUnwind"][];
|
|
@@ -833,6 +855,11 @@ interface components {
|
|
|
833
855
|
* @example 10000000
|
|
834
856
|
*/
|
|
835
857
|
position_token_units: string;
|
|
858
|
+
/**
|
|
859
|
+
* @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.
|
|
860
|
+
* @example 7000
|
|
861
|
+
*/
|
|
862
|
+
remaining_bps?: number | null;
|
|
836
863
|
/**
|
|
837
864
|
* @description Total position value formatted as USD
|
|
838
865
|
* @example 3.00
|
|
@@ -871,7 +898,7 @@ interface components {
|
|
|
871
898
|
*/
|
|
872
899
|
accrued_lifetime_fee_usd_pips: string;
|
|
873
900
|
/**
|
|
874
|
-
* @description Venue (Polymarket
|
|
901
|
+
* @description Venue (Polymarket) trading fees paid so far on this position, summed across open and any force-unwind exchange transactions, formatted as USD.
|
|
875
902
|
* @example 0.02
|
|
876
903
|
*/
|
|
877
904
|
accrued_venue_fee_usd: string;
|
|
@@ -959,6 +986,12 @@ interface components {
|
|
|
959
986
|
* @enum {string}
|
|
960
987
|
*/
|
|
961
988
|
market_status: "active" | "amended" | "closed" | "determined" | "disputed" | "finalized" | "inactive" | "initialized";
|
|
989
|
+
/**
|
|
990
|
+
* @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.
|
|
991
|
+
* @example awaiting_resolution
|
|
992
|
+
* @enum {string}
|
|
993
|
+
*/
|
|
994
|
+
settlement_state: "awaiting_resolution" | "none" | "settling" | "unresolved_upstream" | "voided";
|
|
962
995
|
/**
|
|
963
996
|
* @description Minutes until market closes
|
|
964
997
|
* @example 1440
|
|
@@ -979,7 +1012,7 @@ interface components {
|
|
|
979
1012
|
* @description Prediction market provider
|
|
980
1013
|
* @enum {string}
|
|
981
1014
|
*/
|
|
982
|
-
provider: "
|
|
1015
|
+
provider: "polymarket";
|
|
983
1016
|
/**
|
|
984
1017
|
* @description Market side
|
|
985
1018
|
* @enum {string}
|
|
@@ -1084,7 +1117,7 @@ interface components {
|
|
|
1084
1117
|
*/
|
|
1085
1118
|
total_lifetime_fee_usd_pips: string;
|
|
1086
1119
|
/**
|
|
1087
|
-
* @description Total venue (Polymarket
|
|
1120
|
+
* @description Total venue (Polymarket) trading fees collected across the position lifetime (open + close/liquidation/settle + force-unwind), formatted as USD.
|
|
1088
1121
|
* @example 0.02
|
|
1089
1122
|
*/
|
|
1090
1123
|
total_venue_fee_usd: string;
|
|
@@ -1180,7 +1213,7 @@ interface components {
|
|
|
1180
1213
|
* @description Prediction market provider
|
|
1181
1214
|
* @enum {string}
|
|
1182
1215
|
*/
|
|
1183
|
-
provider: "
|
|
1216
|
+
provider: "polymarket";
|
|
1184
1217
|
/**
|
|
1185
1218
|
* @description Market side
|
|
1186
1219
|
* @enum {string}
|
|
@@ -1227,6 +1260,73 @@ interface components {
|
|
|
1227
1260
|
*/
|
|
1228
1261
|
revert_reason?: "exchange_unavailable" | "slippage_exceeded" | "unknown" | null;
|
|
1229
1262
|
};
|
|
1263
|
+
CustomerPartialClose: {
|
|
1264
|
+
/**
|
|
1265
|
+
* @description ISO 8601 timestamp when the partial close settled on-chain
|
|
1266
|
+
* @example 2026-07-01T14:59:28.000Z
|
|
1267
|
+
*/
|
|
1268
|
+
executed_at: string;
|
|
1269
|
+
/**
|
|
1270
|
+
* @description Token units sold in this partial close (1000000 units = 1 token)
|
|
1271
|
+
* @example 94590000
|
|
1272
|
+
*/
|
|
1273
|
+
sold_token_units: string;
|
|
1274
|
+
/**
|
|
1275
|
+
* @description Average realized sale price for this partial close, in USD pips (10000 = $1.00)
|
|
1276
|
+
* @example 2838
|
|
1277
|
+
*/
|
|
1278
|
+
average_sale_price_usd_pips: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* @description Average realized sale price formatted as USD
|
|
1281
|
+
* @example 0.28
|
|
1282
|
+
*/
|
|
1283
|
+
average_sale_price_usd: string;
|
|
1284
|
+
/**
|
|
1285
|
+
* @description Gross sale proceeds received for the sold slice, in USD pips (10000 = $1.00)
|
|
1286
|
+
* @example 268468
|
|
1287
|
+
*/
|
|
1288
|
+
sale_proceeds_usd_pips: string;
|
|
1289
|
+
/**
|
|
1290
|
+
* @description Gross sale proceeds formatted as USD
|
|
1291
|
+
* @example 26.85
|
|
1292
|
+
*/
|
|
1293
|
+
sale_proceeds_usd: string;
|
|
1294
|
+
/**
|
|
1295
|
+
* @description Protocol capital repaid from the sale proceeds, in USD pips (10000 = $1.00)
|
|
1296
|
+
* @example 144859
|
|
1297
|
+
*/
|
|
1298
|
+
capital_repaid_usd_pips: string;
|
|
1299
|
+
/**
|
|
1300
|
+
* @description Protocol capital repaid formatted as USD
|
|
1301
|
+
* @example 14.49
|
|
1302
|
+
*/
|
|
1303
|
+
capital_repaid_usd: string;
|
|
1304
|
+
/**
|
|
1305
|
+
* @description Amount paid out to the position owner from the sale proceeds, in USD pips (10000 = $1.00)
|
|
1306
|
+
* @example 123608
|
|
1307
|
+
*/
|
|
1308
|
+
user_payout_usd_pips: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* @description Owner payout formatted as USD
|
|
1311
|
+
* @example 12.36
|
|
1312
|
+
*/
|
|
1313
|
+
user_payout_usd: string;
|
|
1314
|
+
/**
|
|
1315
|
+
* @description Position token units still held after this partial close (1000000 units = 1 token)
|
|
1316
|
+
* @example 220720000
|
|
1317
|
+
*/
|
|
1318
|
+
remaining_position_token_units: string;
|
|
1319
|
+
/**
|
|
1320
|
+
* @description Book leverage after this partial close in basis points (20000 = 2x). Null if not recorded on-chain.
|
|
1321
|
+
* @example 19999
|
|
1322
|
+
*/
|
|
1323
|
+
new_leverage_bps: number | null;
|
|
1324
|
+
};
|
|
1325
|
+
CustomerPartialCloseList: {
|
|
1326
|
+
data: components["schemas"]["CustomerPartialClose"][];
|
|
1327
|
+
has_more: boolean;
|
|
1328
|
+
total_count?: number;
|
|
1329
|
+
};
|
|
1230
1330
|
PositionTransactionEntry: {
|
|
1231
1331
|
/**
|
|
1232
1332
|
* @description On-chain hashes of the exchange (CLOB/DEX) fills nested under this transaction. Present only for transaction types that route through an exchange (open, close, liquidation, settle, force_unwind).
|
|
@@ -1265,6 +1365,18 @@ interface components {
|
|
|
1265
1365
|
/** @description Transactions that force-unwound (deleveraged) the position on chain, including the finalize-unwind transaction. */
|
|
1266
1366
|
force_unwind: components["schemas"]["PositionTransactionGroup"];
|
|
1267
1367
|
};
|
|
1368
|
+
CustomerSampleEvents: {
|
|
1369
|
+
/**
|
|
1370
|
+
* @description Total number of events that will be delivered over the WebSocket connection.
|
|
1371
|
+
* @example 19
|
|
1372
|
+
*/
|
|
1373
|
+
event_count: number;
|
|
1374
|
+
/**
|
|
1375
|
+
* @description Delay between two consecutive events, in milliseconds.
|
|
1376
|
+
* @example 1000
|
|
1377
|
+
*/
|
|
1378
|
+
interval_ms: number;
|
|
1379
|
+
};
|
|
1268
1380
|
CreateOfferBody: {
|
|
1269
1381
|
/**
|
|
1270
1382
|
* @description Leverage in basis points (20000 = 2x, 100000 = 10x). Must be divisible by 2500. Maximum 10x.
|
|
@@ -1293,8 +1405,8 @@ interface components {
|
|
|
1293
1405
|
slippage_bps: number;
|
|
1294
1406
|
/**
|
|
1295
1407
|
* @description Prediction market provider
|
|
1296
|
-
* @default
|
|
1297
|
-
* @example
|
|
1408
|
+
* @default polymarket
|
|
1409
|
+
* @example polymarket
|
|
1298
1410
|
* @enum {string}
|
|
1299
1411
|
*/
|
|
1300
1412
|
pm_provider: "kalshi" | "polymarket";
|
|
@@ -1352,7 +1464,7 @@ interface components {
|
|
|
1352
1464
|
* @description Prediction market provider
|
|
1353
1465
|
* @enum {string}
|
|
1354
1466
|
*/
|
|
1355
|
-
provider: "
|
|
1467
|
+
provider: "polymarket";
|
|
1356
1468
|
/**
|
|
1357
1469
|
* @description Wallet address (Solana public key or EVM address)
|
|
1358
1470
|
* @example 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
|
|
@@ -1526,7 +1638,7 @@ interface components {
|
|
|
1526
1638
|
*/
|
|
1527
1639
|
partner_origination_fee_usdc_units: string;
|
|
1528
1640
|
/**
|
|
1529
|
-
* @description Polymarket venue trading fee rate in basis points. Applied to expectedOpenTradingFeeUsdcUnits.
|
|
1641
|
+
* @description Polymarket venue trading fee rate in basis points. Applied to expectedOpenTradingFeeUsdcUnits.
|
|
1530
1642
|
* @example 100
|
|
1531
1643
|
*/
|
|
1532
1644
|
polymarket_trading_fee_bps: number;
|
|
@@ -1602,7 +1714,7 @@ interface components {
|
|
|
1602
1714
|
*/
|
|
1603
1715
|
total_user_amount_usd_pips: string;
|
|
1604
1716
|
/**
|
|
1605
|
-
* @description Total amount user must transfer at createPosition in USDC units (1,000,000 units = 1 USDC). Contract-ready value. On Polymarket = collateral + originationFee
|
|
1717
|
+
* @description Total amount user must transfer at createPosition in USDC units (1,000,000 units = 1 USDC). Contract-ready value. On Polymarket = collateral + originationFee.
|
|
1606
1718
|
* @example 2730000
|
|
1607
1719
|
*/
|
|
1608
1720
|
total_user_amount_usdc_units: string;
|
|
@@ -1648,6 +1760,8 @@ type CloseAttempt = CamelizeKeys<Raw["CustomerCloseAttempt"]>;
|
|
|
1648
1760
|
type PendingOperation = CamelizeKeys<Raw["CustomerPendingOperation"]>;
|
|
1649
1761
|
type PositionUnwind = CamelizeKeys<Raw["CustomerPositionUnwind"]>;
|
|
1650
1762
|
type PositionUnwindList = CamelizeKeys<Raw["CustomerPositionUnwindList"]>;
|
|
1763
|
+
type PositionPartialClose = CamelizeKeys<Raw["CustomerPartialClose"]>;
|
|
1764
|
+
type PositionPartialCloseList = CamelizeKeys<Raw["CustomerPartialCloseList"]>;
|
|
1651
1765
|
type PositionTransactions = CamelizeKeys<Raw["PositionTransactions"]>;
|
|
1652
1766
|
type ContractInfo = CamelizeKeys<Raw["CustomerContractInfo"]>;
|
|
1653
1767
|
type CustomerLimit = CamelizeKeys<Raw["CustomerLimit"]>;
|
|
@@ -1679,4 +1793,4 @@ declare function isOpenPosition(p: Position): p is OpenPosition;
|
|
|
1679
1793
|
declare function isClosedPosition(p: Position): p is ClosedPosition;
|
|
1680
1794
|
declare function leverageMaxBps(lev: MarketLeverage, side: "yes" | "no"): number;
|
|
1681
1795
|
|
|
1682
|
-
export { type
|
|
1796
|
+
export { type PositionFailure as A, type PositionOpenFees as B, type CreateQuoteParams as C, type PositionPartialClose as D, type PositionResult as E, type FeeRates as F, type PositionRisk as G, type PositionTiming as H, type PositionUnwind as I, type PositionUnwindList as J, isClosedPosition as K, isOpenPosition as L, type Market as M, leverageMaxBps as N, type Offer as O, type Position as P, type Quote as Q, type MarketPolymarket as a, type MarketLeverage as b, type PositionTransactions as c, type PositionPartialCloseList as d, type ContractInfo as e, type CustomerLimit as f, type FeeReportParams as g, type FeeReport as h, type CamelizeKeys as i, type CloseAttempt as j, type ClosedPosition as k, type CreateOfferParams as l, type CreateTokenResult as m, type FeeRatesMarket as n, type FeeRatesOriginationTier as o, type MarketFees as p, type MarketMaxLeveragePerNotional as q, type MarketPrices as r, type MarketSidedEligibility as s, type MarketSidedMaxLeveragePerNotional as t, type OpenPosition as u, type OriginationTier as v, type PendingOperation as w, type PositionClosedFees as x, type PositionCurrent as y, type PositionEntry as z };
|
|
@@ -439,7 +439,7 @@ interface components {
|
|
|
439
439
|
* @description Prediction market provider
|
|
440
440
|
* @enum {string}
|
|
441
441
|
*/
|
|
442
|
-
provider: "
|
|
442
|
+
provider: "polymarket";
|
|
443
443
|
/**
|
|
444
444
|
* @description Current market status
|
|
445
445
|
* @enum {string}
|
|
@@ -505,6 +505,12 @@ interface components {
|
|
|
505
505
|
* @example 50000
|
|
506
506
|
*/
|
|
507
507
|
min_notional_usd_pips: string;
|
|
508
|
+
/**
|
|
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 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.
|
|
510
|
+
* @example none
|
|
511
|
+
* @enum {string}
|
|
512
|
+
*/
|
|
513
|
+
settlement_state: "awaiting_resolution" | "none" | "settling" | "unresolved_upstream" | "voided";
|
|
508
514
|
/**
|
|
509
515
|
* @description Capacity-limited maximum notional for NO side formatted as USD
|
|
510
516
|
* @example 50.00
|
|
@@ -666,6 +672,11 @@ interface components {
|
|
|
666
672
|
* @example 10000000
|
|
667
673
|
*/
|
|
668
674
|
position_token_units?: string | null;
|
|
675
|
+
/**
|
|
676
|
+
* @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.
|
|
677
|
+
* @example 9657
|
|
678
|
+
*/
|
|
679
|
+
initial_fill_bps?: number | null;
|
|
669
680
|
};
|
|
670
681
|
CustomerPositionFailure: {
|
|
671
682
|
/**
|
|
@@ -675,6 +686,12 @@ interface components {
|
|
|
675
686
|
reason: string;
|
|
676
687
|
};
|
|
677
688
|
CustomerPositionUnwind: {
|
|
689
|
+
/**
|
|
690
|
+
* @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.
|
|
691
|
+
* @example spread_blowout
|
|
692
|
+
* @enum {string|null}
|
|
693
|
+
*/
|
|
694
|
+
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;
|
|
678
695
|
/**
|
|
679
696
|
* @description Leverage after unwind in basis points (20000 = 2x)
|
|
680
697
|
* @example 30000
|
|
@@ -690,6 +707,11 @@ interface components {
|
|
|
690
707
|
* @example 2025-06-02T14:30:00.000Z
|
|
691
708
|
*/
|
|
692
709
|
executed_at: string;
|
|
710
|
+
/**
|
|
711
|
+
* @description Human-readable explanation of `reason` — a customer-facing sentence describing the market condition that triggered this deleverage. Null whenever `reason` is null.
|
|
712
|
+
* @example The bid-ask spread widened sharply beyond its recent baseline, signalling thinning liquidity.
|
|
713
|
+
*/
|
|
714
|
+
reason_detail?: string | null;
|
|
693
715
|
};
|
|
694
716
|
CustomerPositionUnwindList: {
|
|
695
717
|
data: components["schemas"]["CustomerPositionUnwind"][];
|
|
@@ -833,6 +855,11 @@ interface components {
|
|
|
833
855
|
* @example 10000000
|
|
834
856
|
*/
|
|
835
857
|
position_token_units: string;
|
|
858
|
+
/**
|
|
859
|
+
* @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.
|
|
860
|
+
* @example 7000
|
|
861
|
+
*/
|
|
862
|
+
remaining_bps?: number | null;
|
|
836
863
|
/**
|
|
837
864
|
* @description Total position value formatted as USD
|
|
838
865
|
* @example 3.00
|
|
@@ -871,7 +898,7 @@ interface components {
|
|
|
871
898
|
*/
|
|
872
899
|
accrued_lifetime_fee_usd_pips: string;
|
|
873
900
|
/**
|
|
874
|
-
* @description Venue (Polymarket
|
|
901
|
+
* @description Venue (Polymarket) trading fees paid so far on this position, summed across open and any force-unwind exchange transactions, formatted as USD.
|
|
875
902
|
* @example 0.02
|
|
876
903
|
*/
|
|
877
904
|
accrued_venue_fee_usd: string;
|
|
@@ -959,6 +986,12 @@ interface components {
|
|
|
959
986
|
* @enum {string}
|
|
960
987
|
*/
|
|
961
988
|
market_status: "active" | "amended" | "closed" | "determined" | "disputed" | "finalized" | "inactive" | "initialized";
|
|
989
|
+
/**
|
|
990
|
+
* @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.
|
|
991
|
+
* @example awaiting_resolution
|
|
992
|
+
* @enum {string}
|
|
993
|
+
*/
|
|
994
|
+
settlement_state: "awaiting_resolution" | "none" | "settling" | "unresolved_upstream" | "voided";
|
|
962
995
|
/**
|
|
963
996
|
* @description Minutes until market closes
|
|
964
997
|
* @example 1440
|
|
@@ -979,7 +1012,7 @@ interface components {
|
|
|
979
1012
|
* @description Prediction market provider
|
|
980
1013
|
* @enum {string}
|
|
981
1014
|
*/
|
|
982
|
-
provider: "
|
|
1015
|
+
provider: "polymarket";
|
|
983
1016
|
/**
|
|
984
1017
|
* @description Market side
|
|
985
1018
|
* @enum {string}
|
|
@@ -1084,7 +1117,7 @@ interface components {
|
|
|
1084
1117
|
*/
|
|
1085
1118
|
total_lifetime_fee_usd_pips: string;
|
|
1086
1119
|
/**
|
|
1087
|
-
* @description Total venue (Polymarket
|
|
1120
|
+
* @description Total venue (Polymarket) trading fees collected across the position lifetime (open + close/liquidation/settle + force-unwind), formatted as USD.
|
|
1088
1121
|
* @example 0.02
|
|
1089
1122
|
*/
|
|
1090
1123
|
total_venue_fee_usd: string;
|
|
@@ -1180,7 +1213,7 @@ interface components {
|
|
|
1180
1213
|
* @description Prediction market provider
|
|
1181
1214
|
* @enum {string}
|
|
1182
1215
|
*/
|
|
1183
|
-
provider: "
|
|
1216
|
+
provider: "polymarket";
|
|
1184
1217
|
/**
|
|
1185
1218
|
* @description Market side
|
|
1186
1219
|
* @enum {string}
|
|
@@ -1227,6 +1260,73 @@ interface components {
|
|
|
1227
1260
|
*/
|
|
1228
1261
|
revert_reason?: "exchange_unavailable" | "slippage_exceeded" | "unknown" | null;
|
|
1229
1262
|
};
|
|
1263
|
+
CustomerPartialClose: {
|
|
1264
|
+
/**
|
|
1265
|
+
* @description ISO 8601 timestamp when the partial close settled on-chain
|
|
1266
|
+
* @example 2026-07-01T14:59:28.000Z
|
|
1267
|
+
*/
|
|
1268
|
+
executed_at: string;
|
|
1269
|
+
/**
|
|
1270
|
+
* @description Token units sold in this partial close (1000000 units = 1 token)
|
|
1271
|
+
* @example 94590000
|
|
1272
|
+
*/
|
|
1273
|
+
sold_token_units: string;
|
|
1274
|
+
/**
|
|
1275
|
+
* @description Average realized sale price for this partial close, in USD pips (10000 = $1.00)
|
|
1276
|
+
* @example 2838
|
|
1277
|
+
*/
|
|
1278
|
+
average_sale_price_usd_pips: string;
|
|
1279
|
+
/**
|
|
1280
|
+
* @description Average realized sale price formatted as USD
|
|
1281
|
+
* @example 0.28
|
|
1282
|
+
*/
|
|
1283
|
+
average_sale_price_usd: string;
|
|
1284
|
+
/**
|
|
1285
|
+
* @description Gross sale proceeds received for the sold slice, in USD pips (10000 = $1.00)
|
|
1286
|
+
* @example 268468
|
|
1287
|
+
*/
|
|
1288
|
+
sale_proceeds_usd_pips: string;
|
|
1289
|
+
/**
|
|
1290
|
+
* @description Gross sale proceeds formatted as USD
|
|
1291
|
+
* @example 26.85
|
|
1292
|
+
*/
|
|
1293
|
+
sale_proceeds_usd: string;
|
|
1294
|
+
/**
|
|
1295
|
+
* @description Protocol capital repaid from the sale proceeds, in USD pips (10000 = $1.00)
|
|
1296
|
+
* @example 144859
|
|
1297
|
+
*/
|
|
1298
|
+
capital_repaid_usd_pips: string;
|
|
1299
|
+
/**
|
|
1300
|
+
* @description Protocol capital repaid formatted as USD
|
|
1301
|
+
* @example 14.49
|
|
1302
|
+
*/
|
|
1303
|
+
capital_repaid_usd: string;
|
|
1304
|
+
/**
|
|
1305
|
+
* @description Amount paid out to the position owner from the sale proceeds, in USD pips (10000 = $1.00)
|
|
1306
|
+
* @example 123608
|
|
1307
|
+
*/
|
|
1308
|
+
user_payout_usd_pips: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* @description Owner payout formatted as USD
|
|
1311
|
+
* @example 12.36
|
|
1312
|
+
*/
|
|
1313
|
+
user_payout_usd: string;
|
|
1314
|
+
/**
|
|
1315
|
+
* @description Position token units still held after this partial close (1000000 units = 1 token)
|
|
1316
|
+
* @example 220720000
|
|
1317
|
+
*/
|
|
1318
|
+
remaining_position_token_units: string;
|
|
1319
|
+
/**
|
|
1320
|
+
* @description Book leverage after this partial close in basis points (20000 = 2x). Null if not recorded on-chain.
|
|
1321
|
+
* @example 19999
|
|
1322
|
+
*/
|
|
1323
|
+
new_leverage_bps: number | null;
|
|
1324
|
+
};
|
|
1325
|
+
CustomerPartialCloseList: {
|
|
1326
|
+
data: components["schemas"]["CustomerPartialClose"][];
|
|
1327
|
+
has_more: boolean;
|
|
1328
|
+
total_count?: number;
|
|
1329
|
+
};
|
|
1230
1330
|
PositionTransactionEntry: {
|
|
1231
1331
|
/**
|
|
1232
1332
|
* @description On-chain hashes of the exchange (CLOB/DEX) fills nested under this transaction. Present only for transaction types that route through an exchange (open, close, liquidation, settle, force_unwind).
|
|
@@ -1265,6 +1365,18 @@ interface components {
|
|
|
1265
1365
|
/** @description Transactions that force-unwound (deleveraged) the position on chain, including the finalize-unwind transaction. */
|
|
1266
1366
|
force_unwind: components["schemas"]["PositionTransactionGroup"];
|
|
1267
1367
|
};
|
|
1368
|
+
CustomerSampleEvents: {
|
|
1369
|
+
/**
|
|
1370
|
+
* @description Total number of events that will be delivered over the WebSocket connection.
|
|
1371
|
+
* @example 19
|
|
1372
|
+
*/
|
|
1373
|
+
event_count: number;
|
|
1374
|
+
/**
|
|
1375
|
+
* @description Delay between two consecutive events, in milliseconds.
|
|
1376
|
+
* @example 1000
|
|
1377
|
+
*/
|
|
1378
|
+
interval_ms: number;
|
|
1379
|
+
};
|
|
1268
1380
|
CreateOfferBody: {
|
|
1269
1381
|
/**
|
|
1270
1382
|
* @description Leverage in basis points (20000 = 2x, 100000 = 10x). Must be divisible by 2500. Maximum 10x.
|
|
@@ -1293,8 +1405,8 @@ interface components {
|
|
|
1293
1405
|
slippage_bps: number;
|
|
1294
1406
|
/**
|
|
1295
1407
|
* @description Prediction market provider
|
|
1296
|
-
* @default
|
|
1297
|
-
* @example
|
|
1408
|
+
* @default polymarket
|
|
1409
|
+
* @example polymarket
|
|
1298
1410
|
* @enum {string}
|
|
1299
1411
|
*/
|
|
1300
1412
|
pm_provider: "kalshi" | "polymarket";
|
|
@@ -1352,7 +1464,7 @@ interface components {
|
|
|
1352
1464
|
* @description Prediction market provider
|
|
1353
1465
|
* @enum {string}
|
|
1354
1466
|
*/
|
|
1355
|
-
provider: "
|
|
1467
|
+
provider: "polymarket";
|
|
1356
1468
|
/**
|
|
1357
1469
|
* @description Wallet address (Solana public key or EVM address)
|
|
1358
1470
|
* @example 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU
|
|
@@ -1526,7 +1638,7 @@ interface components {
|
|
|
1526
1638
|
*/
|
|
1527
1639
|
partner_origination_fee_usdc_units: string;
|
|
1528
1640
|
/**
|
|
1529
|
-
* @description Polymarket venue trading fee rate in basis points. Applied to expectedOpenTradingFeeUsdcUnits.
|
|
1641
|
+
* @description Polymarket venue trading fee rate in basis points. Applied to expectedOpenTradingFeeUsdcUnits.
|
|
1530
1642
|
* @example 100
|
|
1531
1643
|
*/
|
|
1532
1644
|
polymarket_trading_fee_bps: number;
|
|
@@ -1602,7 +1714,7 @@ interface components {
|
|
|
1602
1714
|
*/
|
|
1603
1715
|
total_user_amount_usd_pips: string;
|
|
1604
1716
|
/**
|
|
1605
|
-
* @description Total amount user must transfer at createPosition in USDC units (1,000,000 units = 1 USDC). Contract-ready value. On Polymarket = collateral + originationFee
|
|
1717
|
+
* @description Total amount user must transfer at createPosition in USDC units (1,000,000 units = 1 USDC). Contract-ready value. On Polymarket = collateral + originationFee.
|
|
1606
1718
|
* @example 2730000
|
|
1607
1719
|
*/
|
|
1608
1720
|
total_user_amount_usdc_units: string;
|
|
@@ -1648,6 +1760,8 @@ type CloseAttempt = CamelizeKeys<Raw["CustomerCloseAttempt"]>;
|
|
|
1648
1760
|
type PendingOperation = CamelizeKeys<Raw["CustomerPendingOperation"]>;
|
|
1649
1761
|
type PositionUnwind = CamelizeKeys<Raw["CustomerPositionUnwind"]>;
|
|
1650
1762
|
type PositionUnwindList = CamelizeKeys<Raw["CustomerPositionUnwindList"]>;
|
|
1763
|
+
type PositionPartialClose = CamelizeKeys<Raw["CustomerPartialClose"]>;
|
|
1764
|
+
type PositionPartialCloseList = CamelizeKeys<Raw["CustomerPartialCloseList"]>;
|
|
1651
1765
|
type PositionTransactions = CamelizeKeys<Raw["PositionTransactions"]>;
|
|
1652
1766
|
type ContractInfo = CamelizeKeys<Raw["CustomerContractInfo"]>;
|
|
1653
1767
|
type CustomerLimit = CamelizeKeys<Raw["CustomerLimit"]>;
|
|
@@ -1679,4 +1793,4 @@ declare function isOpenPosition(p: Position): p is OpenPosition;
|
|
|
1679
1793
|
declare function isClosedPosition(p: Position): p is ClosedPosition;
|
|
1680
1794
|
declare function leverageMaxBps(lev: MarketLeverage, side: "yes" | "no"): number;
|
|
1681
1795
|
|
|
1682
|
-
export { type
|
|
1796
|
+
export { type PositionFailure as A, type PositionOpenFees as B, type CreateQuoteParams as C, type PositionPartialClose as D, type PositionResult as E, type FeeRates as F, type PositionRisk as G, type PositionTiming as H, type PositionUnwind as I, type PositionUnwindList as J, isClosedPosition as K, isOpenPosition as L, type Market as M, leverageMaxBps as N, type Offer as O, type Position as P, type Quote as Q, type MarketPolymarket as a, type MarketLeverage as b, type PositionTransactions as c, type PositionPartialCloseList as d, type ContractInfo as e, type CustomerLimit as f, type FeeReportParams as g, type FeeReport as h, type CamelizeKeys as i, type CloseAttempt as j, type ClosedPosition as k, type CreateOfferParams as l, type CreateTokenResult as m, type FeeRatesMarket as n, type FeeRatesOriginationTier as o, type MarketFees as p, type MarketMaxLeveragePerNotional as q, type MarketPrices as r, type MarketSidedEligibility as s, type MarketSidedMaxLeveragePerNotional as t, type OpenPosition as u, type OriginationTier as v, type PendingOperation as w, type PositionClosedFees as x, type PositionCurrent as y, type PositionEntry as z };
|
|
@@ -272,7 +272,10 @@ var friendlyByCode = {
|
|
|
272
272
|
quote_twap_data_unavailable: "Reference price (TWAP) is unavailable for this market.",
|
|
273
273
|
quote_revision_required: "Quote needs to be refreshed before submitting.",
|
|
274
274
|
quote_price_provider_not_found: "No price provider configured for this market.",
|
|
275
|
-
notional_selector_insufficient_liquidity: "Not enough liquidity
|
|
275
|
+
notional_selector_insufficient_liquidity: "Not enough liquidity to fill an order of this size. Try a smaller size.",
|
|
276
|
+
notional_selector_below_min_notional: "This side of the market doesn't have enough liquidity to support the minimum position size right now.",
|
|
277
|
+
notional_selector_empty_order_book: "This side of the market has no available liquidity right now. Try again shortly.",
|
|
278
|
+
notional_selector_pregame_insufficient_liquidity: "This market doesn't yet have enough pre-game liquidity to support a position. Try again closer to the event start.",
|
|
276
279
|
evm_gas_price_circuit_breaker: "EVM gas price is too high \u2014 trading is temporarily paused.",
|
|
277
280
|
evm_gas_price_spike: "EVM gas price spiked. Try again shortly.",
|
|
278
281
|
evm_simulation_failed: "Transaction simulation failed. The transaction would revert on-chain.",
|
|
@@ -337,4 +340,4 @@ export {
|
|
|
337
340
|
DimesApiError,
|
|
338
341
|
DimesContractError
|
|
339
342
|
};
|
|
340
|
-
//# sourceMappingURL=chunk-
|
|
343
|
+
//# sourceMappingURL=chunk-4OKYU5D7.mjs.map
|