@predictorsdk/client 0.13.1 → 0.15.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/Client.d.ts +27 -7
- package/dist/Client.js +50 -8
- package/dist/api/client/requests/GetEventRequest.d.ts +9 -3
- package/dist/api/client/requests/GetMarketRequest.d.ts +9 -3
- package/dist/api/client/requests/GetMarketsRequest.d.ts +10 -0
- package/dist/api/client/requests/GetSportsMatchingMarketsRequest.d.ts +12 -6
- package/dist/api/errors/ConflictError.d.ts +7 -0
- package/dist/api/errors/ConflictError.js +17 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/types/AmbiguousIdentifierError.d.ts +14 -0
- package/dist/api/types/AmbiguousIdentifierError.js +2 -0
- package/dist/api/types/CanonicalSportsEvent.d.ts +1 -1
- package/dist/api/types/CanonicalSportsSourceMarket.d.ts +5 -1
- package/dist/api/types/CanonicalSportsSourceOutcome.d.ts +7 -1
- package/dist/api/types/EventMarket.d.ts +1 -1
- package/dist/api/types/GetMarketsRequestProvider.d.ts +9 -0
- package/dist/api/types/GetMarketsRequestProvider.js +9 -0
- package/dist/api/types/MarketDetailFeeLeg.d.ts +25 -0
- package/dist/api/types/MarketDetailFeeLeg.js +2 -0
- package/dist/api/types/MarketDetailFeeLegModel.d.ts +18 -0
- package/dist/api/types/MarketDetailFeeLegModel.js +18 -0
- package/dist/api/types/MarketDetailFeeRounding.d.ts +12 -0
- package/dist/api/types/MarketDetailFeeRounding.js +2 -0
- package/dist/api/types/MarketDetailFeeRoundingDirection.d.ts +6 -0
- package/dist/api/types/MarketDetailFeeRoundingDirection.js +6 -0
- package/dist/api/types/MarketDetailOutcome.d.ts +7 -1
- package/dist/api/types/MarketDetailPricing.d.ts +49 -3
- package/dist/api/types/MarketDetailPricingAsOfKind.d.ts +18 -0
- package/dist/api/types/MarketDetailPricingAsOfKind.js +18 -0
- package/dist/api/types/MarketDetailPricingAvailability.d.ts +14 -1
- package/dist/api/types/MarketDetailPricingAvailability.js +14 -1
- package/dist/api/types/MarketDetailPricingSource.d.ts +1 -1
- package/dist/api/types/MarketDetailPricingSource.js +1 -1
- package/dist/api/types/MarketDetailResponse.d.ts +2 -1
- package/dist/api/types/MarketDetailScheduledFeeChange.d.ts +12 -0
- package/dist/api/types/MarketDetailScheduledFeeChange.js +2 -0
- package/dist/api/types/MarketDetailTradingFees.d.ts +40 -0
- package/dist/api/types/MarketDetailTradingFees.js +2 -0
- package/dist/api/types/MarketDetailTradingFeesAvailability.d.ts +9 -0
- package/dist/api/types/MarketDetailTradingFeesAvailability.js +9 -0
- package/dist/api/types/MarketDetailTradingFeesChargeBasis.d.ts +10 -0
- package/dist/api/types/MarketDetailTradingFeesChargeBasis.js +10 -0
- package/dist/api/types/MarketDetailTradingFeesSource.d.ts +7 -0
- package/dist/api/types/MarketDetailTradingFeesSource.js +7 -0
- package/dist/api/types/MarketsListResponse.d.ts +2 -0
- package/dist/api/types/MarketsSnapshot.d.ts +17 -0
- package/dist/api/types/MarketsSnapshot.js +2 -0
- package/dist/api/types/PlatformMarket.d.ts +1 -1
- package/dist/api/types/UnifiedMarket.d.ts +1 -1
- package/dist/api/types/index.d.ts +13 -0
- package/dist/api/types/index.js +13 -0
- package/dist/serialization/types/AmbiguousIdentifierError.d.ts +12 -0
- package/dist/serialization/types/AmbiguousIdentifierError.js +8 -0
- package/dist/serialization/types/GetMarketsRequestProvider.d.ts +7 -0
- package/dist/serialization/types/GetMarketsRequestProvider.js +3 -0
- package/dist/serialization/types/MarketDetailFeeLeg.d.ts +14 -0
- package/dist/serialization/types/MarketDetailFeeLeg.js +10 -0
- package/dist/serialization/types/MarketDetailFeeLegModel.d.ts +7 -0
- package/dist/serialization/types/MarketDetailFeeLegModel.js +3 -0
- package/dist/serialization/types/MarketDetailFeeRounding.d.ts +11 -0
- package/dist/serialization/types/MarketDetailFeeRounding.js +7 -0
- package/dist/serialization/types/MarketDetailFeeRoundingDirection.d.ts +7 -0
- package/dist/serialization/types/MarketDetailFeeRoundingDirection.js +3 -0
- package/dist/serialization/types/MarketDetailPricing.d.ts +3 -0
- package/dist/serialization/types/MarketDetailPricing.js +3 -0
- package/dist/serialization/types/MarketDetailPricingAsOfKind.d.ts +7 -0
- package/dist/serialization/types/MarketDetailPricingAsOfKind.js +3 -0
- package/dist/serialization/types/MarketDetailPricingAvailability.d.ts +1 -1
- package/dist/serialization/types/MarketDetailPricingAvailability.js +1 -1
- package/dist/serialization/types/MarketDetailResponse.d.ts +2 -0
- package/dist/serialization/types/MarketDetailResponse.js +2 -0
- package/dist/serialization/types/MarketDetailScheduledFeeChange.d.ts +12 -0
- package/dist/serialization/types/MarketDetailScheduledFeeChange.js +8 -0
- package/dist/serialization/types/MarketDetailTradingFees.d.ts +20 -0
- package/dist/serialization/types/MarketDetailTradingFees.js +16 -0
- package/dist/serialization/types/MarketDetailTradingFeesAvailability.d.ts +7 -0
- package/dist/serialization/types/MarketDetailTradingFeesAvailability.js +3 -0
- package/dist/serialization/types/MarketDetailTradingFeesChargeBasis.d.ts +7 -0
- package/dist/serialization/types/MarketDetailTradingFeesChargeBasis.js +3 -0
- package/dist/serialization/types/MarketDetailTradingFeesSource.d.ts +7 -0
- package/dist/serialization/types/MarketDetailTradingFeesSource.js +3 -0
- package/dist/serialization/types/MarketsListResponse.d.ts +2 -0
- package/dist/serialization/types/MarketsListResponse.js +2 -0
- package/dist/serialization/types/MarketsSnapshot.d.ts +9 -0
- package/dist/serialization/types/MarketsSnapshot.js +5 -0
- package/dist/serialization/types/index.d.ts +13 -0
- package/dist/serialization/types/index.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/**
|
|
3
|
+
* The price term of the per-share fee.
|
|
4
|
+
*
|
|
5
|
+
* `quadratic` — `rate × (price × (1 − price)) ^ exponent`. Kalshi (`roundup(0.07 × C × P × (1−P))`, exponent 1 by published formula), Polymarket (`fee = C × feeRate × p × (1 − p)`, exponent read per market), AlphaArcade (`feeBase × quantity × price × (1 − price)`).
|
|
6
|
+
*
|
|
7
|
+
* `min_price` — `rate × min(price, 1 − price)`. Predict (`Base Fee % × min(Price, 1 − Price) × Shares`). A TENT, not a parabola: the effective rate on notional is flat at `rate` for every price at or below 0.5 and only declines above it. Do not collapse this into `quadratic`; it would overstate the fee at every price below 0.5.
|
|
8
|
+
*
|
|
9
|
+
* `notional` — `rate × price`, i.e. a flat fraction of traded notional with no price curve at all.
|
|
10
|
+
*
|
|
11
|
+
* `none` — zero, asserted.
|
|
12
|
+
*/
|
|
13
|
+
export const MarketDetailFeeLegModel = {
|
|
14
|
+
Quadratic: "quadratic",
|
|
15
|
+
MinPrice: "min_price",
|
|
16
|
+
Notional: "notional",
|
|
17
|
+
None: "none",
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The venue's published rounding rule, applied to the computed fee. Null where the venue publishes no rule (Predict) — treat that as UNKNOWN rather than as "no rounding", which would understate small trades.
|
|
4
|
+
*
|
|
5
|
+
* Kalshi additionally charges a per-fill rounding fee that restores the member's balance precision ($0.01 for non-direct members, $0.0001 for direct), offset by a rebate once accumulated rounding exceeds $0.01. That depends on fill fragmentation and member type, so it is not predictable pre-trade and is deliberately not modeled here — expect a small positive difference between the figure you compute and the figure Kalshi charges across many partial fills.
|
|
6
|
+
*/
|
|
7
|
+
export interface MarketDetailFeeRounding {
|
|
8
|
+
/** `up` — the venue rounds the fee UP to the next increment (Kalshi ceils to $0.0001; AlphaArcade ceils to 1e-6 USDC). `nearest` — the venue rounds to the nearest increment (Polymarket rounds to 5 decimal places, with 0.00001 USDC the smallest fee charged). */
|
|
9
|
+
direction: PredictorSDK.MarketDetailFeeRoundingDirection;
|
|
10
|
+
/** The rounding increment in the market's quote currency. */
|
|
11
|
+
increment: number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** `up` — the venue rounds the fee UP to the next increment (Kalshi ceils to $0.0001; AlphaArcade ceils to 1e-6 USDC). `nearest` — the venue rounds to the nearest increment (Polymarket rounds to 5 decimal places, with 0.00001 USDC the smallest fee charged). */
|
|
2
|
+
export declare const MarketDetailFeeRoundingDirection: {
|
|
3
|
+
readonly Up: "up";
|
|
4
|
+
readonly Nearest: "nearest";
|
|
5
|
+
};
|
|
6
|
+
export type MarketDetailFeeRoundingDirection = (typeof MarketDetailFeeRoundingDirection)[keyof typeof MarketDetailFeeRoundingDirection];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** `up` — the venue rounds the fee UP to the next increment (Kalshi ceils to $0.0001; AlphaArcade ceils to 1e-6 USDC). `nearest` — the venue rounds to the nearest increment (Polymarket rounds to 5 decimal places, with 0.00001 USDC the smallest fee charged). */
|
|
3
|
+
export const MarketDetailFeeRoundingDirection = {
|
|
4
|
+
Up: "up",
|
|
5
|
+
Nearest: "nearest",
|
|
6
|
+
};
|
|
@@ -3,7 +3,13 @@ export interface MarketDetailOutcome {
|
|
|
3
3
|
name: string;
|
|
4
4
|
/** Stable per-platform key for this outcome: Kalshi `yes`/`no`, Polymarket CLOB token id, Predict on-chain id, SX Bet `outcomeOne`/`outcomeTwo`, Hyperliquid coin encoding (`#<10*outcome+side>`). The join key for future per-outcome sub-resources (order-book depth). */
|
|
5
5
|
outcomeId?: string;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Current implied probability of this outcome in 0–1 — the headline field, equal to the implied probability on every supported platform. Derivation cascade: mid of bid/ask when two-sided → the single available side → last trade → platform mark (Polymarket `outcomePrices`, which preserves 0/1 resolution marks on settled markets; AlphaArcade's catalog midpoint). Because the cascade differs by what each platform exposes, `price` is a DISPLAY number — when comparing across platforms or sizing trades, prefer `bid`/`ask` directly where present. Null when no quote of any kind exists.
|
|
8
|
+
*
|
|
9
|
+
* **A non-null `price` does not mean a tradeable price.** The last two rungs of the cascade produce a number with no book behind it, and the mid of a 0.01 / 0.99 book produces a confident-looking 0.5 that no one will fill. Read `pricing.availability` first: `live` says at least one outcome has a book the venue treats as quoted; `indicative` says every price here is a mark, a lone side, or a book the venue's own spread threshold rejects.
|
|
10
|
+
*
|
|
11
|
+
* GUARANTEE: when `pricing.availability` is `live` or `indicative`, `price` is non-null on every outcome. Values are rounded to at most 6 decimal places.
|
|
12
|
+
*/
|
|
7
13
|
price: number | null;
|
|
8
14
|
/** Best bid for this outcome in 0–1 probability. Null when that book side is empty or the platform doesn't publish per-outcome quotes on the record (Polymarket non-primary outcomes). Hyperliquid's second side is derived from the merged book complement (`1 − first-side ask`), matching the platform's order-book structure; no other platform synthesizes bid from `1 − ask`. */
|
|
9
15
|
bid: number | null;
|
|
@@ -1,16 +1,62 @@
|
|
|
1
1
|
import type * as PredictorSDK from "../index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Market-wide quote metadata for the pricing tier. Always present on the response; `availability` tells the truth about what the tier could hydrate instead of leaving consumers to guess from nulls.
|
|
4
|
+
*
|
|
5
|
+
* **Bounding quote freshness.** `as_of` is the provider's own stamp and means something different on each platform, so read `as_of_kind` before applying an age bound to it — only `as_of_kind: quote` tracks the quote closely enough to bound at all, and how tight that bound can be still varies by venue. `observed_at` is PredictorSDK's own read time and means the same thing on every provider, so it is the field to bound when you need one threshold that behaves identically across platforms.
|
|
4
6
|
*/
|
|
5
7
|
export interface MarketDetailPricing {
|
|
6
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* How completely — and how honestly — the pricing tier hydrated. It answers two questions in this precedence order: did every outcome get a price, and is any of those prices backed by a book you could actually cross.
|
|
10
|
+
*
|
|
11
|
+
* `live` — every outcome carries a price AND at least one outcome has a two-sided book the venue itself treats as quoted. **This is the only value that licenses reading `price` as a tradeable level.**
|
|
12
|
+
*
|
|
13
|
+
* `indicative` — every outcome carries a price, but no outcome has such a book behind it. The prices are marks, one side of a book with nothing facing it, or a two-sided book wider than the venue's own published spread threshold for that market. Concretely: an AlphaArcade market whose order book is empty, where the catalog midpoint is the only price left standing; a Predict market quoted 0.01 / 0.99, whose 0.5 midpoint is arithmetic rather than a market (Predict publishes a per-market `spreadThreshold` and this server honours it); a settled Polymarket market whose 1/0 `outcomePrices` are resolution marks; or a book with one resting order and nothing on the other side. `price` is still populated and still the venue's own number — treat it as roughly where the market is thought to be, never as a level you can trade or arbitrage against. **Filter or flag `indicative` before computing cross-venue edges**: an `indicative` 0.5 next to a `live` 0.735 elsewhere is not a 23¢ opportunity, it is one venue with no book.
|
|
14
|
+
*
|
|
15
|
+
* `partial` — some but not all outcomes priced. Incompleteness is reported ahead of quote quality because it is the louder warning, so a `partial` market says nothing about the book behind the prices it does carry.
|
|
16
|
+
*
|
|
17
|
+
* `no_quotes` — the pricing read succeeded and there is nothing at all: no book and no mark (SX Bet or Hyperliquid with no resting orders; Kalshi provisional/multivariate markets whose quotes are empty-book placeholders; AlphaArcade markets that have never traded). An empty book truthfully read is still an observation, so `observed_at` is populated.
|
|
18
|
+
*
|
|
19
|
+
* `unavailable` — the pricing enrichment fetch failed or timed out (SX Bet/Hyperliquid); identity fields are still served and `observed_at` is null.
|
|
20
|
+
*/
|
|
7
21
|
availability: PredictorSDK.MarketDetailPricingAvailability;
|
|
8
22
|
/** Self-describing unit declaration for all price fields. Single canonical scale today; new values would be added alongside (never replacing) this one. */
|
|
9
23
|
scale: PredictorSDK.MarketDetailPricingScale;
|
|
10
|
-
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/
|
|
24
|
+
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/orderbook-v3/snapshot`, Hyperliquid `l2Book`). */
|
|
11
25
|
source: PredictorSDK.MarketDetailPricingSource;
|
|
12
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The upstream timestamp on this platform's own clock, as RFC3339. When the two sides carry independent stamps this is the OLDER of them — a conservative floor that never over-claims freshness. Null when the record carries no timestamp at all (Predict, AlphaArcade, and SX Bet).
|
|
28
|
+
*
|
|
29
|
+
* **This field is NOT a uniform freshness bound. Read `as_of_kind` first.** What it measures differs per platform: on Hyperliquid it is the order book's server time and moves with the book, while on Kalshi it is a record write that does not move while the market is quoted. Measured live on 2026-08-24 over two runs — 100 open markets read twice 7.5 minutes apart, and 96 open markets read twice 11 minutes apart:
|
|
30
|
+
*
|
|
31
|
+
* * `kalshi` — **15 hours to 137 days old** on markets reporting `status: open` and `availability: live` with a real two-sided book. The age tracks how long ago the record was last written, so it depends entirely on the market: same-day game markets ran a median of ~23 h in one sample and ~43 h in another, while a broad sample of the market list ran a median of ~101 days (`CHINAUSGDP-30`, `status: open`, quoted 0.15 / 0.19, was stamped 2026-04-09). Advanced on 0 of 39 and 0 of 42 markets across the two runs, including five whose prices moved inside the window. **Not boundable at any threshold — do not infer one from these numbers.**
|
|
32
|
+
* * `polymarket` — 45 s to 405 s old; advanced on 60 of 60 and 25 of 25 markets, while only 1 of those 25 prices changed. Values recur identically across dozens of unrelated markets (one batch write, not one quote). Bounds record age in minutes, not quote age in seconds.
|
|
33
|
+
* * `sxbet` — a real per-side quote stamp on the V2 best-odds path, but it marks when the resting top-of-book order was posted, so on a thin book it is legitimately old: measured 39 s to 2.5 h, median ~24 min. It advances when the quote advances, which is what makes it a quote stamp — but size the bound to the venue's liquidity, not in seconds. Null from the 2026-08-25 V3 cutover onward.
|
|
34
|
+
* * `hyperliquid` — the `l2Book` server timestamp, a real quote stamp and the one field here that genuinely supports a seconds-scale bound: polled directly it tracks wall clock to the second.
|
|
35
|
+
* * `predict`, `alpha-arcade` — always null.
|
|
36
|
+
*
|
|
37
|
+
* These ranges are observed behaviour, not a contract: they are published so a consumer can pick a threshold from measured data rather than guessing, and they can change whenever a venue changes how it writes its records. Server ingest time is never substituted into this field — that would masquerade as an upstream stamp. Use `observed_at` for the read time.
|
|
38
|
+
*/
|
|
13
39
|
asOf: Date | null;
|
|
40
|
+
/**
|
|
41
|
+
* What `as_of` MEASURES on this provider, so one consumer code path can bound freshness tightly where the value is a quote time and refuse to pretend where it is not. Always present; `unknown` whenever `as_of` is null, never an empty string.
|
|
42
|
+
*
|
|
43
|
+
* `quote` — the stamp advances when the quote advances, so an age bound on it is meaningful. Hyperliquid (`l2Book` server time) and SX Bet's V2 best-odds path. How TIGHT that bound can be still depends on the venue: Hyperliquid's tracks wall clock to the second, while SX Bet's marks when the resting top-of-book order was posted and is legitimately tens of minutes old on a thin book. Size the threshold to the venue's liquidity; a blanket seconds-scale bound rejects most of SX Bet.
|
|
44
|
+
*
|
|
45
|
+
* `record_refresh` — the stamp advances on a periodic rewrite of the provider's record, independent of whether the quote moved. Bounds RECORD age (minutes), not quote age. Polymarket.
|
|
46
|
+
*
|
|
47
|
+
* `record_static` — the stamp does not advance while the market is actively quoted, so it bounds nothing at any threshold. Kalshi. Treat quote freshness as unknown here and do not gate on `as_of`; bound `observed_at` instead and take executable price from the venue's own book.
|
|
48
|
+
*
|
|
49
|
+
* `unknown` — `as_of` is null: the record carries no timestamp of any kind (Predict, AlphaArcade, SX Bet V3). Kept distinct from `record_static` because the underlying fact differs even though the consumer's action does not.
|
|
50
|
+
*/
|
|
51
|
+
asOfKind: PredictorSDK.MarketDetailPricingAsOfKind;
|
|
52
|
+
/**
|
|
53
|
+
* When PREDICTORSDK read these quotes, as RFC3339 — an observation timestamp, not an upstream one. Named `observed_at` rather than `as_of` for the same reason `trading_fees.observed_at` is: `as_of` is the provider's own stamp, and reusing the name for a differently-defined value would bake that confusion into a second field.
|
|
54
|
+
*
|
|
55
|
+
* This is the one timestamp on the response whose definition does not vary by platform, which makes it the field to bound when you need a single threshold that behaves identically everywhere. It bounds the age of the READ, not the age of the quote: on a `record_static` provider a fresh `observed_at` beside a 23-hour `as_of` is the honest description of what the venue served. `/v1/markets/{market_id}` reads the venue live on every request and caches nothing, so this stamp is the request time.
|
|
56
|
+
*
|
|
57
|
+
* Taken BEFORE the upstream call, so it is never newer than the moment the quotes were actually observed and `now - observed_at` never understates their age. Null only when `availability` is `unavailable` — no quotes were observed, so there is nothing to stamp. Populated for `no_quotes`, where an empty book is a successful observation.
|
|
58
|
+
*/
|
|
59
|
+
observedAt: Date | null;
|
|
14
60
|
/** True when this market belongs to a negative-risk multi-outcome event (Polymarket `negRisk`, Predict `isNegRisk`). On a multi-outcome record, outcome prices intentionally need not sum to 1 — do not "normalize" the book. Note that for the BINARY member markets these platforms serve today the flag signals event-level structure (this market is one leg of a mutually-exclusive set); the binary pair itself still sums to ~1. Omitted when false. */
|
|
15
61
|
negRisk?: boolean;
|
|
16
62
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What `as_of` MEASURES on this provider, so one consumer code path can bound freshness tightly where the value is a quote time and refuse to pretend where it is not. Always present; `unknown` whenever `as_of` is null, never an empty string.
|
|
3
|
+
*
|
|
4
|
+
* `quote` — the stamp advances when the quote advances, so an age bound on it is meaningful. Hyperliquid (`l2Book` server time) and SX Bet's V2 best-odds path. How TIGHT that bound can be still depends on the venue: Hyperliquid's tracks wall clock to the second, while SX Bet's marks when the resting top-of-book order was posted and is legitimately tens of minutes old on a thin book. Size the threshold to the venue's liquidity; a blanket seconds-scale bound rejects most of SX Bet.
|
|
5
|
+
*
|
|
6
|
+
* `record_refresh` — the stamp advances on a periodic rewrite of the provider's record, independent of whether the quote moved. Bounds RECORD age (minutes), not quote age. Polymarket.
|
|
7
|
+
*
|
|
8
|
+
* `record_static` — the stamp does not advance while the market is actively quoted, so it bounds nothing at any threshold. Kalshi. Treat quote freshness as unknown here and do not gate on `as_of`; bound `observed_at` instead and take executable price from the venue's own book.
|
|
9
|
+
*
|
|
10
|
+
* `unknown` — `as_of` is null: the record carries no timestamp of any kind (Predict, AlphaArcade, SX Bet V3). Kept distinct from `record_static` because the underlying fact differs even though the consumer's action does not.
|
|
11
|
+
*/
|
|
12
|
+
export declare const MarketDetailPricingAsOfKind: {
|
|
13
|
+
readonly Quote: "quote";
|
|
14
|
+
readonly RecordRefresh: "record_refresh";
|
|
15
|
+
readonly RecordStatic: "record_static";
|
|
16
|
+
readonly Unknown: "unknown";
|
|
17
|
+
};
|
|
18
|
+
export type MarketDetailPricingAsOfKind = (typeof MarketDetailPricingAsOfKind)[keyof typeof MarketDetailPricingAsOfKind];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/**
|
|
3
|
+
* What `as_of` MEASURES on this provider, so one consumer code path can bound freshness tightly where the value is a quote time and refuse to pretend where it is not. Always present; `unknown` whenever `as_of` is null, never an empty string.
|
|
4
|
+
*
|
|
5
|
+
* `quote` — the stamp advances when the quote advances, so an age bound on it is meaningful. Hyperliquid (`l2Book` server time) and SX Bet's V2 best-odds path. How TIGHT that bound can be still depends on the venue: Hyperliquid's tracks wall clock to the second, while SX Bet's marks when the resting top-of-book order was posted and is legitimately tens of minutes old on a thin book. Size the threshold to the venue's liquidity; a blanket seconds-scale bound rejects most of SX Bet.
|
|
6
|
+
*
|
|
7
|
+
* `record_refresh` — the stamp advances on a periodic rewrite of the provider's record, independent of whether the quote moved. Bounds RECORD age (minutes), not quote age. Polymarket.
|
|
8
|
+
*
|
|
9
|
+
* `record_static` — the stamp does not advance while the market is actively quoted, so it bounds nothing at any threshold. Kalshi. Treat quote freshness as unknown here and do not gate on `as_of`; bound `observed_at` instead and take executable price from the venue's own book.
|
|
10
|
+
*
|
|
11
|
+
* `unknown` — `as_of` is null: the record carries no timestamp of any kind (Predict, AlphaArcade, SX Bet V3). Kept distinct from `record_static` because the underlying fact differs even though the consumer's action does not.
|
|
12
|
+
*/
|
|
13
|
+
export const MarketDetailPricingAsOfKind = {
|
|
14
|
+
Quote: "quote",
|
|
15
|
+
RecordRefresh: "record_refresh",
|
|
16
|
+
RecordStatic: "record_static",
|
|
17
|
+
Unknown: "unknown",
|
|
18
|
+
};
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* How completely — and how honestly — the pricing tier hydrated. It answers two questions in this precedence order: did every outcome get a price, and is any of those prices backed by a book you could actually cross.
|
|
3
|
+
*
|
|
4
|
+
* `live` — every outcome carries a price AND at least one outcome has a two-sided book the venue itself treats as quoted. **This is the only value that licenses reading `price` as a tradeable level.**
|
|
5
|
+
*
|
|
6
|
+
* `indicative` — every outcome carries a price, but no outcome has such a book behind it. The prices are marks, one side of a book with nothing facing it, or a two-sided book wider than the venue's own published spread threshold for that market. Concretely: an AlphaArcade market whose order book is empty, where the catalog midpoint is the only price left standing; a Predict market quoted 0.01 / 0.99, whose 0.5 midpoint is arithmetic rather than a market (Predict publishes a per-market `spreadThreshold` and this server honours it); a settled Polymarket market whose 1/0 `outcomePrices` are resolution marks; or a book with one resting order and nothing on the other side. `price` is still populated and still the venue's own number — treat it as roughly where the market is thought to be, never as a level you can trade or arbitrage against. **Filter or flag `indicative` before computing cross-venue edges**: an `indicative` 0.5 next to a `live` 0.735 elsewhere is not a 23¢ opportunity, it is one venue with no book.
|
|
7
|
+
*
|
|
8
|
+
* `partial` — some but not all outcomes priced. Incompleteness is reported ahead of quote quality because it is the louder warning, so a `partial` market says nothing about the book behind the prices it does carry.
|
|
9
|
+
*
|
|
10
|
+
* `no_quotes` — the pricing read succeeded and there is nothing at all: no book and no mark (SX Bet or Hyperliquid with no resting orders; Kalshi provisional/multivariate markets whose quotes are empty-book placeholders; AlphaArcade markets that have never traded). An empty book truthfully read is still an observation, so `observed_at` is populated.
|
|
11
|
+
*
|
|
12
|
+
* `unavailable` — the pricing enrichment fetch failed or timed out (SX Bet/Hyperliquid); identity fields are still served and `observed_at` is null.
|
|
13
|
+
*/
|
|
2
14
|
export declare const MarketDetailPricingAvailability: {
|
|
3
15
|
readonly Live: "live";
|
|
16
|
+
readonly Indicative: "indicative";
|
|
4
17
|
readonly Partial: "partial";
|
|
5
18
|
readonly NoQuotes: "no_quotes";
|
|
6
19
|
readonly Unavailable: "unavailable";
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* How completely — and how honestly — the pricing tier hydrated. It answers two questions in this precedence order: did every outcome get a price, and is any of those prices backed by a book you could actually cross.
|
|
4
|
+
*
|
|
5
|
+
* `live` — every outcome carries a price AND at least one outcome has a two-sided book the venue itself treats as quoted. **This is the only value that licenses reading `price` as a tradeable level.**
|
|
6
|
+
*
|
|
7
|
+
* `indicative` — every outcome carries a price, but no outcome has such a book behind it. The prices are marks, one side of a book with nothing facing it, or a two-sided book wider than the venue's own published spread threshold for that market. Concretely: an AlphaArcade market whose order book is empty, where the catalog midpoint is the only price left standing; a Predict market quoted 0.01 / 0.99, whose 0.5 midpoint is arithmetic rather than a market (Predict publishes a per-market `spreadThreshold` and this server honours it); a settled Polymarket market whose 1/0 `outcomePrices` are resolution marks; or a book with one resting order and nothing on the other side. `price` is still populated and still the venue's own number — treat it as roughly where the market is thought to be, never as a level you can trade or arbitrage against. **Filter or flag `indicative` before computing cross-venue edges**: an `indicative` 0.5 next to a `live` 0.735 elsewhere is not a 23¢ opportunity, it is one venue with no book.
|
|
8
|
+
*
|
|
9
|
+
* `partial` — some but not all outcomes priced. Incompleteness is reported ahead of quote quality because it is the louder warning, so a `partial` market says nothing about the book behind the prices it does carry.
|
|
10
|
+
*
|
|
11
|
+
* `no_quotes` — the pricing read succeeded and there is nothing at all: no book and no mark (SX Bet or Hyperliquid with no resting orders; Kalshi provisional/multivariate markets whose quotes are empty-book placeholders; AlphaArcade markets that have never traded). An empty book truthfully read is still an observation, so `observed_at` is populated.
|
|
12
|
+
*
|
|
13
|
+
* `unavailable` — the pricing enrichment fetch failed or timed out (SX Bet/Hyperliquid); identity fields are still served and `observed_at` is null.
|
|
14
|
+
*/
|
|
3
15
|
export const MarketDetailPricingAvailability = {
|
|
4
16
|
Live: "live",
|
|
17
|
+
Indicative: "indicative",
|
|
5
18
|
Partial: "partial",
|
|
6
19
|
NoQuotes: "no_quotes",
|
|
7
20
|
Unavailable: "unavailable",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/
|
|
1
|
+
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/orderbook-v3/snapshot`, Hyperliquid `l2Book`). */
|
|
2
2
|
export declare const MarketDetailPricingSource: {
|
|
3
3
|
readonly MarketRecord: "market_record";
|
|
4
4
|
readonly Orderbook: "orderbook";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/
|
|
2
|
+
/** Where the quotes came from. `market_record` — embedded in the same single-market record as the identity fetch (Kalshi, Polymarket, Predict). `orderbook` — required one bounded second fetch against the platform's order-book surface (SX Bet `/orderbook-v3/snapshot`, Hyperliquid `l2Book`). */
|
|
3
3
|
export const MarketDetailPricingSource = {
|
|
4
4
|
MarketRecord: "market_record",
|
|
5
5
|
Orderbook: "orderbook",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as PredictorSDK from "../index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Single-market detail across all six supported platforms. Identity fields are strict-universal (no second fetch on any platform); the pricing tier carries per-outcome quotes plus market-level aggregates with explicit nulls where a platform doesn't natively expose a figure — values are never fabricated. closes_at/event_id remain deliberately omitted, see the endpoint description for the rationale.
|
|
3
|
+
* Single-market detail across all six supported platforms. Identity fields are strict-universal (no second fetch on any platform); the pricing tier carries per-outcome quotes plus market-level aggregates with explicit nulls where a platform doesn't natively expose a figure — values are never fabricated. The trading_fees tier applies the same rule to the venue's own published fee parameters. closes_at/event_id remain deliberately omitted, see the endpoint description for the rationale.
|
|
4
4
|
*/
|
|
5
5
|
export interface MarketDetailResponse {
|
|
6
6
|
/** Composite market identifier in the format `{provider}:{provider_id}`. Matches the `id` field returned by `GET /v1/markets` so list output flows into detail lookups without preprocessing. */
|
|
@@ -16,6 +16,7 @@ export interface MarketDetailResponse {
|
|
|
16
16
|
/** Outcomes with per-outcome quotes. ORDERING GUARANTEE: `outcomes[0]` is the platform's primary/headline outcome — Kalshi `Yes`, Polymarket's first outcome token (its `bestBid`/`bestAsk` side), Predict `indexSet=1`, SX Bet `outcomeOne`, Hyperliquid's first `sideSpec`. Render `outcomes[0].price` as the headline probability; do NOT search for an outcome named "Yes" (names are free-text on Predict/SX Bet/Hyperliquid). Every supported platform models per-market outcomes as a 2-element list in practice (multi-outcome events are modeled as multiple binary markets nested under one event/category); the per-outcome quote shape handles binary and any future multi-outcome record identically with no special-casing. */
|
|
17
17
|
outcomes: PredictorSDK.MarketDetailOutcome[];
|
|
18
18
|
pricing: PredictorSDK.MarketDetailPricing;
|
|
19
|
+
tradingFees: PredictorSDK.MarketDetailTradingFees;
|
|
19
20
|
/** Resting order-book depth valued in USD — strictly CLOB book depth, never an AMM pool size or a synthetic score. Polymarket exposes it natively (`liquidityNum`); null for Kalshi (its upstream `liquidity_dollars` is deprecated and always zero), Predict (stats is null on the record), and SX Bet/Hyperliquid (no scalar without summing the raw order book). */
|
|
20
21
|
liquidityUsd: number | null;
|
|
21
22
|
/** Trailing-24h traded volume in USD notional. Null where the platform doesn't denominate volume in USD — notably Kalshi (contracts; see `volume_24h_contracts`) — or doesn't expose a volume aggregate at all (SX Bet, Hyperliquid, Predict's record). */
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The next PUBLISHED change to this market's fee parameters and when it takes effect. OMITTED (not null) when there is no pending change, matching `pricing.neg_risk`.
|
|
4
|
+
*
|
|
5
|
+
* Kalshi is the only platform that publishes this today, and it matters: every MLB series currently runs at a `fee_multiplier` of 0.5 with a per-event override restoring 1.0 at first pitch, so the fee DOUBLES mid-market on a game that is already trading. On a $100 taker order at a price of 0.42 that is 203 bps before the first pitch and 406 bps after — enough to change which venue is cheaper for the same canonical outcome at the same price. Without this field a consumer mis-costs every order placed near a game start with no way to see it coming.
|
|
6
|
+
*/
|
|
7
|
+
export interface MarketDetailScheduledFeeChange {
|
|
8
|
+
/** When the new parameters take effect, RFC3339. */
|
|
9
|
+
effectiveAt: Date;
|
|
10
|
+
taker: PredictorSDK.MarketDetailFeeLeg | null;
|
|
11
|
+
maker: PredictorSDK.MarketDetailFeeLeg | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The trading fee the PREDICTION MARKET charges on a trade in this market — the venue's own published parameters, normalized. This has nothing to do with PredictorSDK's subscription pricing.
|
|
4
|
+
*
|
|
5
|
+
* Always present on the response. Every published model across the six platforms is a per-share fee times the traded share count, and only the price term differs, so `taker.model` plus its parameters expresses each venue exactly rather than approximating any of them. Compute the fee yourself:
|
|
6
|
+
*
|
|
7
|
+
* `fee = shares × f(price)`, then apply `rounding`, where `f` is
|
|
8
|
+
*
|
|
9
|
+
* - `quadratic`: `rate × (price × (1 − price)) ^ exponent`
|
|
10
|
+
* - `min_price`: `rate × min(price, 1 − price)`
|
|
11
|
+
* - `notional`: `rate × price`
|
|
12
|
+
* - `none`: `0`
|
|
13
|
+
*
|
|
14
|
+
* The effective rate on notional — what you actually compare across venues — is `f(price) / price`. For `quadratic` at `exponent: 1` that reduces to `rate × (1 − price)`, which is why no single basis-point figure can express any of these venues: at `rate: 0.07` the effective cost runs from 693 bps at a price of 0.01 down to 7 bps at 0.99.
|
|
15
|
+
*
|
|
16
|
+
* `availability` and the legs are on separate axes on purpose: availability says what is KNOWN, the legs say what is CHARGED. A fee-free market is `availability: published` with `model: "none"` and `rate: 0` — an asserted zero, distinguishable from `unpublished` (the venue publishes nothing) and from `account_specific` (rates exist but are per-account).
|
|
17
|
+
*
|
|
18
|
+
* OUT OF SCOPE and therefore not modeled as fields, though each is real and moves the number: rebates (Polymarket's maker-rebate and taker-rebate programs), per-account discounts (Predict's 10% invite discount), volume/staking tiers (Hyperliquid), and third-party pass-through (Kalshi FCM customers, Polymarket builder fees). The parameters here are the venue's PUBLISHED base for this market; a specific account may pay less.
|
|
19
|
+
*/
|
|
20
|
+
export interface MarketDetailTradingFees {
|
|
21
|
+
/** `published` — the full parameter set for this market is known. `partial` — fees may be charged here but a parameter is missing or uninterpretable upstream; the legs carry what is known and null the rest, never a guess. It also covers the case where the parameters in force are known but the venue's pending-change list was unreadable, so an omitted `scheduled_change` means "unknown" rather than "none". `account_specific` — rates exist but are set per trading account and require your own venue credentials (SX Bet's `GET /user/fees-v3`, Hyperliquid's `POST /info {"type":"userFees"}`). `unpublished` — the venue publishes no fee model for this market at all. `unavailable` — our own bounded parameter fetch failed or timed out; identity and pricing are still served. Same contract as `pricing.availability`. */
|
|
22
|
+
availability: PredictorSDK.MarketDetailTradingFeesAvailability;
|
|
23
|
+
/**
|
|
24
|
+
* When PredictorSDK READ these parameter values — an observation timestamp, not an upstream stamp.
|
|
25
|
+
*
|
|
26
|
+
* Named `observed_at` rather than `as_of` deliberately: `pricing.as_of` is the provider record's own last-update time, which is a different thing, and reusing the name for a differently-defined timestamp would bake that confusion into a second field. Null when nothing is read at request time (`source: venue_schedule`) or when nothing could be read (`availability: unavailable`).
|
|
27
|
+
*/
|
|
28
|
+
observedAt: Date | null;
|
|
29
|
+
/** Where the parameters came from, so a latency-sensitive consumer knows which platforms cost extra hops. `market_record` — embedded in the same market record the identity fetch already returned (Polymarket `feeSchedule`, Predict `feeRateBps`, AlphaArcade `feeBasePercent`); zero extra fetches. `series_record` — the parameters live on parent records and cost up to three small, TTL-cached hops (Kalshi: the event record for its series ticker and any fee override in force, the series for the base `fee_type`/`fee_multiplier` that override supersedes, then the event's pending fee changes for `scheduled_change`). `venue_schedule` — the venue exposes no per-market parameter and the answer comes from its published schedule (SX Bet, Hyperliquid). */
|
|
30
|
+
source: PredictorSDK.MarketDetailTradingFeesSource;
|
|
31
|
+
/**
|
|
32
|
+
* What the fee is assessed on. `fill` — assessed when the order fills, from the traded share count and the fill price. `settlement_profit` — assessed at settlement, on profit (total return − stake), and only on a position that WON; a loss or a void is never charged.
|
|
33
|
+
*
|
|
34
|
+
* Read this before comparing rates across venues. SX Bet charges on winning profit at settlement, so its fee is an expected-value haircut rather than an entry cost — a consumer that models it as a percentage of notional is wrong about the shape before it is wrong about the rate. The reported basis is the one that applies to trading: SX Bet's four payout fees. Its separate `refundFee` is charged at fill time on the capital-efficiency refund rather than on profit, and is out of scope here along with its rates.
|
|
35
|
+
*/
|
|
36
|
+
chargeBasis: PredictorSDK.MarketDetailTradingFeesChargeBasis | null;
|
|
37
|
+
taker: PredictorSDK.MarketDetailFeeLeg | null;
|
|
38
|
+
maker: PredictorSDK.MarketDetailFeeLeg | null;
|
|
39
|
+
scheduledChange?: PredictorSDK.MarketDetailScheduledFeeChange | null;
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** `published` — the full parameter set for this market is known. `partial` — fees may be charged here but a parameter is missing or uninterpretable upstream; the legs carry what is known and null the rest, never a guess. It also covers the case where the parameters in force are known but the venue's pending-change list was unreadable, so an omitted `scheduled_change` means "unknown" rather than "none". `account_specific` — rates exist but are set per trading account and require your own venue credentials (SX Bet's `GET /user/fees-v3`, Hyperliquid's `POST /info {"type":"userFees"}`). `unpublished` — the venue publishes no fee model for this market at all. `unavailable` — our own bounded parameter fetch failed or timed out; identity and pricing are still served. Same contract as `pricing.availability`. */
|
|
2
|
+
export declare const MarketDetailTradingFeesAvailability: {
|
|
3
|
+
readonly Published: "published";
|
|
4
|
+
readonly Partial: "partial";
|
|
5
|
+
readonly AccountSpecific: "account_specific";
|
|
6
|
+
readonly Unpublished: "unpublished";
|
|
7
|
+
readonly Unavailable: "unavailable";
|
|
8
|
+
};
|
|
9
|
+
export type MarketDetailTradingFeesAvailability = (typeof MarketDetailTradingFeesAvailability)[keyof typeof MarketDetailTradingFeesAvailability];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** `published` — the full parameter set for this market is known. `partial` — fees may be charged here but a parameter is missing or uninterpretable upstream; the legs carry what is known and null the rest, never a guess. It also covers the case where the parameters in force are known but the venue's pending-change list was unreadable, so an omitted `scheduled_change` means "unknown" rather than "none". `account_specific` — rates exist but are set per trading account and require your own venue credentials (SX Bet's `GET /user/fees-v3`, Hyperliquid's `POST /info {"type":"userFees"}`). `unpublished` — the venue publishes no fee model for this market at all. `unavailable` — our own bounded parameter fetch failed or timed out; identity and pricing are still served. Same contract as `pricing.availability`. */
|
|
3
|
+
export const MarketDetailTradingFeesAvailability = {
|
|
4
|
+
Published: "published",
|
|
5
|
+
Partial: "partial",
|
|
6
|
+
AccountSpecific: "account_specific",
|
|
7
|
+
Unpublished: "unpublished",
|
|
8
|
+
Unavailable: "unavailable",
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the fee is assessed on. `fill` — assessed when the order fills, from the traded share count and the fill price. `settlement_profit` — assessed at settlement, on profit (total return − stake), and only on a position that WON; a loss or a void is never charged.
|
|
3
|
+
*
|
|
4
|
+
* Read this before comparing rates across venues. SX Bet charges on winning profit at settlement, so its fee is an expected-value haircut rather than an entry cost — a consumer that models it as a percentage of notional is wrong about the shape before it is wrong about the rate. The reported basis is the one that applies to trading: SX Bet's four payout fees. Its separate `refundFee` is charged at fill time on the capital-efficiency refund rather than on profit, and is out of scope here along with its rates.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MarketDetailTradingFeesChargeBasis: {
|
|
7
|
+
readonly Fill: "fill";
|
|
8
|
+
readonly SettlementProfit: "settlement_profit";
|
|
9
|
+
};
|
|
10
|
+
export type MarketDetailTradingFeesChargeBasis = (typeof MarketDetailTradingFeesChargeBasis)[keyof typeof MarketDetailTradingFeesChargeBasis];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/**
|
|
3
|
+
* What the fee is assessed on. `fill` — assessed when the order fills, from the traded share count and the fill price. `settlement_profit` — assessed at settlement, on profit (total return − stake), and only on a position that WON; a loss or a void is never charged.
|
|
4
|
+
*
|
|
5
|
+
* Read this before comparing rates across venues. SX Bet charges on winning profit at settlement, so its fee is an expected-value haircut rather than an entry cost — a consumer that models it as a percentage of notional is wrong about the shape before it is wrong about the rate. The reported basis is the one that applies to trading: SX Bet's four payout fees. Its separate `refundFee` is charged at fill time on the capital-efficiency refund rather than on profit, and is out of scope here along with its rates.
|
|
6
|
+
*/
|
|
7
|
+
export const MarketDetailTradingFeesChargeBasis = {
|
|
8
|
+
Fill: "fill",
|
|
9
|
+
SettlementProfit: "settlement_profit",
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Where the parameters came from, so a latency-sensitive consumer knows which platforms cost extra hops. `market_record` — embedded in the same market record the identity fetch already returned (Polymarket `feeSchedule`, Predict `feeRateBps`, AlphaArcade `feeBasePercent`); zero extra fetches. `series_record` — the parameters live on parent records and cost up to three small, TTL-cached hops (Kalshi: the event record for its series ticker and any fee override in force, the series for the base `fee_type`/`fee_multiplier` that override supersedes, then the event's pending fee changes for `scheduled_change`). `venue_schedule` — the venue exposes no per-market parameter and the answer comes from its published schedule (SX Bet, Hyperliquid). */
|
|
2
|
+
export declare const MarketDetailTradingFeesSource: {
|
|
3
|
+
readonly MarketRecord: "market_record";
|
|
4
|
+
readonly SeriesRecord: "series_record";
|
|
5
|
+
readonly VenueSchedule: "venue_schedule";
|
|
6
|
+
};
|
|
7
|
+
export type MarketDetailTradingFeesSource = (typeof MarketDetailTradingFeesSource)[keyof typeof MarketDetailTradingFeesSource];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Where the parameters came from, so a latency-sensitive consumer knows which platforms cost extra hops. `market_record` — embedded in the same market record the identity fetch already returned (Polymarket `feeSchedule`, Predict `feeRateBps`, AlphaArcade `feeBasePercent`); zero extra fetches. `series_record` — the parameters live on parent records and cost up to three small, TTL-cached hops (Kalshi: the event record for its series ticker and any fee override in force, the series for the base `fee_type`/`fee_multiplier` that override supersedes, then the event's pending fee changes for `scheduled_change`). `venue_schedule` — the venue exposes no per-market parameter and the answer comes from its published schedule (SX Bet, Hyperliquid). */
|
|
3
|
+
export const MarketDetailTradingFeesSource = {
|
|
4
|
+
MarketRecord: "market_record",
|
|
5
|
+
SeriesRecord: "series_record",
|
|
6
|
+
VenueSchedule: "venue_schedule",
|
|
7
|
+
};
|
|
@@ -2,6 +2,8 @@ import type * as PredictorSDK from "../index.js";
|
|
|
2
2
|
export interface MarketsListResponse {
|
|
3
3
|
/** Array of markets for the current page. */
|
|
4
4
|
data: PredictorSDK.UnifiedMarket[];
|
|
5
|
+
/** Freshness of the catalog snapshot this page was served from. Describes the DATA; `pagination` describes the page. */
|
|
6
|
+
snapshot: PredictorSDK.MarketsSnapshot;
|
|
5
7
|
/** Pagination metadata for the current page. */
|
|
6
8
|
pagination: PredictorSDK.PaginationBlock;
|
|
7
9
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Freshness of the immutable catalog snapshot a `GET /v1/markets` page was served from. This endpoint reads a stored snapshot rather than calling the venues, so the age of the rows is not the age of the request.
|
|
3
|
+
*/
|
|
4
|
+
export interface MarketsSnapshot {
|
|
5
|
+
/**
|
|
6
|
+
* When PredictorSDK finished reading the OLDEST provider catalog contributing rows to this response — a conservative freshness floor for the whole page, in millisecond-precision ISO 8601.
|
|
7
|
+
*
|
|
8
|
+
* `observed_at` is a PredictorSDK read time, the same meaning it carries on `pricing.observed_at` and `trading_fees.observed_at`. The difference is WHICH read: those two stamp the upstream call this request made, while this one stamps the background ingestion crawl that built the snapshot, so it is normally minutes to hours old rather than milliseconds. It is not `as_of` because no venue published it.
|
|
9
|
+
*
|
|
10
|
+
* **It is a floor, not a single fact.** Providers are crawled on independent schedules, so the catalog is a merge of snapshots of different ages and one of them is the stalest. Narrow the response with `?provider=` to get that provider's own read time exactly — under a filter this field describes only the selected provider, the same way `pagination.total` does.
|
|
11
|
+
*
|
|
12
|
+
* Stable for an entire cursor traversal: a cursor stays bound to the snapshot that issued it, so every page of one traversal reports the identical value even while newer snapshots are published.
|
|
13
|
+
*
|
|
14
|
+
* `null` when the bound snapshot carries no read time. An unstamped provider makes the whole value null rather than being skipped, because reporting a newer floor than the data supports would let stale rows through a correct freshness bound.
|
|
15
|
+
*/
|
|
16
|
+
observedAt: Date | null;
|
|
17
|
+
}
|
|
@@ -13,6 +13,6 @@ export interface PlatformMarket {
|
|
|
13
13
|
tokenIds?: string[];
|
|
14
14
|
/** Source market ID. Present for platforms other than Kalshi and Polymarket. */
|
|
15
15
|
marketId?: string;
|
|
16
|
-
/** Source outcome IDs. Present for platforms that use outcome IDs. */
|
|
16
|
+
/** Source outcome IDs for the market named by `market_id`, sorted and de-duplicated. These are the same values `GET /v1/markets/{market_id}` returns as `outcomes[].outcome_id`, so they join directly. SX Bet's are `outcomeOne`/`outcomeTwo` — market-scoped, because SX Bet publishes no per-outcome token; read them together with `market_id`. Present for platforms that use outcome IDs. */
|
|
17
17
|
outcomeIds?: string[];
|
|
18
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type * as PredictorSDK from "../index.js";
|
|
2
2
|
export interface UnifiedMarket {
|
|
3
|
-
/** Composite market identifier in the format `{provider}:{provider_id}` (e.g. `kalshi:
|
|
3
|
+
/** Composite market identifier in the format `{provider}:{provider_id}` (e.g. `kalshi:AMAZONFTC-29DEC31`). */
|
|
4
4
|
id: string;
|
|
5
5
|
/** Prediction market provider. */
|
|
6
6
|
provider: PredictorSDK.UnifiedMarketProvider;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./AmbiguousIdentifierError.js";
|
|
1
2
|
export * from "./CanonicalSportsEvent.js";
|
|
2
3
|
export * from "./CanonicalSportsOutcome.js";
|
|
3
4
|
export * from "./CanonicalSportsParticipant.js";
|
|
@@ -18,16 +19,28 @@ export * from "./EventResponse.js";
|
|
|
18
19
|
export * from "./EventResponsePlatform.js";
|
|
19
20
|
export * from "./GetEventRequestPlatform.js";
|
|
20
21
|
export * from "./GetMarketRequestPlatform.js";
|
|
22
|
+
export * from "./GetMarketsRequestProvider.js";
|
|
21
23
|
export * from "./MarketCategory.js";
|
|
24
|
+
export * from "./MarketDetailFeeLeg.js";
|
|
25
|
+
export * from "./MarketDetailFeeLegModel.js";
|
|
26
|
+
export * from "./MarketDetailFeeRounding.js";
|
|
27
|
+
export * from "./MarketDetailFeeRoundingDirection.js";
|
|
22
28
|
export * from "./MarketDetailOutcome.js";
|
|
23
29
|
export * from "./MarketDetailPricing.js";
|
|
30
|
+
export * from "./MarketDetailPricingAsOfKind.js";
|
|
24
31
|
export * from "./MarketDetailPricingAvailability.js";
|
|
25
32
|
export * from "./MarketDetailPricingScale.js";
|
|
26
33
|
export * from "./MarketDetailPricingSource.js";
|
|
27
34
|
export * from "./MarketDetailResponse.js";
|
|
28
35
|
export * from "./MarketDetailResponseProvider.js";
|
|
29
36
|
export * from "./MarketDetailResponseStatus.js";
|
|
37
|
+
export * from "./MarketDetailScheduledFeeChange.js";
|
|
38
|
+
export * from "./MarketDetailTradingFees.js";
|
|
39
|
+
export * from "./MarketDetailTradingFeesAvailability.js";
|
|
40
|
+
export * from "./MarketDetailTradingFeesChargeBasis.js";
|
|
41
|
+
export * from "./MarketDetailTradingFeesSource.js";
|
|
30
42
|
export * from "./MarketsListResponse.js";
|
|
43
|
+
export * from "./MarketsSnapshot.js";
|
|
31
44
|
export * from "./PaginationBlock.js";
|
|
32
45
|
export * from "./PaymentRequiredErrorAction.js";
|
|
33
46
|
export * from "./PaymentRequiredErrorBody.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./AmbiguousIdentifierError.js";
|
|
1
2
|
export * from "./CanonicalSportsEvent.js";
|
|
2
3
|
export * from "./CanonicalSportsOutcome.js";
|
|
3
4
|
export * from "./CanonicalSportsParticipant.js";
|
|
@@ -18,16 +19,28 @@ export * from "./EventResponse.js";
|
|
|
18
19
|
export * from "./EventResponsePlatform.js";
|
|
19
20
|
export * from "./GetEventRequestPlatform.js";
|
|
20
21
|
export * from "./GetMarketRequestPlatform.js";
|
|
22
|
+
export * from "./GetMarketsRequestProvider.js";
|
|
21
23
|
export * from "./MarketCategory.js";
|
|
24
|
+
export * from "./MarketDetailFeeLeg.js";
|
|
25
|
+
export * from "./MarketDetailFeeLegModel.js";
|
|
26
|
+
export * from "./MarketDetailFeeRounding.js";
|
|
27
|
+
export * from "./MarketDetailFeeRoundingDirection.js";
|
|
22
28
|
export * from "./MarketDetailOutcome.js";
|
|
23
29
|
export * from "./MarketDetailPricing.js";
|
|
30
|
+
export * from "./MarketDetailPricingAsOfKind.js";
|
|
24
31
|
export * from "./MarketDetailPricingAvailability.js";
|
|
25
32
|
export * from "./MarketDetailPricingScale.js";
|
|
26
33
|
export * from "./MarketDetailPricingSource.js";
|
|
27
34
|
export * from "./MarketDetailResponse.js";
|
|
28
35
|
export * from "./MarketDetailResponseProvider.js";
|
|
29
36
|
export * from "./MarketDetailResponseStatus.js";
|
|
37
|
+
export * from "./MarketDetailScheduledFeeChange.js";
|
|
38
|
+
export * from "./MarketDetailTradingFees.js";
|
|
39
|
+
export * from "./MarketDetailTradingFeesAvailability.js";
|
|
40
|
+
export * from "./MarketDetailTradingFeesChargeBasis.js";
|
|
41
|
+
export * from "./MarketDetailTradingFeesSource.js";
|
|
30
42
|
export * from "./MarketsListResponse.js";
|
|
43
|
+
export * from "./MarketsSnapshot.js";
|
|
31
44
|
export * from "./PaginationBlock.js";
|
|
32
45
|
export * from "./PaymentRequiredErrorAction.js";
|
|
33
46
|
export * from "./PaymentRequiredErrorBody.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const AmbiguousIdentifierError: core.serialization.ObjectSchema<serializers.AmbiguousIdentifierError.Raw, PredictorSDK.AmbiguousIdentifierError>;
|
|
5
|
+
export declare namespace AmbiguousIdentifierError {
|
|
6
|
+
interface Raw {
|
|
7
|
+
error: string;
|
|
8
|
+
message?: string | null;
|
|
9
|
+
candidates: string[];
|
|
10
|
+
status_code: number;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
export const AmbiguousIdentifierError = core.serialization.object({
|
|
4
|
+
error: core.serialization.string(),
|
|
5
|
+
message: core.serialization.string().optional(),
|
|
6
|
+
candidates: core.serialization.list(core.serialization.string()),
|
|
7
|
+
statusCode: core.serialization.property("status_code", core.serialization.number()),
|
|
8
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const GetMarketsRequestProvider: core.serialization.Schema<serializers.GetMarketsRequestProvider.Raw, PredictorSDK.GetMarketsRequestProvider>;
|
|
5
|
+
export declare namespace GetMarketsRequestProvider {
|
|
6
|
+
type Raw = "kalshi" | "polymarket" | "predict" | "sxbet" | "hyperliquid" | "alpha-arcade";
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as PredictorSDK from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
import { MarketDetailFeeLegModel } from "./MarketDetailFeeLegModel.js";
|
|
5
|
+
import { MarketDetailFeeRounding } from "./MarketDetailFeeRounding.js";
|
|
6
|
+
export declare const MarketDetailFeeLeg: core.serialization.ObjectSchema<serializers.MarketDetailFeeLeg.Raw, PredictorSDK.MarketDetailFeeLeg>;
|
|
7
|
+
export declare namespace MarketDetailFeeLeg {
|
|
8
|
+
interface Raw {
|
|
9
|
+
model: MarketDetailFeeLegModel.Raw;
|
|
10
|
+
rate?: number | null;
|
|
11
|
+
exponent?: number | null;
|
|
12
|
+
rounding?: MarketDetailFeeRounding.Raw | null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import { MarketDetailFeeLegModel } from "./MarketDetailFeeLegModel.js";
|
|
4
|
+
import { MarketDetailFeeRounding } from "./MarketDetailFeeRounding.js";
|
|
5
|
+
export const MarketDetailFeeLeg = core.serialization.object({
|
|
6
|
+
model: MarketDetailFeeLegModel,
|
|
7
|
+
rate: core.serialization.number().nullable(),
|
|
8
|
+
exponent: core.serialization.number().nullable(),
|
|
9
|
+
rounding: MarketDetailFeeRounding.nullable(),
|
|
10
|
+
});
|