@structbuild/sdk 0.2.10 → 0.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.
@@ -887,6 +887,105 @@ export interface paths {
887
887
  export type webhooks = Record<string, never>;
888
888
  export interface components {
889
889
  schemas: {
890
+ /** @description Output payload for ERC1155 setApprovalForAll events. */
891
+ ApprovalTrade: {
892
+ id: string;
893
+ hash: string;
894
+ /** Format: int64 */
895
+ block: number;
896
+ /** Format: int64 */
897
+ confirmed_at: number;
898
+ /** Format: int64 */
899
+ log_index: number;
900
+ /** Format: int64 */
901
+ block_index: number;
902
+ trader: components["schemas"]["TraderInfo"];
903
+ operator: string;
904
+ approved: boolean;
905
+ question?: string | null;
906
+ image_url?: string | null;
907
+ slug?: string | null;
908
+ event_slug?: string | null;
909
+ exchange: components["schemas"]["PolymarketExchange"];
910
+ };
911
+ /** @description V3 UMA OOv3: an assertion was disputed. */
912
+ AssertionDisputedEvent: {
913
+ id: string;
914
+ hash: string;
915
+ /** Format: int64 */
916
+ block: number;
917
+ /** Format: int64 */
918
+ confirmed_at: number;
919
+ /** Format: int64 */
920
+ log_index: number;
921
+ /** Format: int64 */
922
+ block_index: number;
923
+ oracle_contract: string;
924
+ assertion_id: string;
925
+ caller: string;
926
+ disputer: string;
927
+ condition_id?: string | null;
928
+ question?: string | null;
929
+ image_url?: string | null;
930
+ slug?: string | null;
931
+ event_slug?: string | null;
932
+ };
933
+ /** @description V3 UMA OOv3: a new assertion (resolution proposal) was made. */
934
+ AssertionMadeEvent: {
935
+ id: string;
936
+ hash: string;
937
+ /** Format: int64 */
938
+ block: number;
939
+ /** Format: int64 */
940
+ confirmed_at: number;
941
+ /** Format: int64 */
942
+ log_index: number;
943
+ /** Format: int64 */
944
+ block_index: number;
945
+ oracle_contract: string;
946
+ assertion_id: string;
947
+ domain_id: string;
948
+ claim: string;
949
+ asserter: string;
950
+ callback_recipient: string;
951
+ escalation_manager: string;
952
+ caller: string;
953
+ /** Format: int64 */
954
+ expiration_time: number;
955
+ currency: string;
956
+ bond: string;
957
+ identifier: string;
958
+ condition_id?: string | null;
959
+ proposed_outcome?: string | null;
960
+ question?: string | null;
961
+ image_url?: string | null;
962
+ slug?: string | null;
963
+ event_slug?: string | null;
964
+ };
965
+ /** @description V3 UMA OOv3: an assertion liveness period expired and was settled. */
966
+ AssertionSettledEvent: {
967
+ id: string;
968
+ hash: string;
969
+ /** Format: int64 */
970
+ block: number;
971
+ /** Format: int64 */
972
+ confirmed_at: number;
973
+ /** Format: int64 */
974
+ log_index: number;
975
+ /** Format: int64 */
976
+ block_index: number;
977
+ oracle_contract: string;
978
+ assertion_id: string;
979
+ bond_recipient: string;
980
+ disputed: boolean;
981
+ settlement_resolution: boolean;
982
+ settle_caller: string;
983
+ condition_id?: string | null;
984
+ question?: string | null;
985
+ image_url?: string | null;
986
+ slug?: string | null;
987
+ event_slug?: string | null;
988
+ };
890
989
  /** @description A single asset price history record from the `asset_price_history` table. */
891
990
  AssetPriceHistoryRow: {
892
991
  asset_symbol: string;
@@ -948,8 +1047,29 @@ export interface components {
948
1047
  /** Format: double */
949
1048
  price: number;
950
1049
  };
1050
+ /** @description Output payload for Cancelled orders. */
1051
+ CancelledTrade: {
1052
+ id: string;
1053
+ hash: string;
1054
+ /** Format: int64 */
1055
+ block: number;
1056
+ /** Format: int64 */
1057
+ confirmed_at: number;
1058
+ /** Format: int64 */
1059
+ log_index: number;
1060
+ /** Format: int64 */
1061
+ block_index: number;
1062
+ order_hash: string;
1063
+ question?: string | null;
1064
+ image_url?: string | null;
1065
+ slug?: string | null;
1066
+ event_slug?: string | null;
1067
+ exchange: components["schemas"]["PolymarketExchange"];
1068
+ };
951
1069
  /** @enum {string} */
952
1070
  CandlestickResolution: "1" | "5" | "15" | "30" | "60" | "240" | "D" | "1D";
1071
+ /** @enum {string} */
1072
+ ChartResolution: "1H" | "6H" | "1D" | "1W" | "1M" | "ALL";
953
1073
  /** @description CLOB reward (public API format) */
954
1074
  ClobReward: {
955
1075
  id: string;
@@ -1012,6 +1132,27 @@ export interface components {
1012
1132
  /** Format: int32 */
1013
1133
  ask_levels?: number | null;
1014
1134
  };
1135
+ /** @description CTF ConditionResolution: positions become redeemable on the Conditional Tokens contract. */
1136
+ ConditionResolutionEvent: {
1137
+ id: string;
1138
+ hash: string;
1139
+ /** Format: int64 */
1140
+ block: number;
1141
+ /** Format: int64 */
1142
+ confirmed_at: number;
1143
+ /** Format: int64 */
1144
+ log_index: number;
1145
+ /** Format: int64 */
1146
+ block_index: number;
1147
+ oracle_contract: string;
1148
+ condition_id: string;
1149
+ oracle: string;
1150
+ proposed_outcome?: string | null;
1151
+ question?: string | null;
1152
+ image_url?: string | null;
1153
+ slug?: string | null;
1154
+ event_slug?: string | null;
1155
+ };
1015
1156
  /** @description Enriched market data for event API responses */
1016
1157
  EventMarket: {
1017
1158
  /** @default */
@@ -1221,45 +1362,6 @@ export interface components {
1221
1362
  /** @description Holders grouped by outcome */
1222
1363
  outcomes: components["schemas"]["OutcomeHolders"][];
1223
1364
  };
1224
- /** @description Market metadata (enriched, cached version) */
1225
- MarketMetadata: {
1226
- condition_id: string;
1227
- question: string;
1228
- description: string;
1229
- slug: string;
1230
- event_slug?: string | null;
1231
- event_id?: string | null;
1232
- event_title?: string | null;
1233
- series_slug?: string | null;
1234
- neg_risk: boolean;
1235
- tokens: components["schemas"]["TokenOutcome"][];
1236
- image_url?: string | null;
1237
- tags: string[];
1238
- /** Format: int64 */
1239
- created_time?: number | null;
1240
- /** Format: int64 */
1241
- start_time?: number | null;
1242
- /** Format: int64 */
1243
- game_start_time?: number | null;
1244
- /** Format: int64 */
1245
- closed_time?: number | null;
1246
- /** Format: int64 */
1247
- end_time?: number | null;
1248
- title?: string | null;
1249
- id?: string | null;
1250
- /** Format: double */
1251
- volume_usd?: number | null;
1252
- /** Format: double */
1253
- liquidity_usd?: number | null;
1254
- outcomes: components["schemas"]["MarketOutcome"][];
1255
- metrics: {
1256
- [key: string]: number;
1257
- };
1258
- market_maker_address?: string | null;
1259
- creator?: string | null;
1260
- category?: string | null;
1261
- clob_rewards: components["schemas"]["ClobReward"][];
1262
- };
1263
1365
  /** @description Market outcome with timeframe metrics (websocket API format) */
1264
1366
  MarketMetadataOutcome: {
1265
1367
  token_id: string;
@@ -1326,9 +1428,10 @@ export interface components {
1326
1428
  highest_probability?: number | null;
1327
1429
  /** Format: int64 */
1328
1430
  total_holders?: number | null;
1431
+ /** Format: double */
1432
+ total_daily_rate?: number | null;
1329
1433
  winning_outcome?: null | components["schemas"]["MarketOutcome"];
1330
1434
  outcomes?: components["schemas"]["MarketOutcome"][];
1331
- rewards?: components["schemas"]["MarketReward"][];
1332
1435
  clob_rewards?: components["schemas"]["ClobReward"][];
1333
1436
  tags?: string[];
1334
1437
  event_slug?: string | null;
@@ -1339,26 +1442,8 @@ export interface components {
1339
1442
  /** Format: double */
1340
1443
  relevance_score?: number | null;
1341
1444
  };
1342
- /** @description Reward info for market API responses */
1343
- MarketReward: {
1344
- /**
1345
- * Format: double
1346
- * @default null
1347
- */
1348
- min_size: number | null;
1349
- /**
1350
- * Format: double
1351
- * @default null
1352
- */
1353
- max_spread: number | null;
1354
- /**
1355
- * Format: double
1356
- * @default null
1357
- */
1358
- daily_rate: number | null;
1359
- };
1360
1445
  /** @enum {string} */
1361
- MarketSortBy: "volume" | "txns" | "unique_traders" | "liquidity" | "holders" | "end_time" | "start_time" | "created_time" | "relevance";
1446
+ MarketSortBy: "volume" | "txns" | "unique_traders" | "liquidity" | "holders" | "total_daily_rate" | "end_time" | "start_time" | "created_time" | "relevance";
1362
1447
  /** @enum {string} */
1363
1448
  MarketStatus: "open" | "closed" | "all";
1364
1449
  MarketVolumeChartResponse: {
@@ -1381,8 +1466,93 @@ export interface components {
1381
1466
  /** Format: int32 */
1382
1467
  ntc: number;
1383
1468
  };
1469
+ /** @description Output payload for Merge trades (burn outcome tokens → receive collateral). */
1470
+ MergeTrade: {
1471
+ id: string;
1472
+ hash: string;
1473
+ /** Format: int64 */
1474
+ block: number;
1475
+ /** Format: int64 */
1476
+ confirmed_at: number;
1477
+ /** Format: int64 */
1478
+ log_index: number;
1479
+ /** Format: int64 */
1480
+ block_index: number;
1481
+ trader: components["schemas"]["TraderInfo"];
1482
+ condition_id?: string | null;
1483
+ question?: string | null;
1484
+ image_url?: string | null;
1485
+ slug?: string | null;
1486
+ event_slug?: string | null;
1487
+ /** Format: double */
1488
+ usd_amount: number;
1489
+ /** @description Per-position burn amounts */
1490
+ position_details?: components["schemas"]["PositionDetail"][];
1491
+ exchange: components["schemas"]["PolymarketExchange"];
1492
+ };
1384
1493
  /** @enum {string} */
1385
1494
  MetricsTimeframe: "1m" | "5m" | "30m" | "1h" | "6h" | "24h" | "7d" | "30d";
1495
+ /** @description NegRisk Adapter: outcome reported for a neg-risk market question. */
1496
+ NegRiskOutcomeReportedEvent: {
1497
+ id: string;
1498
+ hash: string;
1499
+ /** Format: int64 */
1500
+ block: number;
1501
+ /** Format: int64 */
1502
+ confirmed_at: number;
1503
+ /** Format: int64 */
1504
+ log_index: number;
1505
+ /** Format: int64 */
1506
+ block_index: number;
1507
+ oracle_contract: string;
1508
+ condition_id: string;
1509
+ proposed_outcome?: string | null;
1510
+ question?: string | null;
1511
+ image_url?: string | null;
1512
+ slug?: string | null;
1513
+ event_slug?: string | null;
1514
+ };
1515
+ /** @description Output payload for OrderFilled and OrdersMatched trades (actual buy/sell). */
1516
+ OrderFilledTrade: {
1517
+ id: string;
1518
+ hash: string;
1519
+ /** Format: int64 */
1520
+ block: number;
1521
+ /** Format: int64 */
1522
+ confirmed_at: number;
1523
+ /** Format: int64 */
1524
+ log_index: number;
1525
+ /** Format: int64 */
1526
+ block_index: number;
1527
+ order_hash: string;
1528
+ trader: components["schemas"]["TraderInfo"];
1529
+ taker: string;
1530
+ side: string;
1531
+ condition_id?: string | null;
1532
+ position_id: string;
1533
+ outcome?: string | null;
1534
+ /** Format: int32 */
1535
+ outcome_index?: number | null;
1536
+ question?: string | null;
1537
+ image_url?: string | null;
1538
+ slug?: string | null;
1539
+ event_slug?: string | null;
1540
+ /** Format: double */
1541
+ usd_amount: number;
1542
+ /** Format: double */
1543
+ shares_amount: number;
1544
+ /** Format: double */
1545
+ price: number;
1546
+ /** Format: double */
1547
+ probability?: number | null;
1548
+ /** Format: double */
1549
+ fee: number;
1550
+ /** Format: double */
1551
+ fee_shares: number;
1552
+ /** Format: double */
1553
+ fee_pct: number;
1554
+ exchange: components["schemas"]["PolymarketExchange"];
1555
+ };
1386
1556
  OrderbookHistoryRow: {
1387
1557
  /** Format: int64 */
1388
1558
  ts: number;
@@ -1636,6 +1806,11 @@ export interface components {
1636
1806
  /** @default null */
1637
1807
  series: null | components["schemas"]["PolymarketSeries"];
1638
1808
  };
1809
+ /**
1810
+ * @description Polymarket exchange contract types
1811
+ * @enum {string}
1812
+ */
1813
+ PolymarketExchange: "CTFExchange" | "NegRiskExchange" | "ConditionalTokens" | "NegRiskAdapter" | "Unknown";
1639
1814
  /**
1640
1815
  * @description A Polymarket series from the Gamma API
1641
1816
  * Series are parent groupings above events (e.g., "NBA Season 2024-25")
@@ -1723,6 +1898,18 @@ export interface components {
1723
1898
  outcome_index: number;
1724
1899
  data: components["schemas"]["PositionChartDataPoint"][];
1725
1900
  };
1901
+ /** @description Per-position detail for Split/Merge/Redemption trades. */
1902
+ PositionDetail: {
1903
+ /** @description ERC1155 position ID */
1904
+ position_id: string;
1905
+ /**
1906
+ * Format: int32
1907
+ * @description Outcome index (0 = Yes, 1 = No for binary)
1908
+ */
1909
+ outcome_index: number;
1910
+ /** @description Amount of shares created/burned/redeemed for this position */
1911
+ amount: string;
1912
+ };
1726
1913
  /** @description Response for position (position_id) holders endpoint */
1727
1914
  PositionHoldersResponse: {
1728
1915
  /** @description Position ID (ERC1155 token ID) */
@@ -1781,6 +1968,11 @@ export interface components {
1781
1968
  };
1782
1969
  /** @enum {string} */
1783
1970
  PositionPnlSortBy: "realized_pnl_usd" | "buy_usd" | "sell_usd" | "redemption_usd" | "total_buys" | "total_sells" | "total_shares_bought" | "total_shares_sold" | "avg_entry_price" | "avg_exit_price" | "total_fees" | "first_trade_at" | "last_trade_at" | "current_value" | "realized_pnl_pct" | "title";
1971
+ /**
1972
+ * @description Position status filter for open/closed positions.
1973
+ * @enum {string}
1974
+ */
1975
+ PositionStatus: "open" | "closed";
1784
1976
  PositionVolumeChartResponse: {
1785
1977
  volumes: components["schemas"]["PositionVolumeDataPoint"][];
1786
1978
  has_more: boolean;
@@ -1801,6 +1993,30 @@ export interface components {
1801
1993
  /** Format: int32 */
1802
1994
  stc: number;
1803
1995
  };
1996
+ /**
1997
+ * @description Output payload for NegRisk PositionsConverted trades
1998
+ * (convert NO-position tokens → YES tokens + collateral).
1999
+ */
2000
+ PositionsConvertedTrade: {
2001
+ id: string;
2002
+ hash: string;
2003
+ /** Format: int64 */
2004
+ block: number;
2005
+ /** Format: int64 */
2006
+ confirmed_at: number;
2007
+ /** Format: int64 */
2008
+ log_index: number;
2009
+ /** Format: int64 */
2010
+ block_index: number;
2011
+ trader: components["schemas"]["TraderInfo"];
2012
+ /** @description NegRisk umbrella market ID */
2013
+ market_id: string;
2014
+ /** @description Bitmask of question indices whose NO tokens are being converted */
2015
+ index_set: string;
2016
+ /** Format: double */
2017
+ shares_amount: number;
2018
+ exchange: components["schemas"]["PolymarketExchange"];
2019
+ };
1804
2020
  PredictionCandlestickBar: {
1805
2021
  /** Format: double */
1806
2022
  l?: number | null;
@@ -1819,17 +2035,197 @@ export interface components {
1819
2035
  /** Format: double */
1820
2036
  m?: number | null;
1821
2037
  };
1822
- /** @description Response format for prediction trades */
1823
- PredictionTradeResponse: {
2038
+ PriceJump: {
2039
+ /** Format: int64 */
2040
+ from: number;
2041
+ /** Format: int64 */
2042
+ to: number;
2043
+ /** Format: double */
2044
+ price_before: number;
2045
+ /** Format: double */
2046
+ price_after: number;
2047
+ /** Format: double */
2048
+ change_pct: number;
2049
+ direction: string;
2050
+ /** Format: double */
2051
+ volume: number;
2052
+ /** Format: int32 */
2053
+ trades_count: number;
2054
+ condition_id: string;
2055
+ };
2056
+ /** @description UMA CTF Adapter: admin emergency resolution. */
2057
+ QuestionEmergencyResolvedEvent: {
2058
+ id: string;
2059
+ hash: string;
2060
+ /** Format: int64 */
2061
+ block: number;
2062
+ /** Format: int64 */
2063
+ confirmed_at: number;
2064
+ /** Format: int64 */
2065
+ log_index: number;
2066
+ /** Format: int64 */
2067
+ block_index: number;
2068
+ oracle_contract: string;
2069
+ condition_id: string;
2070
+ proposed_outcome?: string | null;
2071
+ question?: string | null;
2072
+ image_url?: string | null;
2073
+ slug?: string | null;
2074
+ event_slug?: string | null;
2075
+ };
2076
+ /** @description UMA CTF Adapter: market flagged for emergency resolution. */
2077
+ QuestionFlaggedEvent: {
2078
+ id: string;
2079
+ hash: string;
2080
+ /** Format: int64 */
2081
+ block: number;
2082
+ /** Format: int64 */
2083
+ confirmed_at: number;
2084
+ /** Format: int64 */
2085
+ log_index: number;
2086
+ /** Format: int64 */
2087
+ block_index: number;
2088
+ oracle_contract: string;
2089
+ condition_id: string;
2090
+ question?: string | null;
2091
+ image_url?: string | null;
2092
+ slug?: string | null;
2093
+ event_slug?: string | null;
2094
+ };
2095
+ /** @description UMA CTF Adapter: questionID first initialized on-chain. */
2096
+ QuestionInitializedEvent: {
2097
+ id: string;
2098
+ hash: string;
2099
+ /** Format: int64 */
2100
+ block: number;
2101
+ /** Format: int64 */
2102
+ confirmed_at: number;
2103
+ /** Format: int64 */
2104
+ log_index: number;
2105
+ /** Format: int64 */
2106
+ block_index: number;
2107
+ oracle_contract: string;
2108
+ condition_id: string;
2109
+ creator: string;
2110
+ reward_token: string;
2111
+ reward: string;
2112
+ proposal_bond: string;
2113
+ question?: string | null;
2114
+ image_url?: string | null;
2115
+ slug?: string | null;
2116
+ event_slug?: string | null;
2117
+ };
2118
+ /** @description UMA CTF Adapter: market paused by admin. */
2119
+ QuestionPausedEvent: {
2120
+ id: string;
2121
+ hash: string;
2122
+ /** Format: int64 */
2123
+ block: number;
2124
+ /** Format: int64 */
2125
+ confirmed_at: number;
2126
+ /** Format: int64 */
2127
+ log_index: number;
2128
+ /** Format: int64 */
2129
+ block_index: number;
2130
+ oracle_contract: string;
2131
+ condition_id: string;
2132
+ question?: string | null;
2133
+ image_url?: string | null;
2134
+ slug?: string | null;
2135
+ event_slug?: string | null;
2136
+ };
2137
+ /** @description UMA CTF Adapter: dispute succeeded, market returns to active. */
2138
+ QuestionResetEvent: {
2139
+ id: string;
2140
+ hash: string;
2141
+ /** Format: int64 */
2142
+ block: number;
2143
+ /** Format: int64 */
2144
+ confirmed_at: number;
2145
+ /** Format: int64 */
2146
+ log_index: number;
2147
+ /** Format: int64 */
2148
+ block_index: number;
2149
+ oracle_contract: string;
2150
+ condition_id: string;
2151
+ question?: string | null;
2152
+ image_url?: string | null;
2153
+ slug?: string | null;
2154
+ event_slug?: string | null;
2155
+ };
2156
+ /** @description UMA CTF Adapter: market resolved with definitive outcome. */
2157
+ QuestionResolvedEvent: {
2158
+ id: string;
2159
+ hash: string;
2160
+ /** Format: int64 */
2161
+ block: number;
2162
+ /** Format: int64 */
2163
+ confirmed_at: number;
2164
+ /** Format: int64 */
2165
+ log_index: number;
2166
+ /** Format: int64 */
2167
+ block_index: number;
2168
+ oracle_contract: string;
2169
+ condition_id: string;
2170
+ /** Format: int64 */
2171
+ settled_price: number;
2172
+ proposed_outcome?: string | null;
2173
+ question?: string | null;
2174
+ image_url?: string | null;
2175
+ slug?: string | null;
2176
+ event_slug?: string | null;
2177
+ };
2178
+ /** @description UMA CTF Adapter: flag removed. */
2179
+ QuestionUnflaggedEvent: {
2180
+ id: string;
2181
+ hash: string;
2182
+ /** Format: int64 */
2183
+ block: number;
2184
+ /** Format: int64 */
2185
+ confirmed_at: number;
2186
+ /** Format: int64 */
2187
+ log_index: number;
2188
+ /** Format: int64 */
2189
+ block_index: number;
2190
+ oracle_contract: string;
2191
+ condition_id: string;
2192
+ question?: string | null;
2193
+ image_url?: string | null;
2194
+ slug?: string | null;
2195
+ event_slug?: string | null;
2196
+ };
2197
+ /** @description UMA CTF Adapter: market unpaused. */
2198
+ QuestionUnpausedEvent: {
1824
2199
  id: string;
1825
2200
  hash: string;
1826
2201
  /** Format: int64 */
1827
2202
  block: number;
1828
2203
  /** Format: int64 */
1829
2204
  confirmed_at: number;
2205
+ /** Format: int64 */
2206
+ log_index: number;
2207
+ /** Format: int64 */
2208
+ block_index: number;
2209
+ oracle_contract: string;
2210
+ condition_id: string;
2211
+ question?: string | null;
2212
+ image_url?: string | null;
2213
+ slug?: string | null;
2214
+ event_slug?: string | null;
2215
+ };
2216
+ /** @description Output payload for Redemption trades (payout after market resolution). */
2217
+ RedemptionTrade: {
2218
+ id: string;
2219
+ hash: string;
2220
+ /** Format: int64 */
2221
+ block: number;
2222
+ /** Format: int64 */
2223
+ confirmed_at: number;
2224
+ /** Format: int64 */
2225
+ log_index: number;
2226
+ /** Format: int64 */
2227
+ block_index: number;
1830
2228
  trader: components["schemas"]["TraderInfo"];
1831
- taker: string;
1832
- side?: string | null;
1833
2229
  condition_id?: string | null;
1834
2230
  outcome?: string | null;
1835
2231
  /** Format: int32 */
@@ -1840,38 +2236,32 @@ export interface components {
1840
2236
  event_slug?: string | null;
1841
2237
  /** Format: double */
1842
2238
  usd_amount: number;
1843
- /** Format: double */
1844
- shares_amount: number;
1845
- /** Format: double */
1846
- price: number;
1847
- /** Format: double */
1848
- probability?: number | null;
1849
- /** Format: double */
1850
- fee: number;
1851
- exchange: string;
1852
- trade_type: string;
1853
- /** Format: int64 */
1854
- log_index: number;
1855
- order_hash: string;
1856
- position_id: string;
2239
+ /** Format: int32 */
2240
+ winning_outcome_index?: number | null;
2241
+ /** @description Per-position burn amounts */
2242
+ position_details?: components["schemas"]["PositionDetail"][];
2243
+ exchange: components["schemas"]["PolymarketExchange"];
1857
2244
  };
1858
- PriceJump: {
2245
+ /** @description Output payload for RegisterToken events (YES/NO token pair registered for a condition). */
2246
+ RegisterTokenTrade: {
2247
+ id: string;
2248
+ hash: string;
1859
2249
  /** Format: int64 */
1860
- from: number;
2250
+ block: number;
1861
2251
  /** Format: int64 */
1862
- to: number;
1863
- /** Format: double */
1864
- price_before: number;
1865
- /** Format: double */
1866
- price_after: number;
1867
- /** Format: double */
1868
- change_pct: number;
1869
- direction: string;
1870
- /** Format: double */
1871
- volume: number;
1872
- /** Format: int32 */
1873
- trades_count: number;
2252
+ confirmed_at: number;
2253
+ /** Format: int64 */
2254
+ log_index: number;
2255
+ /** Format: int64 */
2256
+ block_index: number;
1874
2257
  condition_id: string;
2258
+ token0: string;
2259
+ token1: string;
2260
+ question?: string | null;
2261
+ image_url?: string | null;
2262
+ slug?: string | null;
2263
+ event_slug?: string | null;
2264
+ exchange: components["schemas"]["PolymarketExchange"];
1875
2265
  };
1876
2266
  SearchResponse: {
1877
2267
  events?: components["schemas"]["PolymarketEvent"][] | null;
@@ -1915,6 +2305,30 @@ export interface components {
1915
2305
  * @enum {string}
1916
2306
  */
1917
2307
  SpikeDirection: "up" | "down" | "both";
2308
+ /** @description Output payload for Split trades (deposit collateral → receive outcome tokens). */
2309
+ SplitTrade: {
2310
+ id: string;
2311
+ hash: string;
2312
+ /** Format: int64 */
2313
+ block: number;
2314
+ /** Format: int64 */
2315
+ confirmed_at: number;
2316
+ /** Format: int64 */
2317
+ log_index: number;
2318
+ /** Format: int64 */
2319
+ block_index: number;
2320
+ trader: components["schemas"]["TraderInfo"];
2321
+ condition_id?: string | null;
2322
+ question?: string | null;
2323
+ image_url?: string | null;
2324
+ slug?: string | null;
2325
+ event_slug?: string | null;
2326
+ /** Format: double */
2327
+ usd_amount: number;
2328
+ /** @description Per-position mint amounts */
2329
+ position_details?: components["schemas"]["PositionDetail"][];
2330
+ exchange: components["schemas"]["PolymarketExchange"];
2331
+ };
1918
2332
  /** @description Lightweight row — derived metrics only, no bids/asks JSONB. */
1919
2333
  SpreadRow: {
1920
2334
  /** Format: int64 */
@@ -1943,6 +2357,77 @@ export interface components {
1943
2357
  token_id: string;
1944
2358
  outcome: string;
1945
2359
  };
2360
+ /**
2361
+ * @description Tagged enum for all trade types — serializes with `"trade_type": "..."` discriminator
2362
+ * and only includes fields relevant to each type.
2363
+ */
2364
+ TradeEvent: (components["schemas"]["OrderFilledTrade"] & {
2365
+ /** @enum {string} */
2366
+ trade_type: "OrderFilled";
2367
+ }) | (components["schemas"]["OrderFilledTrade"] & {
2368
+ /** @enum {string} */
2369
+ trade_type: "OrdersMatched";
2370
+ }) | (components["schemas"]["RedemptionTrade"] & {
2371
+ /** @enum {string} */
2372
+ trade_type: "Redemption";
2373
+ }) | (components["schemas"]["MergeTrade"] & {
2374
+ /** @enum {string} */
2375
+ trade_type: "Merge";
2376
+ }) | (components["schemas"]["SplitTrade"] & {
2377
+ /** @enum {string} */
2378
+ trade_type: "Split";
2379
+ }) | (components["schemas"]["PositionsConvertedTrade"] & {
2380
+ /** @enum {string} */
2381
+ trade_type: "PositionsConverted";
2382
+ }) | (components["schemas"]["CancelledTrade"] & {
2383
+ /** @enum {string} */
2384
+ trade_type: "Cancelled";
2385
+ }) | (components["schemas"]["QuestionInitializedEvent"] & {
2386
+ /** @enum {string} */
2387
+ trade_type: "Initialization";
2388
+ }) | (components["schemas"]["AssertionMadeEvent"] & {
2389
+ /** @enum {string} */
2390
+ trade_type: "Proposal";
2391
+ }) | (components["schemas"]["AssertionDisputedEvent"] & {
2392
+ /** @enum {string} */
2393
+ trade_type: "Dispute";
2394
+ }) | (components["schemas"]["AssertionSettledEvent"] & {
2395
+ /** @enum {string} */
2396
+ trade_type: "Settled";
2397
+ }) | (components["schemas"]["QuestionResolvedEvent"] & {
2398
+ /** @enum {string} */
2399
+ trade_type: "Resolution";
2400
+ }) | (components["schemas"]["ConditionResolutionEvent"] & {
2401
+ /** @enum {string} */
2402
+ trade_type: "ConditionResolution";
2403
+ }) | (components["schemas"]["QuestionResetEvent"] & {
2404
+ /** @enum {string} */
2405
+ trade_type: "Reset";
2406
+ }) | (components["schemas"]["QuestionFlaggedEvent"] & {
2407
+ /** @enum {string} */
2408
+ trade_type: "Flag";
2409
+ }) | (components["schemas"]["QuestionUnflaggedEvent"] & {
2410
+ /** @enum {string} */
2411
+ trade_type: "Unflag";
2412
+ }) | (components["schemas"]["QuestionPausedEvent"] & {
2413
+ /** @enum {string} */
2414
+ trade_type: "Pause";
2415
+ }) | (components["schemas"]["QuestionUnpausedEvent"] & {
2416
+ /** @enum {string} */
2417
+ trade_type: "Unpause";
2418
+ }) | (components["schemas"]["QuestionEmergencyResolvedEvent"] & {
2419
+ /** @enum {string} */
2420
+ trade_type: "ManualResolution";
2421
+ }) | (components["schemas"]["NegRiskOutcomeReportedEvent"] & {
2422
+ /** @enum {string} */
2423
+ trade_type: "NegRiskOutcomeReported";
2424
+ }) | (components["schemas"]["RegisterTokenTrade"] & {
2425
+ /** @enum {string} */
2426
+ trade_type: "RegisterToken";
2427
+ }) | (components["schemas"]["ApprovalTrade"] & {
2428
+ /** @enum {string} */
2429
+ trade_type: "Approval";
2430
+ });
1946
2431
  /** @enum {string} */
1947
2432
  TradeSide: "0" | "1";
1948
2433
  /** @enum {string} */
@@ -2110,7 +2595,7 @@ export interface components {
2110
2595
  /**
2111
2596
  * Format: double
2112
2597
  * @description Estimated current USD value of held shares: (balance / 1e6) * current_price.
2113
- * Only meaningful for open positions (balance > 0).
2598
+ * Only meaningful for open positions (balance above dust threshold).
2114
2599
  */
2115
2600
  current_value?: number | null;
2116
2601
  /**
@@ -2687,7 +3172,7 @@ export interface operations {
2687
3172
  search?: string;
2688
3173
  /** @description Filter by status: open, closed, or all (default: all) */
2689
3174
  status?: components["schemas"]["MarketStatus"];
2690
- /** @description Sort: volume, txns, unique_traders, liquidity, holders, end_time, start_time, created_time, relevance */
3175
+ /** @description Sort: volume, txns, unique_traders, liquidity, holders, total_daily_rate, end_time, start_time, created_time, relevance */
2691
3176
  sort_by?: components["schemas"]["MarketSortBy"];
2692
3177
  /** @description Sort direction: asc, desc (default: desc) */
2693
3178
  sort_dir?: components["schemas"]["SortDirection"];
@@ -3073,9 +3558,10 @@ export interface operations {
3073
3558
  highest_probability?: number | null;
3074
3559
  /** Format: int64 */
3075
3560
  total_holders?: number | null;
3561
+ /** Format: double */
3562
+ total_daily_rate?: number | null;
3076
3563
  winning_outcome?: null | components["schemas"]["MarketOutcome"];
3077
3564
  outcomes?: components["schemas"]["MarketOutcome"][];
3078
- rewards?: components["schemas"]["MarketReward"][];
3079
3565
  clob_rewards?: components["schemas"]["ClobReward"][];
3080
3566
  tags?: string[];
3081
3567
  event_slug?: string | null;
@@ -3136,8 +3622,10 @@ export interface operations {
3136
3622
  all?: boolean;
3137
3623
  /** @description Results per page (default: 10, max: 250) */
3138
3624
  limit?: number;
3139
- /** @description Offset-based pagination key (integer offset into result set) */
3140
- pagination_key?: number;
3625
+ /** @description Pagination offset (number of results to skip). Takes precedence over pagination_key. */
3626
+ offset?: number;
3627
+ /** @description Cursor-based pagination key obtained from previous response's pagination.pagination_key */
3628
+ pagination_key?: string;
3141
3629
  /** @description Sort newest first (default: true) */
3142
3630
  sort_desc?: boolean;
3143
3631
  /** @description Return truncated response optimized for AI consumers (default: false) */
@@ -3155,7 +3643,7 @@ export interface operations {
3155
3643
  [name: string]: unknown;
3156
3644
  };
3157
3645
  content: {
3158
- "application/json": components["schemas"]["PredictionTradeResponse"][];
3646
+ "application/json": components["schemas"]["TradeEvent"][];
3159
3647
  };
3160
3648
  };
3161
3649
  };
@@ -3254,9 +3742,10 @@ export interface operations {
3254
3742
  highest_probability?: number | null;
3255
3743
  /** Format: int64 */
3256
3744
  total_holders?: number | null;
3745
+ /** Format: double */
3746
+ total_daily_rate?: number | null;
3257
3747
  winning_outcome?: null | components["schemas"]["MarketOutcome"];
3258
3748
  outcomes?: components["schemas"]["MarketOutcome"][];
3259
- rewards?: components["schemas"]["MarketReward"][];
3260
3749
  clob_rewards?: components["schemas"]["ClobReward"][];
3261
3750
  tags?: string[];
3262
3751
  event_slug?: string | null;
@@ -3924,7 +4413,7 @@ export interface operations {
3924
4413
  market_slug?: string;
3925
4414
  /** @description Filter by specific outcome token (position ID) */
3926
4415
  position_id?: string;
3927
- /** @description Minimum shares balance to include (e.g. 1.0 to filter out dust positions) */
4416
+ /** @description Minimum shares balance to include. Status filtering already treats balances below 0.01 shares as dust. */
3928
4417
  min_shares?: number;
3929
4418
  };
3930
4419
  header?: never;
@@ -4061,7 +4550,7 @@ export interface operations {
4061
4550
  [name: string]: unknown;
4062
4551
  };
4063
4552
  content: {
4064
- "application/json": components["schemas"]["PredictionTradeResponse"][];
4553
+ "application/json": components["schemas"]["TradeEvent"][];
4065
4554
  };
4066
4555
  };
4067
4556
  };