@dimes-dot-fi/sdk 1.1.0 → 1.2.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.
@@ -96,6 +96,34 @@ interface components {
96
96
  /** @description Origination fee tiers by leverage */
97
97
  origination_tiers: components["schemas"]["CustomerOriginationTier"][];
98
98
  };
99
+ CustomerMaxMarketLeveragePerNotional: {
100
+ /**
101
+ * @description Maximum market leverage in basis points when the position notional is $100
102
+ * @example 100000
103
+ */
104
+ at100_usd_bps: number;
105
+ /**
106
+ * @description Maximum market leverage in basis points when the position notional is $500
107
+ * @example 80000
108
+ */
109
+ at500_usd_bps: number;
110
+ /**
111
+ * @description Maximum market leverage in basis points when the position notional is $1,000
112
+ * @example 60000
113
+ */
114
+ at1000_usd_bps: number;
115
+ /**
116
+ * @description Maximum market leverage in basis points when the position notional is $10,000
117
+ * @example 30000
118
+ */
119
+ at10000_usd_bps: number;
120
+ };
121
+ CustomerSidedMaxMarketLeveragePerNotional: {
122
+ /** @description Per-notional max market leverage for the YES side */
123
+ yes: components["schemas"]["CustomerMaxMarketLeveragePerNotional"];
124
+ /** @description Per-notional max market leverage for the NO side */
125
+ no: components["schemas"]["CustomerMaxMarketLeveragePerNotional"];
126
+ };
99
127
  CustomerLeverage: {
100
128
  /**
101
129
  * @deprecated
@@ -103,16 +131,18 @@ interface components {
103
131
  * @example 50000
104
132
  */
105
133
  max_bps: number;
134
+ /** @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. */
135
+ max_market_leverage_per_notional: components["schemas"]["CustomerSidedMaxMarketLeveragePerNotional"];
106
136
  /**
107
- * @description Maximum leverage in basis points for the YES side
137
+ * @description Maximum leverage in basis points for the NO side
108
138
  * @example 50000
109
139
  */
110
- max_yes_bps: number;
140
+ max_no_bps: number;
111
141
  /**
112
- * @description Maximum leverage in basis points for the NO side
142
+ * @description Maximum leverage in basis points for the YES side
113
143
  * @example 50000
114
144
  */
115
- max_no_bps: number;
145
+ max_yes_bps: number;
116
146
  /**
117
147
  * @description Minimum leverage in basis points
118
148
  * @example 10000
@@ -124,6 +154,24 @@ interface components {
124
154
  */
125
155
  step_bps: number;
126
156
  };
