@0xinsider/sdk 0.130.4 → 0.131.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -240,6 +240,13 @@ SDK 0.126.8 documents fewer `listGameMarkets` reads with `expand: ["sharp_money"
240
240
 
241
241
  SDK 0.129.0 types `accepting_orders` on each `listGameMarkets` row's `trading_terms` with `expand: ["trading_terms"]` (#36723): Gamma's `acceptingOrders`, `true` when the market's order book takes new limit and market orders, `false` when Polymarket has paused them on a market that is not closed, `null` when the record does not carry it. It also documents that with `expand: ["quotes"]` an outcome that reads `book_unavailable_reason: "stream_capacity"` now usually carries its book a few seconds later, with `book_source: "clob_rest"`.
242
242
 
243
+ SDK 0.131.0 counts S and A wallets only in market flow (#36883). `getMarketFlow` and `batchGetMarketFlow` sum S and A large trades, list up to five S and A net positions worth at least $25 at the stored mark, and widen `sharp_money.direction` to `"YES" | "NO" | "NEUTRAL"`: `NEUTRAL`, with `token_id: null`, when the rounded net flow is zero, where it read `"YES"`. A `switch` that handled `YES` and `NO` exhaustively no longer compiles until it handles `NEUTRAL`. `listSharpMoneyFlows` defaults `min_grade` to `"A"` (pass `"B"` for S, A and B), leaves out markets whose net flow is $0.00, and strips a wallet's equal NO buys on all three legs of a 1X2 moneyline. `getGameSharpMoney` adds `no_lean_reason` (`"aligned"` or `"divided"` on a `no_clear_lean` verdict) and `outcomes[].top_wallet_usd` before the start. `exploreMarkets` scores a NO lean in `score_components.sharp_money_signal` as strongly as a YES lean.
244
+
245
+ ```ts
246
+ const flow = await client.getMarketFlow("0x...");
247
+ if (flow.data.sharp_money.direction === "NEUTRAL") flow.data.sharp_money.token_id; // null
248
+ ```
249
+
243
250
  SDK 0.41.0 adds the closing line (#32517). `getMarketClose(conditionId)` reads a market's stored close: each outcome's price in the last provider minute bucket that ended at or before kickoff, captured once after settlement. Its `status` is `measured`, `pending` or `unavailable`, with `unavailable_reason`; a missing close is never 0. Every large trade (`listLargeTrades`, `listLargeTradeHistory`, `getLargeTrade`, and the expanded trades of the `getEventReplaySince` replay) now carries `clv`: cents per share against that close, positive when the trade beat it, measured on pre-kickoff trades only (`status` `measured`, `in_play`, `pending` or `unavailable`). `getTraderClv(address, { from, to, min_size, category })` summarizes one wallet's large trades in a window: the mean, stake-weighted and per-market mean CLV with a 95% interval, the share that beat the close, and the trades excluded by status. `batchGetMarketClose({ condition_ids })` reads up to 25 markets' closes in one request (#33025). New types: `MarketClose`, `TraderClv`.
244
251
 
245
252
  ```ts
@@ -1,5 +1,5 @@
1
1
  export declare const OPENAPI_SOURCE = "0xinsider/0xinsider:web/public/api/v1/openapi.json";
2
- export declare const OPENAPI_SHA256 = "30501ca8f8adf5dbcea45549349b9fea1aa8e2b74223389dd5b391d77e91da2f";
2
+ export declare const OPENAPI_SHA256 = "4bf6543dae800dfa894ed2b77349c6c4a49de2986c038029c3401e011fb192f1";
3
3
  export declare const OPENAPI_VERSION = "1.0.0";
4
4
  export declare const OPERATION_COUNT = 120;
5
5
  export declare const APP_REPOSITORY = "0xinsider/0xinsider";
@@ -6,10 +6,10 @@
6
6
  // when it could be resolved, else null. Compare OPENAPI_SHA256 with the live
7
7
  // document to see whether a release is behind the API.
8
8
  export const OPENAPI_SOURCE = "0xinsider/0xinsider:web/public/api/v1/openapi.json";
9
- export const OPENAPI_SHA256 = "30501ca8f8adf5dbcea45549349b9fea1aa8e2b74223389dd5b391d77e91da2f";
9
+ export const OPENAPI_SHA256 = "4bf6543dae800dfa894ed2b77349c6c4a49de2986c038029c3401e011fb192f1";
10
10
  export const OPENAPI_VERSION = "1.0.0";
