@structbuild/sdk 0.3.10-staging.6 → 0.3.10-staging.7

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.
@@ -1254,7 +1254,7 @@ export interface components {
1254
1254
  * domains and re-bucketed from the `_1d` MV for market/event/trader.
1255
1255
  * @enum {string}
1256
1256
  */
1257
- AnalyticsResolution: "1" | "5" | "15" | "30" | "60" | "240" | "D" | "1D" | "W" | "1W" | "M" | "1M";
1257
+ AnalyticsResolution: "60" | "240" | "D" | "1D" | "W" | "1W" | "M" | "1M";
1258
1258
  /** @description Output payload for ERC1155 setApprovalForAll events. */
1259
1259
  ApprovalTrade: {
1260
1260
  id: string;
@@ -1660,8 +1660,21 @@ export interface components {
1660
1660
  buy_volume_usd: number;
1661
1661
  /** Format: double */
1662
1662
  sell_volume_usd: number;
1663
- /** Format: int64 */
1663
+ /**
1664
+ * Format: int64
1665
+ * @description Distinct addresses that have ever traded on Polymarket (lifetime).
1666
+ */
1664
1667
  unique_traders: number;
1668
+ /**
1669
+ * Format: int64
1670
+ * @description Distinct makers ever active (lifetime distinct).
1671
+ */
1672
+ unique_makers: number;
1673
+ /**
1674
+ * Format: int64
1675
+ * @description Distinct takers ever active (lifetime distinct).
1676
+ */
1677
+ unique_takers: number;
1665
1678
  /** Format: int64 */
1666
1679
  txn_count: number;
1667
1680
  /** Format: int64 */
@@ -2061,8 +2074,22 @@ export interface components {
2061
2074
  /** Format: double */
2062
2075
  sell_volume_usd?: number | null;
2063
2076
  /** Format: double */
2077
+ merge_volume_usd?: number | null;
2078
+ /** Format: double */
2079
+ split_volume_usd?: number | null;
2080
+ /** Format: double */
2081
+ new_traders?: number | null;
2082
+ /** Format: double */
2083
+ new_makers?: number | null;
2084
+ /** Format: double */
2085
+ new_takers?: number | null;
2086
+ /** Format: double */
2064
2087
  unique_traders?: number | null;
2065
2088
  /** Format: double */
2089
+ unique_makers?: number | null;
2090
+ /** Format: double */
2091
+ unique_takers?: number | null;
2092
+ /** Format: double */
2066
2093
  txn_count?: number | null;
2067
2094
  /** Format: double */
2068
2095
  fees_usd?: number | null;
@@ -2475,9 +2502,40 @@ export interface components {
2475
2502
  txn_count: number;
2476
2503
  /**
2477
2504
  * Format: int64
2505
+ * @description First-time-ever traders in the window (delta of the lifetime counter).
2506
+ * @default null
2507
+ */
2508
+ new_traders: number;
2509
+ /**
2510
+ * Format: int64
2511
+ * @description First-time-ever makers in the window.
2512
+ * @default null
2513
+ */
2514
+ new_makers: number;
2515
+ /**
2516
+ * Format: int64
2517
+ * @description First-time-ever takers in the window.
2518
+ * @default null
2519
+ */
2520
+ new_takers: number;
2521
+ /**
2522
+ * Format: int64
2523
+ * @description Distinct active traders in the window.
2478
2524
  * @default null
2479
2525
  */
2480
2526
  unique_traders: number;
2527
+ /**
2528
+ * Format: int64
2529
+ * @description Distinct active makers in the window.
2530
+ * @default null
2531
+ */
2532
+ unique_makers: number;
2533
+ /**
2534
+ * Format: int64
2535
+ * @description Distinct active takers in the window.
2536
+ * @default null
2537
+ */
2538
+ unique_takers: number;
2481
2539
  /**
2482
2540
  * Format: double
2483
2541
  * @default null
@@ -2996,12 +3054,16 @@ export interface components {
2996
3054
  };
2997
3055
  /**
2998
3056
  * @description Metric to order by when `sort=<value>` is provided.
2999
- * `traders` windowed sums per-block deltas — approximate for the "unique
3000
- * traders in window" reading (double-counts traders active in multiple
3001
- * blocks) but fine for ranking. `lifetime` uses the exact cumulative.
3057
+ *
3058
+ * `new_*` ranks by first-time-ever arrivals counted once in the bucket
3059
+ * where the address first appears, regardless of subsequent activity. Read
3060
+ * from the cumulative / delta MVs.
3061
+ *
3062
+ * `unique_*` ranks by window-distinct addresses — exact `uniqExact` count
3063
+ * of addresses active in the timeframe. Read from the active MVs.
3002
3064
  * @enum {string}
3003
3065
  */
3004
- TagSortBy: "volume" | "txns" | "traders" | "fees";
3066
+ TagSortBy: "volume" | "txns" | "new_traders" | "new_makers" | "new_takers" | "unique_traders" | "unique_makers" | "unique_takers" | "fees";
3005
3067
  /**
3006
3068
  * @description Timeframe for `?sort=...` — defines the window the metric is summed over
3007
3069
  * (or `lifetime` for all-time cumulative).
@@ -3015,7 +3077,7 @@ export interface components {
3015
3077
  *
3016
3078
  * Short field names for compact JSON responses:
3017
3079
  * t=bucket (unix seconds), v=volume_usd, bv=buy_volume_usd, sv=sell_volume_usd,
3018
- * ut=unique_traders, tc=txn_count, bc=buy_count, sc=sell_count,
3080
+ * ut=new_traders, tc=txn_count, bc=buy_count, sc=sell_count,
3019
3081
  * rc=redemption_count, rv=redemption_volume_usd, mc=merge_count,
3020
3082
  * sp=split_count, f=fees_usd, sh=shares_volume,
3021
3083
  * yv=yes_volume_usd, nv=no_volume_usd, yc=yes_count, nc=no_count
@@ -3029,8 +3091,21 @@ export interface components {
3029
3091
  bv: number;
3030
3092
  /** Format: double */
3031
3093
  sv: number;
3032
- /** Format: int64 */
3033
- ut: number;
3094
+ /**
3095
+ * Format: int64
3096
+ * @description Traders appearing for the first-time-ever in this bucket.
3097
+ */
3098
+ nt: number;
3099
+ /**
3100
+ * Format: int64
3101
+ * @description Unique makers (order-resting side). Only tracked for match events.
3102
+ */
3103
+ nm: number;
3104
+ /**
3105
+ * Format: int64
3106
+ * @description Unique takers (order-initiator side). Only tracked for match events.
3107
+ */
3108
+ nk: number;
3034
3109
  /** Format: int64 */
3035
3110
  tc: number;
3036
3111
  /** Format: int64 */
@@ -3076,6 +3151,21 @@ export interface components {
3076
3151
  bd_50k: number;
3077
3152
  /** Format: int64 */
3078
3153
  bd_50p: number;
3154
+ /**
3155
+ * Format: int64
3156
+ * @description Distinct traders ACTIVE in this bucket (window-unique, not first-time).
3157
+ */
3158
+ ut: number;
3159
+ /**
3160
+ * Format: int64
3161
+ * @description Distinct makers active in this bucket.
3162
+ */
3163
+ um: number;
3164
+ /**
3165
+ * Format: int64
3166
+ * @description Distinct takers active in this bucket.
3167
+ */
3168
+ uk: number;
3079
3169
  };
3080
3170
  /** @description Token outcome (position) */
3081
3171
  TokenOutcome: {
@@ -3264,6 +3354,33 @@ export interface components {
3264
3354
  /** Format: double */
3265
3355
  realized_pnl_pct?: number | null;
3266
3356
  };
3357
+ /**
3358
+ * @description Per-metric percentage change over a lookback window for one trader
3359
+ * address. A `null` field means the window predates the trader's first
3360
+ * activity or the prior value was zero (percentage undefined).
3361
+ */
3362
+ TraderMetricPctChange: {
3363
+ /** Format: double */
3364
+ volume_usd?: number | null;
3365
+ /** Format: double */
3366
+ buy_volume_usd?: number | null;
3367
+ /** Format: double */
3368
+ sell_volume_usd?: number | null;
3369
+ /** Format: double */
3370
+ merge_volume_usd?: number | null;
3371
+ /** Format: double */
3372
+ split_volume_usd?: number | null;
3373
+ /** Format: double */
3374
+ txn_count?: number | null;
3375
+ /** Format: double */
3376
+ fees_usd?: number | null;
3377
+ /** Format: double */
3378
+ shares_volume?: number | null;
3379
+ /** Format: double */
3380
+ yes_volume_usd?: number | null;
3381
+ /** Format: double */
3382
+ no_volume_usd?: number | null;
3383
+ };
3267
3384
  /** @description Outcome-level PnL entry (per outcome token / position_id) */
3268
3385
  TraderOutcomePnlEntry: {
3269
3386
  position_id?: string | null;
@@ -3384,6 +3501,65 @@ export interface components {
3384
3501
  /** Format: int64 */
3385
3502
  last_trade_at?: number | null;
3386
3503
  };
3504
+ /**
3505
+ * @description Bucket row returned by the per-trader `/analytics/timeseries` and
3506
+ * `/analytics/deltas` endpoints. Mirrors `TimeBucketRow` minus the
3507
+ * distinct-address counters (`new_*` / `unique_*`) — those only carry
3508
+ * information for aggregations over many addresses (market, event, tag,
3509
+ * global), not for a single trader.
3510
+ */
3511
+ TraderTimeBucketRow: {
3512
+ /** Format: int32 */
3513
+ t: number;
3514
+ /** Format: double */
3515
+ v: number;
3516
+ /** Format: double */
3517
+ bv: number;
3518
+ /** Format: double */
3519
+ sv: number;
3520
+ /** Format: int64 */
3521
+ tc: number;
3522
+ /** Format: int64 */
3523
+ bc: number;
3524
+ /** Format: int64 */
3525
+ sc: number;
3526
+ /** Format: int64 */
3527
+ rc: number;
3528
+ /** Format: double */
3529
+ rv: number;
3530
+ /** Format: int64 */
3531
+ mc: number;
3532
+ /** Format: double */
3533
+ mv: number;
3534
+ /** Format: int64 */
3535
+ sp: number;
3536
+ /** Format: double */
3537
+ spv: number;
3538
+ /** Format: double */
3539
+ f: number;
3540
+ /** Format: double */
3541
+ sh: number;
3542
+ /** Format: double */
3543
+ yv: number;
3544
+ /** Format: double */
3545
+ nv: number;
3546
+ /** Format: int64 */
3547
+ yc: number;
3548
+ /** Format: int64 */
3549
+ nc: number;
3550
+ /** Format: int64 */
3551
+ bd_u10: number;
3552
+ /** Format: int64 */
3553
+ bd_100: number;
3554
+ /** Format: int64 */
3555
+ bd_1k: number;
3556
+ /** Format: int64 */
3557
+ bd_10k: number;
3558
+ /** Format: int64 */
3559
+ bd_50k: number;
3560
+ /** Format: int64 */
3561
+ bd_50p: number;
3562
+ };
3387
3563
  TraderVolumeChartResponse: {
3388
3564
  volumes: components["schemas"]["TraderVolumeDataPoint"][];
3389
3565
  has_more: boolean;
@@ -3428,9 +3604,9 @@ export type $defs = Record<string, never>;
3428
3604
  export interface operations {
3429
3605
  get_global_analytics_changes: {
3430
3606
  parameters: {
3431
- query: {
3432
- /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y */
3433
- timeframe: components["schemas"]["ChangeTimeframe"];
3607
+ query?: {
3608
+ /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
3609
+ timeframe?: components["schemas"]["ChangeTimeframe"];
3434
3610
  };
3435
3611
  header?: never;
3436
3612
  path?: never;
@@ -3472,7 +3648,7 @@ export interface operations {
3472
3648
  get_global_analytics_deltas: {
3473
3649
  parameters: {
3474
3650
  query?: {
3475
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
3651
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
3476
3652
  resolution?: components["schemas"]["AnalyticsResolution"];
3477
3653
  /** @description Start timestamp (Unix seconds). Omit for all-time. */
3478
3654
  from?: number;
@@ -3503,7 +3679,7 @@ export interface operations {
3503
3679
  get_global_analytics_timeseries: {
3504
3680
  parameters: {
3505
3681
  query?: {
3506
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
3682
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
3507
3683
  resolution?: components["schemas"]["AnalyticsResolution"];
3508
3684
  /** @description Start timestamp (Unix seconds). Omit for all-time. */
3509
3685
  from?: number;
@@ -3799,9 +3975,9 @@ export interface operations {
3799
3975
  };
3800
3976
  get_event_analytics_changes: {
3801
3977
  parameters: {
3802
- query: {
3803
- /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y */
3804
- timeframe: components["schemas"]["ChangeTimeframe"];
3978
+ query?: {
3979
+ /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
3980
+ timeframe?: components["schemas"]["ChangeTimeframe"];
3805
3981
  };
3806
3982
  header?: never;
3807
3983
  path: {
@@ -3826,7 +4002,7 @@ export interface operations {
3826
4002
  get_event_analytics_deltas: {
3827
4003
  parameters: {
3828
4004
  query?: {
3829
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
4005
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
3830
4006
  resolution?: components["schemas"]["AnalyticsResolution"];
3831
4007
  /** @description Start timestamp (Unix seconds) */
3832
4008
  from?: number;
@@ -3860,7 +4036,7 @@ export interface operations {
3860
4036
  get_event_analytics_timeseries: {
3861
4037
  parameters: {
3862
4038
  query?: {
3863
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
4039
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
3864
4040
  resolution?: components["schemas"]["AnalyticsResolution"];
3865
4041
  /** @description Start timestamp (Unix seconds) */
3866
4042
  from?: number;
@@ -4764,9 +4940,9 @@ export interface operations {
4764
4940
  };
4765
4941
  get_market_analytics_changes: {
4766
4942
  parameters: {
4767
- query: {
4768
- /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y */
4769
- timeframe: components["schemas"]["ChangeTimeframe"];
4943
+ query?: {
4944
+ /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
4945
+ timeframe?: components["schemas"]["ChangeTimeframe"];
4770
4946
  };
4771
4947
  header?: never;
4772
4948
  path: {
@@ -4791,7 +4967,7 @@ export interface operations {
4791
4967
  get_market_analytics_deltas: {
4792
4968
  parameters: {
4793
4969
  query?: {
4794
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
4970
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
4795
4971
  resolution?: components["schemas"]["AnalyticsResolution"];
4796
4972
  /** @description Start timestamp (Unix seconds) */
4797
4973
  from?: number;
@@ -4825,7 +5001,7 @@ export interface operations {
4825
5001
  get_market_analytics_timeseries: {
4826
5002
  parameters: {
4827
5003
  query?: {
4828
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
5004
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
4829
5005
  resolution?: components["schemas"]["AnalyticsResolution"];
4830
5006
  /** @description Start timestamp (Unix seconds) */
4831
5007
  from?: number;
@@ -5287,6 +5463,8 @@ export interface operations {
5287
5463
  sort?: components["schemas"]["TagSortBy"];
5288
5464
  /** @description Window for the sort metric. Defaults to `24h` when only `sort` is set. Setting either `sort` or `timeframe` adds +2 credits. */
5289
5465
  timeframe?: components["schemas"]["TagSortTimeframe"];
5466
+ /** @description Sort direction (default: true = highest first). Only applies to sort/timeframe mode. */
5467
+ sort_desc?: boolean;
5290
5468
  };
5291
5469
  header?: never;
5292
5470
  path?: never;
@@ -5342,9 +5520,9 @@ export interface operations {
5342
5520
  };
5343
5521
  get_tag_analytics_changes: {
5344
5522
  parameters: {
5345
- query: {
5346
- /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y */
5347
- timeframe: components["schemas"]["ChangeTimeframe"];
5523
+ query?: {
5524
+ /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
5525
+ timeframe?: components["schemas"]["ChangeTimeframe"];
5348
5526
  };
5349
5527
  header?: never;
5350
5528
  path: {
@@ -5369,7 +5547,7 @@ export interface operations {
5369
5547
  get_tag_analytics_deltas: {
5370
5548
  parameters: {
5371
5549
  query?: {
5372
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
5550
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
5373
5551
  resolution?: components["schemas"]["AnalyticsResolution"];
5374
5552
  /** @description Start timestamp (Unix seconds) */
5375
5553
  from?: number;
@@ -5403,7 +5581,7 @@ export interface operations {
5403
5581
  get_tag_analytics_timeseries: {
5404
5582
  parameters: {
5405
5583
  query?: {
5406
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
5584
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
5407
5585
  resolution?: components["schemas"]["AnalyticsResolution"];
5408
5586
  /** @description Start timestamp (Unix seconds) */
5409
5587
  from?: number;
@@ -5804,8 +5982,6 @@ export interface operations {
5804
5982
  from?: number;
5805
5983
  /** @description End timestamp (ms) */
5806
5984
  to?: number;
5807
- /** @description Return all-time trades, not just last 30 days (default: false) */
5808
- all?: boolean;
5809
5985
  /** @description Results per page (default: 10, max: 250) */
5810
5986
  limit?: number;
5811
5987
  /** @description Pagination offset (number of results to skip). Takes precedence over pagination_key. */
@@ -5871,9 +6047,9 @@ export interface operations {
5871
6047
  };
5872
6048
  get_trader_analytics_changes: {
5873
6049
  parameters: {
5874
- query: {
5875
- /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y */
5876
- timeframe: components["schemas"]["ChangeTimeframe"];
6050
+ query?: {
6051
+ /** @description Lookback window: 1h, 24h, 7d, 30d, 1mo, 1y (default: 24h) */
6052
+ timeframe?: components["schemas"]["ChangeTimeframe"];
5877
6053
  };
5878
6054
  header?: never;
5879
6055
  path: {
@@ -5890,7 +6066,7 @@ export interface operations {
5890
6066
  [name: string]: unknown;
5891
6067
  };
5892
6068
  content: {
5893
- "application/json": components["schemas"]["MetricPctChange"];
6069
+ "application/json": components["schemas"]["TraderMetricPctChange"];
5894
6070
  };
5895
6071
  };
5896
6072
  };
@@ -5898,7 +6074,7 @@ export interface operations {
5898
6074
  get_trader_analytics_deltas: {
5899
6075
  parameters: {
5900
6076
  query?: {
5901
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
6077
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
5902
6078
  resolution?: components["schemas"]["AnalyticsResolution"];
5903
6079
  /** @description Start timestamp (Unix seconds) */
5904
6080
  from?: number;
@@ -5924,7 +6100,7 @@ export interface operations {
5924
6100
  [name: string]: unknown;
5925
6101
  };
5926
6102
  content: {
5927
- "application/json": components["schemas"]["TimeBucketRow"][];
6103
+ "application/json": components["schemas"]["TraderTimeBucketRow"][];
5928
6104
  };
5929
6105
  };
5930
6106
  };
@@ -5932,7 +6108,7 @@ export interface operations {
5932
6108
  get_trader_analytics_timeseries: {
5933
6109
  parameters: {
5934
6110
  query?: {
5935
- /** @description Bucket size: 1, 5, 15, 30, 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
6111
+ /** @description Bucket size: 60, 240, D, 1D, W, 1W, M, 1M (default: 60) */
5936
6112
  resolution?: components["schemas"]["AnalyticsResolution"];
5937
6113
  /** @description Start timestamp (Unix seconds) */
5938
6114
  from?: number;
@@ -5958,7 +6134,7 @@ export interface operations {
5958
6134
  [name: string]: unknown;
5959
6135
  };
5960
6136
  content: {
5961
- "application/json": components["schemas"]["TimeBucketRow"][];
6137
+ "application/json": components["schemas"]["TraderTimeBucketRow"][];
5962
6138
  };
5963
6139
  };
5964
6140
  };
@@ -72,6 +72,8 @@ export type TimeBucketRow = Schemas["TimeBucketRow"];
72
72
  export type TokenOutcome = Schemas["TokenOutcome"];
73
73
  export type Trader = Schemas["Trader"];
74
74
  export type TraderInfo = Schemas["TraderInfo"];
75
+ export type TraderMetricPctChange = Schemas["TraderMetricPctChange"];
76
+ export type TraderTimeBucketRow = Schemas["TraderTimeBucketRow"];
75
77
  export type TraderVolumeChartResponse = Schemas["TraderVolumeChartResponse"];
76
78
  export type TraderOutcomePnlEntry = Schemas["TraderOutcomePnlEntry"];
77
79
  export type TraderVolumeDataPoint = Schemas["TraderVolumeDataPoint"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structbuild/sdk",
3
- "version": "0.3.10-staging.6",
3
+ "version": "0.3.10-staging.7",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",