157
+ CustomerSideEligibility: {
158
+ /**
159
+ * @description Whether this market is accepting new positions on this side
160
+ * @example true
161
+ */
162
+ accepting_new_positions: boolean;
163
+ /**
164
+ * @description Reason code if this side is not accepting new positions; null when accepting
165
+ * @example QUOTE_MARKET_NOT_ELIGIBLE
166
+ */
167
+ rejection_reason_code?: string | null;
168
+ };
169
+ CustomerSidedEligibility: {
170
+ /** @description Eligibility for the YES side */
171
+ yes: components["schemas"]["CustomerSideEligibility"];
172
+ /** @description Eligibility for the NO side */
173
+ no: components["schemas"]["CustomerSideEligibility"];
174
+ };
127
175
  CustomerMarketPrices: {
128
176
  /**
129
177
  * @description NO side ask price formatted as USD
@@ -200,8 +248,8 @@ interface components {
200
248
  */
201
249
  tags: string[];
202
250
  /**
203
- * @description Market ticker identifier
204
- * @example TRUMP-2024-WIN
251
+ * @description Market ticker sourced from the upstream trading venue (e.g. the Polymarket slug)
252
+ * @example will-trump-win-the-2024-election
205
253
  */
206
254
  ticker: string;
207
255
  /** @description Market title */
@@ -298,6 +346,8 @@ interface components {
298
346
  * @example QUOTE_MARKET_NOT_ELIGIBLE
299
347
  */
300
348
  rejection_reason_code?: string;
349
+ /** @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). */
350
+ sided_eligibility: components["schemas"]["CustomerSidedEligibility"];
301
351
  /** @description Subtitle for the YES outcome */
302
352
  yes_sub_title?: string;
303
353
  };
@@ -327,16 +377,31 @@ interface components {
327
377
  * @example 50000
328
378
  */
329
379
  notional_usd_pips: string;
380
+ /**
381
+ * @description Time in milliseconds from position creation to on-chain open confirmation. Null until the position is fully opened on chain.
382
+ * @example 12500
383
+ */
384
+ open_latency_ms?: number | null;
330
385
  /**
331
386
  * @description ISO 8601 timestamp when position was opened
332
387
  * @example 2025-01-15T10:30:00.000Z
333
388
  */
334
389
  opened_at?: string;
335
390
  /**
336
- * @description Origination fee in basis points
391
+ * @description Combined origination fee in basis points. `protocolOriginationFeeBps + partnerOriginationFeeBps === originationFeeBps`.
337
392
  * @example 100
338
393
  */
339
394
  origination_fee_bps: number;
395
+ /**
396
+ * @description Protocol portion of the origination fee in basis points. `protocolOriginationFeeBps + partnerOriginationFeeBps === originationFeeBps`.
397
+ * @example 80
398
+ */
399
+ protocol_origination_fee_bps: number;
400
+ /**
401
+ * @description Partner portion of the origination fee in basis points. `protocolOriginationFeeBps + partnerOriginationFeeBps === originationFeeBps`.
402
+ * @example 20
403
+ */
404
+ partner_origination_fee_bps: number;
340
405
  /**
341
406
  * @description Origination fee formatted as USD
342
407
  * @example 0.05
@@ -402,10 +467,10 @@ interface components {
402
467
  has_more: boolean;
403
468
  total_count?: number;
404
469
  /**
405
- * @description Current leverage of the position in basis points (20000 = 2x)
470
+ * @description Current leverage of the position in basis points (20000 = 2x), null if not yet calculated
406
471
  * @example 30000
407
472
  */
408
- current_leverage_bps: number;
473
+ current_leverage_bps: number | null;
409
474
  /**
410
475
  * @description ISO 8601 timestamp when the position was opened on-chain (null if not yet opened)
411
476
  * @example 2025-06-01T12:00:00.000Z
@@ -444,11 +509,16 @@ interface components {
444
509
  */
445
510
  effective_collateral_usd_pips: string;
446
511
  /**
447
- * @deprecated Use book_leverage_bps instead
512
+ * @deprecated
448
513
  * @description Current leverage in basis points
449
514
  * @example 18000
450
515
  */
451
516
  leverage_bps: number;
517
+ /**
518
+ * @description Current market-value leverage in basis points, computed from the live oracle price. Null when the position is insolvent (equity <= 0).
519
+ * @example 19500
520
+ */
521
+ market_leverage_bps?: number | null;
452
522
  /**
453
523
  * @description Current mark price formatted as USD
454
524
  * @example 0.55
@@ -460,22 +530,17 @@ interface components {
460
530
  */
461
531
  mark_price_usd_pips: string;
462
532
  /**
463
- * @description Current market-value leverage in basis points, computed from the live oracle price. Null when the position is insolvent (equity <= 0).
464
- * @example 19500
465
- */
466
- market_leverage_bps: number | null;
467
- /**
468
- * @description Unrealized PnL net of all fees (origination + pending lifetime) as return on equity in basis points
533
+ * @description Unrealized PnL net of all fees (origination + pending lifetime + accrued venue) as return on equity in basis points
469
534
  * @example 1800
470
535
  */
471
536
  net_unrealized_pnl_bps: number;
472
537
  /**
473
- * @description Unrealized PnL net of all fees formatted as USD
538
+ * @description Unrealized PnL net of all fees (origination + pending lifetime + accrued venue) formatted as USD
474
539
  * @example 0.45
475
540
  */
476
541
  net_unrealized_pnl_usd: string;
477
542
  /**
478
- * @description Unrealized PnL net of all fees in USD pips (can be negative)
543
+ * @description Unrealized PnL net of all fees (origination + pending lifetime + accrued venue) in USD pips (can be negative)
479
544
  * @example 4500
480
545
  */
481
546
  net_unrealized_pnl_usd_pips: string;
@@ -531,6 +596,16 @@ interface components {
531
596
  * @example 100
532
597
  */
533
598
  accrued_lifetime_fee_usd_pips: string;
599
+ /**
600
+ * @description Venue (Polymarket/Kalshi) trading fees paid so far on this position, summed across open and any force-unwind exchange transactions, formatted as USD.
601
+ * @example 0.02
602
+ */
603
+ accrued_venue_fee_usd: string;
604
+ /**
605
+ * @description Venue trading fees paid so far on this position in USD pips.
606
+ * @example 200
607
+ */
608
+ accrued_venue_fee_usd_pips: string;
534
609
  /**
535
610
  * @description Lifetime fee APR in basis points
536
611
  * @example 500
@@ -546,6 +621,16 @@ interface components {
546
621
  * @example 50
547
622
  */
548
623
  pending_lifetime_fee_usd_pips: string;
624
+ /**
625
+ * @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`.
626
+ * @example 0.085
627
+ */
628
+ total_fees_usd: string;
629
+ /**
630
+ * @description Sum of all fees accrued or owed so far (origination + accrued lifetime + pending lifetime + accrued venue) in USD pips.
631
+ * @example 850
632
+ */
633
+ total_fees_usd_pips: string;
549
634
  };
550
635
  CustomerPositionRisk: {
551
636
  /**
@@ -668,28 +753,43 @@ interface components {
668
753
  */
669
754
  lifetime_apr_bps: number;
670
755
  /**
671
- * @description Origination fee in basis points
756
+ * @deprecated
757
+ * @description Deprecated — use `entry.originationFeeBps`. Same value, kept for backwards compatibility.
672
758
  * @example 100
673
759
  */
674
760
  origination_fee_bps: number;
675
761
  /**
676
- * @description Origination fee formatted as USD
762
+ * @deprecated
763
+ * @description Deprecated — use `entry.protocolOriginationFeeBps`. Same value, kept for backwards compatibility.
764
+ * @example 80
765
+ */
766
+ protocol_origination_fee_bps: number;
767
+ /**
768
+ * @deprecated
769
+ * @description Deprecated — use `entry.partnerOriginationFeeBps`. Same value, kept for backwards compatibility.
770
+ * @example 20
771
+ */
772
+ partner_origination_fee_bps: number;
773
+ /**
774
+ * @deprecated
775
+ * @description Deprecated — use `entry.originationFeeUsd`. Same value, kept for backwards compatibility.
677
776
  * @example 0.05
678
777
  */
679
778
  origination_fee_usd: string;
680
779
  /**
681
- * @description Origination fee in USD pips
780
+ * @deprecated
781
+ * @description Deprecated — use `entry.originationFeeUsdPips`. Same value, kept for backwards compatibility.
682
782
  * @example 500
683
783
  */
684
784
  origination_fee_usd_pips: string;
685
785
  /**
686
786
  * @description Total blended fees formatted as USD
687
- * @example 0.065
787
+ * @example 0.085
688
788
  */
689
789
  total_fees_usd: string;
690
790
  /**
691
- * @description Total blended fees (origination + lifetime + liquidation) in USD pips
692
- * @example 650
791
+ * @description Total blended fees (origination + lifetime + liquidation + venue) in USD pips
792
+ * @example 850
693
793
  */
694
794
  total_fees_usd_pips: string;
695
795
  /**
@@ -702,6 +802,16 @@ interface components {
702
802
  * @example 150
703
803
  */
704
804
  total_lifetime_fee_usd_pips: string;
805
+ /**
806
+ * @description Total venue (Polymarket/Kalshi) trading fees collected across the position lifetime (open + close/liquidation/settle + force-unwind), formatted as USD.
807
+ * @example 0.02
808
+ */
809
+ total_venue_fee_usd: string;
810
+ /**
811
+ * @description Total venue trading fees collected across the position lifetime in USD pips.
812
+ * @example 200
813
+ */
814
+ total_venue_fee_usd_pips: string;
705
815
  };
706
816
  CustomerPositionResult: {
707
817
  /**
@@ -730,17 +840,17 @@ interface components {
730
840
  */
731
841
  collected_liquidation_fee_usd_pips: string;
732
842
  /**
733
- * @description Realized PnL net of all fees (origination + lifetime + liquidation) as return on equity in basis points
843
+ * @description Realized PnL net of all fees (origination + lifetime + liquidation + venue) as return on equity in basis points
734
844
  * @example 1700
735
845
  */
736
846
  net_realized_pnl_bps: number;
737
847
  /**
738
- * @description Realized PnL net of all fees formatted as USD
848
+ * @description Realized PnL net of all fees (origination + lifetime + liquidation + venue) formatted as USD
739
849
  * @example 0.435
740
850
  */
741
851
  net_realized_pnl_usd: string;
742
852
  /**
743
- * @description Realized PnL net of all fees in USD pips (can be negative)
853
+ * @description Realized PnL net of all fees (origination + lifetime + liquidation + venue) in USD pips (can be negative)
744
854
  * @example 4350
745
855
  */
746
856
  net_realized_pnl_usd_pips: string;
@@ -855,7 +965,7 @@ interface components {
855
965
  */
856
966
  pm_provider: "kalshi" | "polymarket";
857
967
  };
858
- ApiCustomerOffer: {
968
+ CustomerOffer: {
859
969
  /**
860
970
  * @description Offer ID
861
971
  * @example dm_off_abc123
@@ -1099,10 +1209,13 @@ interface components {
1099
1209
  type Raw = components["schemas"];
1100
1210
  type Market = CamelizeKeys<Raw["CustomerMarket"]>;
1101
1211
  type MarketLeverage = CamelizeKeys<Raw["CustomerLeverage"]>;
1212
+ type MarketMaxLeveragePerNotional = CamelizeKeys<Raw["CustomerMaxMarketLeveragePerNotional"]>;
1213
+ type MarketSidedMaxLeveragePerNotional = CamelizeKeys<Raw["CustomerSidedMaxMarketLeveragePerNotional"]>;
1214
+ type MarketSidedEligibility = CamelizeKeys<Raw["CustomerSidedEligibility"]>;
1102
1215
  type MarketFees = CamelizeKeys<Raw["CustomerFees"]>;
1103
1216
  type MarketPrices = CamelizeKeys<Raw["CustomerMarketPrices"]>;
1104
1217
  type OriginationTier = CamelizeKeys<Raw["CustomerOriginationTier"]>;
1105
- type Offer = CamelizeKeys<Raw["ApiCustomerOffer"]>;
1218
+ type Offer = CamelizeKeys<Raw["CustomerOffer"]>;
1106
1219
  type OpenPosition = CamelizeKeys<Raw["CustomerOpenPosition"]>;
1107
1220
  type ClosedPosition = CamelizeKeys<Raw["CustomerClosedPosition"]>;
1108
1221
  type Position = OpenPosition | ClosedPosition;
@@ -1131,4 +1244,4 @@ declare function isOpenPosition(p: Position): p is OpenPosition;
1131
1244
  declare function isClosedPosition(p: Position): p is ClosedPosition;
1132
1245
  declare function leverageMaxBps(lev: MarketLeverage, side: "yes" | "no"): number;
1133
1246
 
1134
- export { type CreateOfferParams as C, type Market as M, type Offer as O, type Position as P, type CamelizeKeys as a, type ClosedPosition as b, type ContractInfo as c, type CreateTokenResult as d, type CustomerLimit as e, type MarketFees as f, type MarketLeverage as g, type MarketPrices as h, type OpenPosition as i, type OriginationTier as j, type PositionClosedFees as k, type PositionCurrent as l, type PositionEntry as m, type PositionFailure as n, type PositionOpenFees as o, type PositionResult as p, type PositionRisk as q, type PositionTiming as r, type PositionUnwind as s, type PositionUnwindList as t, isClosedPosition as u, isOpenPosition as v, leverageMaxBps as w };
1247
+ export { type CreateOfferParams as C, type Market as M, type Offer as O, type Position as P, type CamelizeKeys as a, type ClosedPosition as b, type ContractInfo as c, type CreateTokenResult as d, type CustomerLimit as e, type MarketFees as f, type MarketLeverage as g, type MarketMaxLeveragePerNotional as h, type MarketPrices as i, type MarketSidedEligibility as j, type MarketSidedMaxLeveragePerNotional as k, type OpenPosition as l, type OriginationTier as m, type PositionClosedFees as n, type PositionCurrent as o, type PositionEntry as p, type PositionFailure as q, type PositionOpenFees as r, type PositionResult as s, type PositionRisk as t, type PositionTiming as u, type PositionUnwind as v, type PositionUnwindList as w, isClosedPosition as x, isOpenPosition as y, leverageMaxBps as z };