11
11
  export const OPERATION_COUNT = 120;
12
12
  export const APP_REPOSITORY = "0xinsider/0xinsider";
13
13
  export const APP_SPEC_PATH = "web/public/api/v1/openapi.json";
14
- export const APP_COMMIT = "dc5f3bccc29884e194e8631a9a76c854ceb1bc7f";
14
+ export const APP_COMMIT = "a6dff7e8ebd9198f75288e6de7f0357eaf45a5c2";
15
15
  //# sourceMappingURL=provenance.js.map
package/dist/schema.d.ts CHANGED
@@ -1339,11 +1339,11 @@ export type ExploreMarket = {
1339
1339
  /** The Polymarket CLOB token id (ERC1155 asset id, decimal string) for the NO outcome; null when unavailable (e.g. unsynced markets). */
1340
1340
  token_id_no: string | null;
1341
1341
  event_slug: string | null;
1342
- /** Where graded money sits on the market, from -1 (all on NO) to 1 (all on YES): YES dollars minus NO dollars over both. Graded money is the money of wallets graded S or A; a B grade wallet's money is not counted. Null when no S or A grade wallet holds the market. */
1342
+ /** Where graded money sits on the market, from -1 (all on NO) to 1 (all on YES): YES dollars minus NO dollars over both. Graded money is the money of wallets graded S or A; a B grade wallet's money is not counted. On an unsettled market with a live price, a wallet's position counts only when it is worth at least $25 at that price. Null when no S or A grade wallet holds the market. */
1343
1343
  smart_score: number | null;
1344
- /** Distinct wallets graded S or A holding either side of the market, the wallets smart_score counts: 0 on a market held only by lower grades, B included. Null when the market's graded money was not read. */
1344
+ /** Distinct wallets graded S or A holding either side of the market, the wallets smart_score counts, so a position worth under $25 at a live price is not counted: 0 on a market held only by lower grades, B included. Null when the market's graded money was not read. */
1345
1345
  smart_count: number | null;
1346
- /** The outcome graded money (wallets graded S or A) leans toward RELATIVE TO THE PRICE: named only when the graded money's share of a side sits well past that side's price-implied share, enough graded money backs the leaning side that a few small positions cannot name it, and the side is not a long shot holding nearly all of the graded money. Null when the money sits with the price (no lean), when there is no graded money, or when the price is unavailable. The same rule as the market page. */
1346
+ /** The outcome graded money (wallets graded S or A) leans toward RELATIVE TO THE PRICE: named only when the graded money's share of a side sits at least 10 percentage points past that side's price-implied share, at least three S or A wallets hold the market, at least $500 of graded money backs the leaning side, no single wallet holds more than half of that side while the other side holds at least $25, and the side is not a long shot holding nearly all of the graded money. Null when the money sits with the price (no lean), when there is no graded money, when the price is unavailable, once the game has started, and on one leg of a three-way (win, draw, win) game, where one leg's money cannot name a side of the game. The same rule as the market page. */
1347
1347
  smart_label: string | null;
1348
1348
  /** When the oldest stored smart-money wallet behind this split (smart_score, smart_count and smart_label) last finished syncing. Graded wallets sync on different schedules, so this is often hours or days ago. Some holdings in the split can come from a Polymarket holder read cached for up to 3 minutes, which this time does not describe. Null when there is no split or a wallet's sync time is unknown. */
1349
1349
  sharp_money_as_of: string | null;
@@ -1376,7 +1376,7 @@ export type ExploreMarket = {
1376
1376
  whale_signal: number | null;
1377
1377
  liquidity_signal: number | null;
1378
1378
  recency_signal: number | null;
1379
- /** Canonical key since #16308; smart_money_signal is its deprecated spelling, emitted beside it with the same value until its sunset on 2027-02-01 (#29352). */
1379
+ /** Canonical key since #16308; smart_money_signal is its deprecated spelling, emitted beside it with the same value until its sunset on 2027-02-01 (#29352). Magnitude abs(smart_score) when smart_label names a supported YES or NO price-relative lean, 0 when smart_score is present with no supported lean, and null when smart_score is null (#36883). */
1380
1380
  sharp_money_signal: number | null;
1381
1381
  /**
1382
1382
  * Deprecated spelling of sharp_money_signal; emitted beside it with the same value. Sunset 2027-02-01 (#29352): removed from V1 on that date; read sharp_money_signal.
@@ -2023,6 +2023,8 @@ export type GameSharpMoney = {
2023
2023
  b: number;
2024
2024
  s: number;
2025
2025
  };
2026
+ /** The most one S or A wallet holds of usd, on the same basis, never above usd (#36883). Published while lifecycle is live and usd > 0; null when usd is 0, when lifecycle is in_play, ended, settled or indeterminate, or when no S or A wallet backs the outcome. */
2027
+ top_wallet_usd: number | null;
2026
2028
  })[];
2027
2029
  status: "computed" | "not_computed" | "unavailable";
2028
2030
  total_usd: number | null;
@@ -2044,7 +2046,7 @@ export type GameSharpMoney = {
2044
2046
  verdict: GameSharpMoneyVerdict;
2045
2047
  money_grades: ("S" | "A" | "B" | "C" | "D" | "F")[];
2046
2048
  } | null;
2047
- /** What S and A grade wallets bought on a game's moneyline since its start, by side, in dollars, while lifecycle is in_play. since is the earlier of scheduled_at and the first live score, so a scheduled_at later than the real start does not start the window late. On a 1X2 it has three outcomes and counts buys of each outcome's YES shares only: a NO buy is money against one outcome, so it is not counted. The verdict is their share alone, no price claim: in play, buys follow the score, so read avg_buy_price. as_of is when the trades were read. A read that found no buy since the start carries bought_usd 0, verdict no_sharp_money and every pct 0. null claims nothing: outside in_play, or with no reading available. */
2049
+ /** Net in-play buys by S and A grade wallets on a game's moneyline since its start (#36857), by side, in dollars, while lifecycle is in_play. Each wallet's in-play sells offset its in-play buys on the same outcome (floored at zero, valued at that wallet's average in-play buy price), counting wallets with at least $25 net bought. since is the earlier of scheduled_at and the first live score, so a scheduled_at later than the real start does not start the window late. On a 1X2 it has three outcomes and counts net buys of each outcome's YES shares only: a NO buy is money against one outcome, so it is not counted, except that a wallet's NO shares bought on an outcome offset its YES shares bought there. On a two-outcome game, equal shares a wallet bought of both sides cancel. The verdict requires payout-share agreement (leans requires the dollar leader to also lead the runner-up in net shares bought by at least 25 percentage points; otherwise split), and a leans or all_on side needs at least three counted buyers and no buyer holding more than half of that side's dollars while the other sides hold at least $25 (otherwise split); it makes no price claim: in play, buys follow the score, so read avg_buy_price. as_of is when the trades were read. A read that found no qualifying net buy since the start carries bought_usd 0, verdict no_sharp_money and every pct 0. null claims nothing: outside in_play, or with no reading available. */
2048
2050
  since_start: {
2049
2051
  as_of: string;
2050
2052
  bought_usd: number;
@@ -2061,6 +2063,8 @@ export type GameSharpMoney = {
2061
2063
  trader_count: number;
2062
2064
  verdict: GameSharpMoneyVerdict;
2063
2065
  } | null;
2066
+ /** Why verdict.kind is no_clear_lean (#36857, #36883). divided: S and A wallets disagree, either a side other than the money leader holds at least $500 from at least 2 more S and A wallets than the leader, or one wallet holds more than half of a side with at least $500 while the other sides hold at least $500 from at least 2 S and A wallets, or (#36881) one wallet holds more than half of a side with at least $500 that the verdict would otherwise name, while the other sides hold at least $25. aligned: no such split, so the money sits about where the price does. null on every other verdict and when status is not computed. */
2067
+ no_lean_reason: "aligned" | "divided" | null;
2064
2068
  };
2065
2069
  export type GameSharpMoneyVerdict = {
2066
2070
  kind: "no_sharp_money";
@@ -2725,7 +2729,7 @@ export type MarketFlow = {
2725
2729
  /** The Polymarket protocol the market trades on, Gamma's market version: v1 (CTF, ConditionalTokens) or v2 (Protocol V2). Read from the condition id, the same value GET /api/v1/markets/settled serves. On a v2 market every token_id this object names is a V2 position id: sign its orders for ExchangeV3 and read its balance as CONDITIONAL-V2. */
2726
2730
  protocol_version: "v1" | "v2";
2727
2731
  };
2728
- /** Outcome-aware flow from all tracked whale trades in the window, without a grade filter. BUY YES and SELL NO add net exposure; BUY NO and SELL YES subtract it. Gross buy/sell volumes count both outcomes. Top positions are separately graded. Direction uses unrounded net: negative is NO, otherwise YES; the zero tie-break is not conviction. Canonical; smart_money is a deprecated byte-identical alias. */
2732
+ /** Outcome-aware flow from S and A graded large trades in the window (#36564, #36883). BUY YES and SELL NO add net exposure; BUY NO and SELL YES subtract it. Gross buy/sell volumes count both outcomes across S and A large trades. Top positions list up to five S and A open net positions worth at least $25 at the stored mark. Direction uses rounded net: positive is YES, negative is NO, and zero is NEUTRAL with a null token_id. Canonical; smart_money is a deprecated byte-identical alias. */
2729
2733
  sharp_money: MarketFlowSharpMoney;
2730
2734
  /**
2731
2735
  * Deprecated alias of sharp_money; byte-identical. Sunset 2027-02-01 (#29352): removed from V1 on that date; read sharp_money.
@@ -2737,8 +2741,8 @@ export type MarketFlow = {
2737
2741
  /** One market's outcome-aware large-trade flow in the window and its top graded positions: the shape of MarketFlow's sharp_money and of its deprecated alias smart_money. */
2738
2742
  export type MarketFlowSharpMoney = {
2739
2743
  net_flow_usd: number;
2740
- direction: "YES" | "NO";
2741
- /** The Polymarket CLOB token id (ERC1155 asset id, decimal string) for the net-flow direction outcome; null when unavailable (e.g. unsynced markets). */
2744
+ direction: "YES" | "NO" | "NEUTRAL";
2745
+ /** The Polymarket CLOB token id (ERC1155 asset id, decimal string) for the net-flow direction outcome; null when direction is NEUTRAL or when unavailable (e.g. unsynced markets). */
2742
2746
  token_id: string | null;
2743
2747
  /** Canonical key since #16304 (Polymarket's noun is large trade); whale_trade_count is its deprecated spelling, emitted beside it with the same value until its sunset on 2027-02-01 (#29352). */
2744
2748
  large_trade_count: number;
@@ -2757,6 +2761,7 @@ export type MarketFlowSharpMoney = {
2757
2761
  side: "YES" | "NO";
2758
2762
  /** The Polymarket CLOB token id (ERC1155 asset id, decimal string) for this outcome; null when unavailable (e.g. unsynced markets). */
2759
2763
  token_id: string | null;
2764
+ /** The wallet's net position on side (YES shares minus NO shares, or the reverse) valued at the stored mark: the YES price for YES, one minus it for NO. At least 25. Read at the wallet's last sync, so oldest_snapshot_as_of dates the roster (#36883). */
2760
2765
  size_usd: number;
2761
2766
  })[];
2762
2767
  /** Age of the oldest stored position snapshot behind top_positions: the minimum wallet sync clock over the positions this body publishes. The roster is a stored read rather than a live one, and graded wallets sit on different sync tiers, so this names how current the whole roster is; the response is no fresher than this timestamp. Null when the roster is empty or no published position carries a sync clock. It does not date net_flow_usd, the volumes or the trade counts, which come from large-trade event times. */
@@ -8040,7 +8045,7 @@ export interface OperationQuery {
8040
8045
  category?: string;
8041
8046
  /** Filter by source platform. all is a request-side no-op. */
8042
8047
  platform?: "polymarket" | "all";
8043
- /** Minimum latest trader grade included in the flow. Default B means S/A/B only; unranked traders are excluded. */
8048
+ /** Minimum latest trader grade included in the flow. Default A means S and A only (#36564, #36883); pass B for S/A/B; unranked traders are excluded. */
8044
8049
  min_grade?: "S" | "A" | "B" | "C" | "D" | "F";
8045
8050
  /** Optional post-aggregate flow direction filter. */
8046
8051
  direction?: "YES" | "NO";
@@ -8060,7 +8065,7 @@ export interface OperationQuery {
8060
8065
  category?: string;
8061
8066
  /** Filter by source platform. all is a request-side no-op. */
8062
8067
  platform?: "polymarket" | "all";
8063
- /** Minimum latest trader grade included in the flow. Default B means S/A/B only; unranked traders are excluded. */
8068
+ /** Minimum latest trader grade included in the flow. Default A means S and A only (#36564, #36883); pass B for S/A/B; unranked traders are excluded. */
8064
8069
  min_grade?: "S" | "A" | "B" | "C" | "D" | "F";
8065
8070
  /** Optional post-aggregate flow direction filter. */
8066
8071
  direction?: "YES" | "NO";