@agg-build/sdk 4.25.0 → 4.26.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.
@@ -388,6 +388,18 @@ type DiagnosticEvent = {
388
388
  } | {
389
389
  type: "stale_connection";
390
390
  lastMessageAge: number;
391
+ } | {
392
+ type: "book_watchdog_resync";
393
+ outcomeId: string;
394
+ /** null when there is no local book (its snapshot never arrived). */
395
+ localSeq: number | null;
396
+ serverSeq: number;
397
+ action: "resnapshot" | "resubscribe";
398
+ }
399
+ /** `status` is null when the REST check failed before a response (network error or timeout). */
400
+ | {
401
+ type: "book_watchdog_error";
402
+ status: number | null;
391
403
  };
392
404
  type DiagnosticCallback = (event: DiagnosticEvent) => void;
393
405
 
@@ -1054,6 +1066,12 @@ type GetPositionsQuery = {
1054
1066
  cursor?: string | undefined;
1055
1067
  limit?: number | undefined;
1056
1068
  status?: "active" | "closed" | undefined;
1069
+ venueEventId?: string | undefined;
1070
+ venueMarketId?: string | undefined;
1071
+ /** Only positions on events in any of these categories (a league is a category). At most 20. */
1072
+ categoryIds?: string[] | undefined;
1073
+ /** `realizedPnl`: highest realized P&L first. Live positions only. */
1074
+ sort?: "realizedPnl" | undefined;
1057
1075
  };
1058
1076
  type OrderListItem = {
1059
1077
  status: string;
@@ -1205,6 +1223,8 @@ type PositionGroup = {
1205
1223
  currentPrice: number;
1206
1224
  totalValue: number;
1207
1225
  unrealizedPnlPercent: number;
1226
+ /** Realized P&L across the legs (sells + settlement), before fees. USD. */
1227
+ realizedPnl: number;
1208
1228
  priceSource: PriceSource;
1209
1229
  bookQuality: BookQuality;
1210
1230
  }[];
@@ -2110,12 +2130,24 @@ interface RequestedOrderbookMarket {
2110
2130
  venue: string;
2111
2131
  marketStatus: "open" | "closed" | "resolved" | "unopened" | "paused";
2112
2132
  tickSize: number | null;
2133
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
2134
+ * Absent means a 1-unit step. */
2135
+ sizeStepRaw?: string;
2136
+ /** Smallest limit-order size on this market, raw 6-dec shares.
2137
+ * Absent means no known minimum. */
2138
+ minSizeRaw?: string;
2113
2139
  endDate: string | null;
2114
2140
  resolutionDate: string | null;
2115
2141
  }
2116
2142
  interface MatchedOrderbookMarket extends VenueMarketRef {
2117
2143
  marketStatus: "open" | "closed" | "resolved" | "unopened" | "paused";
2118
2144
  tickSize: number | null;
2145
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
2146
+ * Absent means a 1-unit step. */
2147
+ sizeStepRaw?: string;
2148
+ /** Smallest limit-order size on this market, raw 6-dec shares.
2149
+ * Absent means no known minimum. */
2150
+ minSizeRaw?: string;
2119
2151
  hasOrderbook: boolean;
2120
2152
  /**
2121
2153
  * Hyperliquid HIP-4 deployer namespace this member belongs to (e.g. "ap").
@@ -2374,6 +2406,12 @@ interface RecurringCryptoMarketsResponse {
2374
2406
  interface VenueOrderbookEntry {
2375
2407
  venueMarketId: string;
2376
2408
  tickSize: number | null;
2409
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
2410
+ * Absent means a 1-unit step. */
2411
+ sizeStepRaw?: string;
2412
+ /** Smallest limit-order size on this market, raw 6-dec shares.
2413
+ * Absent means no known minimum. */
2414
+ minSizeRaw?: string;
2377
2415
  orderbook: Orderbook;
2378
2416
  /**
2379
2417
  * Sticky tick of this venue's book inferred at runtime by the engine. May
@@ -2996,6 +3034,8 @@ interface GetPositionsParams {
2996
3034
  limit?: number;
2997
3035
  status?: "active" | "closed";
2998
3036
  mode?: ExecutionMode;
3037
+ categoryIds?: string[];
3038
+ sort?: "realizedPnl";
2999
3039
  }
3000
3040
  interface GetOrdersParams {
3001
3041
  status?: string;
@@ -3385,15 +3425,30 @@ interface UserActivityQuery {
3385
3425
  /** Column a leaderboard is ranked by. */
3386
3426
  type LeaderboardMetric = "realizedPnl" | "volume";
3387
3427
  interface LeaderboardQuery {
3388
- /** Inclusive UTC calendar day, `YYYY-MM-DD`. Omit both for all time. */
3428
+ /** Inclusive UTC day `YYYY-MM-DD`. Omit both `from` and `to` for all time. */
3389
3429
  from?: string;
3390
- /** Inclusive UTC calendar day, `YYYY-MM-DD`. */
3391
3430
  to?: string;
3392
- /** Default `realizedPnl`. */
3393
3431
  metric?: LeaderboardMetric;
3394
3432
  /** 1..100, default 50. */
3395
3433
  limit?: number;
3396
3434
  cursor?: string;
3435
+ /** Look up one user (at most one of these four). */
3436
+ userId?: string;
3437
+ externalId?: string;
3438
+ /** Only when the app's `leaderboardIdentity` is `profile`. */
3439
+ username?: string;
3440
+ /** Not when the app's `leaderboardIdentity` is `anonymous`. */
3441
+ walletAddress?: string;
3442
+ /** One `Category.id` (a league is a category); includes sub-categories. At most 1. */
3443
+ categoryIds?: string[];
3444
+ /** Up to 5 event ids, each merged across venues. All time only; not with `categoryIds`. */
3445
+ venueEventIds?: string[];
3446
+ /**
3447
+ * Up to 100 AGG user ids; unpaginated. Not with the single-user lookups or `cursor`.
3448
+ * Returns rows only for users that have stats: a requested user with no activity is
3449
+ * simply absent (the single-user lookups return a zero row instead).
3450
+ */
3451
+ userIds?: string[];
3397
3452
  }
3398
3453
  interface LeaderboardRow {
3399
3454
  /** Exact within the top 100, `null` beyond. */
@@ -3413,8 +3468,14 @@ interface LeaderboardRow {
3413
3468
  spent: number;
3414
3469
  /** Gross realized P&L in USD (sells + settlements, before fees). */
3415
3470
  realizedPnl: number;
3416
- }
3417
- /** Exactly one of `userId`, `externalId`, `username`, `walletAddress` is required. */
3471
+ /** Settled position legs whose settlement booked a profit. */
3472
+ wins: number;
3473
+ /** Settled position legs whose settlement booked a loss. A zero settlement (void, refund) is neither. */
3474
+ losses: number;
3475
+ /** wins / (wins + losses), 0 to 1; `null` before any settlement. */
3476
+ winRate: number | null;
3477
+ }
3478
+ /** At most one of `userId`, `externalId`, `username`, `walletAddress`; none = the whole app. */
3418
3479
  interface LeaderboardSeriesQuery {
3419
3480
  /** Inclusive UTC calendar day, `YYYY-MM-DD`. Default: 29 days before `to`. */
3420
3481
  from?: string;
@@ -3426,25 +3487,33 @@ interface LeaderboardSeriesQuery {
3426
3487
  username?: string;
3427
3488
  /** Not when the app's `leaderboardIdentity` is `anonymous`. */
3428
3489
  walletAddress?: string;
3490
+ /** One `Category.id`. At most 1. */
3491
+ categoryIds?: string[];
3429
3492
  }
3430
- interface LeaderboardSeriesPoint {
3431
- /** UTC calendar day, `YYYY-MM-DD`. */
3432
- day: string;
3433
- /** Filled orders on this day. */
3493
+ interface LeaderboardStats {
3434
3494
  orders: number;
3435
- /** USD notional of every filled order on this day, buys and sells. */
3436
3495
  volume: number;
3437
- /** USD notional of filled buy orders only. */
3438
3496
  spent: number;
3439
- /** Gross realized P&L in USD booked this day (sells + settlements, before fees). */
3440
3497
  realizedPnl: number;
3498
+ wins: number;
3499
+ losses: number;
3500
+ winRate: number | null;
3501
+ }
3502
+ interface LeaderboardSeriesPoint extends LeaderboardStats {
3503
+ /** UTC calendar day, `YYYY-MM-DD`. */
3504
+ day: string;
3441
3505
  /** Running total of `realizedPnl` from `from` through this day. */
3442
3506
  cumulativeRealizedPnl: number;
3507
+ /** Win rate over `from` through this day; `null` until a position settles. */
3508
+ cumulativeWinRate: number | null;
3443
3509
  }
3444
3510
  interface LeaderboardSeries {
3445
- userId: string;
3511
+ /** `null` for an app-wide series (no user given). */
3512
+ userId: string | null;
3446
3513
  from: string;
3447
3514
  to: string;
3515
+ /** Sums over `[from, to]`. */
3516
+ totals: LeaderboardStats;
3448
3517
  /** One point per day in `[from, to]`, oldest first; days without activity are 0. */
3449
3518
  points: LeaderboardSeriesPoint[];
3450
3519
  }
@@ -3827,6 +3896,12 @@ interface SmartRouteResponse {
3827
3896
  * `slippage.slippageBps` to flag thin liquidity.
3828
3897
  */
3829
3898
  slippage?: SmartRouteSlippage;
3899
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
3900
+ * Only on a single-venue quote; absent means a 1-unit step. */
3901
+ sizeStepRaw?: string;
3902
+ /** Smallest limit-order size on this venue/market, raw 6-dec shares.
3903
+ * Only on a single-venue quote; absent means no known minimum. */
3904
+ minSizeRaw?: string;
3830
3905
  /** Estimated payout if the outcome wins (= totalFilled shares × $1, less
3831
3906
  * settlement fees — see `fills[].settlementFee`). */
3832
3907
  estimatedPayout?: number;
@@ -3835,6 +3910,9 @@ interface SmartRouteResponse {
3835
3910
  * into this number and `estimatedProfit` / `returnPct` are recomputed
3836
3911
  * against it. */
3837
3912
  totalCostIncFees?: number;
3913
+ /** Sell only: gross proceeds minus venue, builder, app, and user-paid
3914
+ * referral fees, in USD — what the sell returns. */
3915
+ estimatedNetProceeds?: number;
3838
3916
  /** Estimated profit if the outcome wins (= estimatedPayout − totalCostIncFees). */
3839
3917
  estimatedProfit?: number;
3840
3918
  /** Return on investment percentage (= estimatedProfit / totalCostIncFees × 100). */
@@ -4333,6 +4411,20 @@ interface AggWebSocketDiagnostics {
4333
4411
  bridgeListeners?: number;
4334
4412
  host?: Record<string, unknown>;
4335
4413
  }
4414
+ /**
4415
+ * Per-outcome staleness check against REST. Plain data (no functions) so it
4416
+ * can be passed into the market-data Worker.
4417
+ */
4418
+ interface BookWatchdogOptions {
4419
+ /** REST API base URL, e.g. `https://api.agg.market`. */
4420
+ baseUrl: string;
4421
+ /** Headers for `GET /orderbooks/outcomes` (`x-app-id`, optional `x-app-api-key`). */
4422
+ headers?: Record<string, string>;
4423
+ /** A book with no update for this long is checked. Default 5 minutes. */
4424
+ silenceMs?: number;
4425
+ /** How often silent books are looked for. Default 1 minute. */
4426
+ checkIntervalMs?: number;
4427
+ }
4336
4428
  interface AggWebSocketOptions {
4337
4429
  /** Full WebSocket URL including query params (appId). Token should NOT be in the URL. */
4338
4430
  url: string;
@@ -4343,6 +4435,8 @@ interface AggWebSocketOptions {
4343
4435
  enableLogs?: boolean;
4344
4436
  /** Engine-only: read immutable books through getBook at presentation cadence. */
4345
4437
  deferBookViews?: boolean;
4438
+ /** Check silent books against REST and heal any that drifted. Off when omitted. */
4439
+ bookWatchdog?: BookWatchdogOptions;
4346
4440
  }
4347
4441
  /**
4348
4442
  * Agg WebSocket client. Single WS connection with refcounted market subscriptions.
@@ -4370,6 +4464,19 @@ declare class AggWebSocket {
4370
4464
  private readonly deferBookViews;
4371
4465
  /** Markets currently resyncing (awaiting snapshot after seq gap / checksum mismatch). */
4372
4466
  private readonly resyncing;
4467
+ private readonly bookWatchdog?;
4468
+ /**
4469
+ * Per subscribed orderbook outcome: last time it made progress (subscribe,
4470
+ * snapshot, applied delta) or was checked against REST (ms). Tracked from
4471
+ * subscribe, not from the first snapshot, so a book that never arrives or
4472
+ * is stuck resyncing is still found by the watchdog.
4473
+ */
4474
+ private readonly bookCheckedAt;
4475
+ /** Outcomes the watchdog already resnapshotted; a repeat mismatch resubscribes. */
4476
+ private readonly watchdogResnapshotted;
4477
+ private watchdogTimer;
4478
+ private watchdogAbort;
4479
+ private watchdogPausedUntil;
4373
4480
  private connecting;
4374
4481
  private _connected;
4375
4482
  private reconnectAttempts;
@@ -4457,6 +4564,18 @@ declare class AggWebSocket {
4457
4564
  private handleOrderSubmitted;
4458
4565
  private handleBalanceUpdate;
4459
4566
  private handleRedeemEvent;
4567
+ /**
4568
+ * Heartbeats prove the socket, not each stream. Every subscribed outcome
4569
+ * with no progress for `silenceMs` is checked against the REST `seq`:
4570
+ *
4571
+ * - book present, not resyncing, same `seq` → the market is just quiet;
4572
+ * - different `seq`, no book (snapshot never arrived, or a resubscribe's
4573
+ * snapshot was lost), or stuck resyncing (any recovery whose snapshot
4574
+ * was lost) → resnapshot, then resubscribe on the next overdue check;
4575
+ * - REST can't serve it (`null`) → counted as an attempt, so the next
4576
+ * batch moves on to other outcomes instead of retrying the same 100.
4577
+ */
4578
+ private checkSilentBooks;
4460
4579
  private requestResnapshot;
4461
4580
  /**
4462
4581
  * Schedule a microtask that flushes queued subscribe/unsubscribe frames.
@@ -4476,4 +4595,4 @@ declare class AggWebSocket {
4476
4595
  private isOrderbookDebugEnabled;
4477
4596
  }
4478
4597
 
4479
- export { type PaperTradingAppOptions as $, AggWebSocket as A, type ExecutionStatusQuery as B, type ChartBarsResponse as C, type ExecutionStatusResponse as D, type ExecutionOrdersQuery as E, type UserActivityQuery as F, type UserActivityItem as G, type LeaderboardRow as H, type LeaderboardSeriesQuery as I, type LeaderboardSeries as J, type ExecutionPositionsQuery as K, type LeaderboardQuery as L, MarketDataEngine as M, type ExecutionPositionGroup as N, type OrderbookState as O, type PaginatedResponse as P, type ManagedBalancesParams as Q, type UnifiedBalanceResponse as R, type SiweMessageParams as S, type TradeSplit as T, type UserProfile as U, Venue as V, type WsArbMarketUpdate as W, type UpsertVenueKey as X, type VenueKeySummary as Y, type VenueKeyStatus as Z, type CreatePaperTradingAccountParams as _, type AggWebSocketOptions as a, type WithdrawManagedResponse as a$, type PaperTradingAccount as a0, type PaperTradingAccountListParams as a1, type PaperTradingAccountsPage as a2, type SetPaperTradingBalanceParams as a3, type PaperTradingBalanceResponse as a4, type ResetPaperTradingAccountParams as a5, type PlacePaperTradingOrderParams as a6, type PaperTradingOrder as a7, type PaperTradingListParams as a8, type PaperTradingPositionsPage as a9, type SearchParams as aA, type SearchResponse as aB, type CorrelatedMarketsStatus as aC, type CorrelatedMarketSignalBatch as aD, type CorrelatedMarketQueryResult as aE, type CorrelatedMarketCascadeResponse as aF, type ResolveCorrelatedMarketsParams as aG, type ResolveCorrelatedMarketsResponse as aH, type ChartResolution as aI, type BatchOrderbooksResponse as aJ, type BatchMidpointsResponse as aK, type OutcomeOrderbookResponse as aL, type SmartRouteParams as aM, type SmartRouteResponse as aN, type ExecuteManagedParams as aO, type ExecuteManagedResponse as aP, type PlaceLimitOrderParams as aQ, type PlaceLimitOrderResponse as aR, type PlaceOrderParams as aS, type PlaceOrderResponse as aT, type RedeemRequest as aU, type RedeemResponse as aV, type BalanceRefillPolicy as aW, type CreateBalanceRefillPolicyParams as aX, type UpdateBalanceRefillPolicyParams as aY, type BalanceRefillAttempt as aZ, type WithdrawManagedParams as a_, type PaperTradingOrdersPage as aa, type PaperTradingPortfolio as ab, type CancelOrderSignature as ac, type CancelManagedExecutionResponse as ad, type CancelVenueOrderParams as ae, MatchStatus as af, MarketStatus as ag, type RecurrenceFilter as ah, type VenueEvent as ai, type EventBootstrapResponse as aj, type SportsLiveResponse as ak, type ListRecurringCryptoMarketsOptions as al, type RecurringCryptoMarketsResponse as am, type GetCryptoReferencePricesOptions as an, type CryptoReferencePricesResponse as ao, type Category as ap, type AppClientConfigResponse as aq, type VenueGeoPolicyResponse as ar, type RpcTokenResponse as as, type NewsFeedListResponse as at, type NewsFeedPageOptions as au, type NewsFeedArticleFeedResponse as av, type NewsFeedMarketFeedResponse as aw, type NewsFeedStatusResponse as ax, type NewsFeedMarketNewsParams as ay, type NewsFeedMarketNewsResponse as az, type ChartHistoryManifest as b, type DiagnosticEvent as b$, type WithdrawPreviewParams as b0, type WithdrawPreviewResponse as b1, type WithdrawalQuoteParams as b2, type WithdrawalQuoteResponse as b3, type SyncBalancesResponse as b4, type DepositAddressesResponse as b5, type GetPositionsParams as b6, type PositionGroup as b7, type RampQuoteRequest as b8, type RampQuote as b9, CONFIRMED_MATCH_STATUSES as bA, CandleBuilder as bB, type CandleInterval as bC, type CandleTail as bD, Chain as bE, type ChartBarsMeta as bF, type ChartVenueCandles as bG, type ComputeSplitsRequest as bH, type ComputeSplitsResponse as bI, type ComputeSplitsSelection as bJ, type CorrelatedMarketCascadeItem as bK, type CorrelatedMarketSide as bL, type CorrelatedMarketSignal as bM, type CorrelatedMarketSignalDirection as bN, type CreateApp as bO, type CryptoReferencePriceError as bP, type CryptoReferencePriceExternalMarketInput as bQ, type CryptoReferencePriceMarketInput as bR, type CryptoReferencePriceResult as bS, type CryptoReferencePriceSource as bT, type CryptoReferencePriceTarget as bU, type DepositAddressesPendingResponse as bV, type DepositAddressesReadyResponse as bW, type DepositAddressesSupportedChain as bX, type DepositAddressesToken as bY, type DepositStep as bZ, type DiagnosticCallback as b_, type RampSessionRequest as ba, type RampWidgetSession as bb, type Candle as bc, ACTIVE_VENUES as bd, type Account as be, AccountProvider as bf, AccountType as bg, type AggAuthDeliveryMode as bh, type AggAuthPrivyVerifyBody as bi, type AggAuthProviderType as bj, type AggAuthWalletVerifyBody as bk, type AggClientAuthOptions as bl, type AggSessionUser as bm, type AggregatedOrderbookLevel as bn, type AggregatedOrderbookResponse as bo, type App as bp, type AppTradingMode as bq, type AttributedOrderbook as br, type AttributedOrderbookLevel as bs, type AuthCodeResponse as bt, type AuthTokenResponse as bu, type AuthUser as bv, type BalanceCustody as bw, type BalanceRefillAttemptStatus as bx, type BalanceRefillPolicyStatus as by, type BookQuality as bz, type ChartCandle as c, type PersistedAuthSnapshot as c$, type ExecuteManagedRequest as c0, type ExecuteTradeRequest as c1, type ExecuteTradeResponse as c2, type ExecutionDagProgress as c3, type ExecutionDisplayGroupStatus as c4, type ExecutionDisplayStepKind as c5, type ExecutionMode as c6, type ExecutionOverallState as c7, type ExecutionStatusOrder as c8, type ExecutionStatusStep as c9, type NewsFeedLinkedMarket as cA, type NewsFeedMarketFeedArticle as cB, type NewsFeedMarketFeedItem as cC, type NewsFeedMarketNewsResult as cD, type NonceResponse as cE, type NovigExecutionMode as cF, OPTIONAL_SIGNATURE_TIMEOUT_MS as cG, type OrderListItem as cH, OrderStatus as cI, OrderType as cJ, type OrderbookBatchItemError as cK, type OrderbookBatchItemErrorCode as cL, type OrderbookBatchItemStatus as cM, type OrderbookHistoryPoint as cN, type OrderbookHistoryResponse as cO, type OrderbookLevel as cP, type OrderbookQuoteFill as cQ, type OrderbookQuoteParams as cR, type OrderbookQuoteResponse as cS, type OrderbookServiceUnavailableError as cT, type OrderbooksOnlyError as cU, type OutcomeMidpoint as cV, type OutcomeMidpointRow as cW, type PaperTradingBalanceAdjustment as cX, type PaperTradingLiquidityStatus as cY, type PaperTradingMarkSource as cZ, type PaperTradingPosition as c_, type GetBalanceQuery as ca, type GetBalanceResponse as cb, type GetHoldingsQuery as cc, type GetHoldingsResponse as cd, type GetOrdersParams as ce, type GetOrdersQuery as cf, type GetPositionsQuery as cg, type HelloResponse as ch, type HistoryRangeRequest as ci, INACTIVE_VENUES as cj, type LeaderboardMetric as ck, type LeaderboardSeriesPoint as cl, type LimitOrderTimeInForce as cm, type MarkSource as cn, type MarketPriceHistory as co, type MarketView as cp, type MarketViewBatch as cq, MatchType as cr, type MatchedMidpoint as cs, type MatchedMidpointOutcome as ct, type MatchedOrderbookMarket as cu, type MatchedVenueMarketOutcomeRef as cv, type MidpointItem as cw, type MidpointRow as cx, type NewsFeedArticleFeedItem as cy, type NewsFeedArticleWithSummary as cz, type AggWebSocketDiagnostics as d, type UserActivityUserOp as d$, type PositionRedeemStatus as d0, type PricePoint as d1, type PriceSource as d2, type PricesHistoryResponse as d3, type ProphetxExecutionMode as d4, RECURRENCE_CADENCES as d5, type RecurrenceCadence as d6, type RecurringCryptoComparisonPoint as d7, type RecurringCryptoComparisonPriceSource as d8, type RecurringCryptoDuration as d9, type SignatureRequest as dA, type SignatureRequestType as dB, type SignerFn as dC, type SimpleOrderbookLevel as dD, type SmartRouteAllocation as dE, type SmartRouteBridgeStep as dF, type SmartRouteFeeBreakdown as dG, type SmartRouteFill as dH, type SmartRouteSettlementLeg as dI, type SmartRouteSettlementPlan as dJ, type SmartRouteSetupCostLine as dK, type SmartRouteSide as dL, type SmartRouteStatus as dM, type SmartRouteVenueFill as dN, type SportsGameStatus as dO, type SportsLiveParticipant as dP, type SportsLiveState as dQ, TERMINAL_EXECUTION_STATES as dR, TimeInForce as dS, type TradeExecutorOrder as dT, type TradeStep as dU, type UserActivityBridge as dV, type UserActivityDeposit as dW, type UserActivityRedeem as dX, type UserActivityRedeemLeg as dY, type UserActivityTrade as dZ, type UserActivityType as d_, type RecurringCryptoDurationInput as da, type RecurringCryptoMarketMetrics as db, type RecurringCryptoOrderbookDepthLevel as dc, type RecurringCryptoOrderbookDepthSide as dd, type RecurringCryptoOutcome as de, type RecurringCryptoOutcomeOrderbookDepth as df, type RecurringCryptoPriceComparison as dg, type RecurringCryptoReferencePrice as dh, type RecurringCryptoResolution as di, type RecurringCryptoSourceConfidence as dj, type RecurringCryptoVenueMarket as dk, type RecurringCryptoWindowComparisons as dl, type RecurringCryptoWindowMarket as dm, type RedeemLegResult as dn, type RedeemLegStatus as dp, type RequestedOrderbookMarket as dq, type ResolvedCorrelatedMarketsResponse as dr, SELF_CUSTODY_FILL_TIMEOUT_MS as ds, SELF_CUSTODY_POLL_INTERVAL_MS as dt, type ServerWallet as du, type SettlementDiff as dv, type SettlementDifference as dw, type SettlementSource as dx, type SetupDepositAddressStep as dy, type SetupVenueKeyStep as dz, type WsArbFeedBatch as e, applyOrderbookDelta as e$, type UserActivityWithdrawal as e0, VENUES as e1, VENUE_CHAIN_IDS as e2, type ValidateBalanceOnClientStep as e3, type ValidateManagedParams as e4, type ValidateManagedRequest as e5, type ValidateManagedResponse as e6, type ValidateTradeRequest as e7, type ValidateTradeResponse as e8, type VenueEventListItem as e9, type WsAttributedLevel as eA, type WsAuthenticated as eB, type WsBalanceUpdate as eC, type WsCandleInterval as eD, type WsClientMessage as eE, type WsConnected as eF, type WsError as eG, type WsHeartbeat as eH, type WsMarkSource as eI, type WsMarketResolved as eJ, type WsOrderEvent as eK, type WsOrderEventType as eL, type WsOrderSubmitted as eM, type WsOrderbookDelta as eN, type WsOrderbookSnapshot as eO, type WsRedeemEvent as eP, type WsServerMessage as eQ, type WsSubscribed as eR, type WsTrade as eS, type WsUnsubscribed as eT, type WsVenueBook as eU, type WsVenueInfo as eV, type WsVenueLevel as eW, type WsWithdrawalLegStatus as eX, type WsWithdrawalLifecycleEvent as eY, type WsWithdrawalLifecycleLeg as eZ, type WsWithdrawalLifecycleStatus as e_, type VenueEventWithMarkets as ea, type VenueGeoPolicyEntry as eb, type VenueMarketListItem as ec, type VenueMarketRef as ed, type VenueOrderbookEntry as ee, type VenueOrderbookLevel as ef, type VenuePositionBalance as eg, type VenuePriceInfo as eh, type VenueSoloQuote as ei, type VerifyBody as ej, type VerifyResponse as ek, type WalletChainBalance as el, type WalletTokenBalance as em, type WithdrawManagedRequest as en, type WithdrawManagedSourceItem as eo, type WithdrawTokenSymbol as ep, type WithdrawalExpected as eq, type WithdrawalLeg as er, type WithdrawalLegStatus as es, type WithdrawalLegType as et, type WithdrawalLifecycleStatus as eu, type WithdrawalSource as ev, type WithdrawalSourceItem as ew, type WithdrawalSourceStatus as ex, type WithdrawalSourceTokenSymbol as ey, type WsArbFeedEntry as ez, type AggWebSocketCallbacks as f, computeChecksum as f0, getEffectiveDisabledVenues as f1, isVenueActive as f2, isVenueDataVisible as f3, isVenueInactive as f4, snapshotToOrderbook as f5, type VenueMarket as g, type VenueMarketOutcome as h, type Orderbook as i, TradeSide$1 as j, type AggClientOptions as k, type AggClientSessionInput as l, type AuthStatus as m, type SiwsMessageParams as n, type AggAuthVerifyBody as o, type AggAuthStartBody as p, type AggAuthStartResult as q, type AggLinkAccountBody as r, type AggLinkAccountResult as s, type AggLinkAccountWalletConfirmBody as t, type AggLinkAccountConfirmResult as u, type UpdateUserBody as v, type UserHolding as w, type OrderListQuery as x, type TradeExecutorOrderListResponse as y, type ExecutionOrderItem as z };
4598
+ export { type PaperTradingAppOptions as $, AggWebSocket as A, type ExecutionStatusQuery as B, type ChartBarsResponse as C, type ExecutionStatusResponse as D, type ExecutionOrdersQuery as E, type UserActivityQuery as F, type UserActivityItem as G, type LeaderboardRow as H, type LeaderboardSeriesQuery as I, type LeaderboardSeries as J, type ExecutionPositionsQuery as K, type LeaderboardQuery as L, MarketDataEngine as M, type ExecutionPositionGroup as N, type OrderbookState as O, type PaginatedResponse as P, type ManagedBalancesParams as Q, type UnifiedBalanceResponse as R, type SiweMessageParams as S, type TradeSplit as T, type UserProfile as U, Venue as V, type WsArbMarketUpdate as W, type UpsertVenueKey as X, type VenueKeySummary as Y, type VenueKeyStatus as Z, type CreatePaperTradingAccountParams as _, type AggWebSocketOptions as a, type WithdrawManagedParams as a$, type PaperTradingAccount as a0, type PaperTradingAccountListParams as a1, type PaperTradingAccountsPage as a2, type SetPaperTradingBalanceParams as a3, type PaperTradingBalanceResponse as a4, type ResetPaperTradingAccountParams as a5, type PlacePaperTradingOrderParams as a6, type PaperTradingOrder as a7, type PaperTradingListParams as a8, type PaperTradingPositionsPage as a9, type SearchParams as aA, type SearchResponse as aB, type CorrelatedMarketsStatus as aC, type CorrelatedMarketSignalBatch as aD, type CorrelatedMarketQueryResult as aE, type CorrelatedMarketCascadeResponse as aF, type ResolveCorrelatedMarketsParams as aG, type ResolveCorrelatedMarketsResponse as aH, type ChartResolution as aI, type BatchOrderbooksResponse as aJ, type BatchMidpointsResponse as aK, type OutcomeOrderbookResponse as aL, type SmartRouteParams as aM, type SmartRouteResponse as aN, type BookWatchdogOptions as aO, type ExecuteManagedParams as aP, type ExecuteManagedResponse as aQ, type PlaceLimitOrderParams as aR, type PlaceLimitOrderResponse as aS, type PlaceOrderParams as aT, type PlaceOrderResponse as aU, type RedeemRequest as aV, type RedeemResponse as aW, type BalanceRefillPolicy as aX, type CreateBalanceRefillPolicyParams as aY, type UpdateBalanceRefillPolicyParams as aZ, type BalanceRefillAttempt as a_, type PaperTradingOrdersPage as aa, type PaperTradingPortfolio as ab, type CancelOrderSignature as ac, type CancelManagedExecutionResponse as ad, type CancelVenueOrderParams as ae, MatchStatus as af, MarketStatus as ag, type RecurrenceFilter as ah, type VenueEvent as ai, type EventBootstrapResponse as aj, type SportsLiveResponse as ak, type ListRecurringCryptoMarketsOptions as al, type RecurringCryptoMarketsResponse as am, type GetCryptoReferencePricesOptions as an, type CryptoReferencePricesResponse as ao, type Category as ap, type AppClientConfigResponse as aq, type VenueGeoPolicyResponse as ar, type RpcTokenResponse as as, type NewsFeedListResponse as at, type NewsFeedPageOptions as au, type NewsFeedArticleFeedResponse as av, type NewsFeedMarketFeedResponse as aw, type NewsFeedStatusResponse as ax, type NewsFeedMarketNewsParams as ay, type NewsFeedMarketNewsResponse as az, type ChartHistoryManifest as b, type DiagnosticCallback as b$, type WithdrawManagedResponse as b0, type WithdrawPreviewParams as b1, type WithdrawPreviewResponse as b2, type WithdrawalQuoteParams as b3, type WithdrawalQuoteResponse as b4, type SyncBalancesResponse as b5, type DepositAddressesResponse as b6, type GetPositionsParams as b7, type PositionGroup as b8, type RampQuoteRequest as b9, type BookQuality as bA, CONFIRMED_MATCH_STATUSES as bB, CandleBuilder as bC, type CandleInterval as bD, type CandleTail as bE, Chain as bF, type ChartBarsMeta as bG, type ChartVenueCandles as bH, type ComputeSplitsRequest as bI, type ComputeSplitsResponse as bJ, type ComputeSplitsSelection as bK, type CorrelatedMarketCascadeItem as bL, type CorrelatedMarketSide as bM, type CorrelatedMarketSignal as bN, type CorrelatedMarketSignalDirection as bO, type CreateApp as bP, type CryptoReferencePriceError as bQ, type CryptoReferencePriceExternalMarketInput as bR, type CryptoReferencePriceMarketInput as bS, type CryptoReferencePriceResult as bT, type CryptoReferencePriceSource as bU, type CryptoReferencePriceTarget as bV, type DepositAddressesPendingResponse as bW, type DepositAddressesReadyResponse as bX, type DepositAddressesSupportedChain as bY, type DepositAddressesToken as bZ, type DepositStep as b_, type RampQuote as ba, type RampSessionRequest as bb, type RampWidgetSession as bc, type Candle as bd, ACTIVE_VENUES as be, type Account as bf, AccountProvider as bg, AccountType as bh, type AggAuthDeliveryMode as bi, type AggAuthPrivyVerifyBody as bj, type AggAuthProviderType as bk, type AggAuthWalletVerifyBody as bl, type AggClientAuthOptions as bm, type AggSessionUser as bn, type AggregatedOrderbookLevel as bo, type AggregatedOrderbookResponse as bp, type App as bq, type AppTradingMode as br, type AttributedOrderbook as bs, type AttributedOrderbookLevel as bt, type AuthCodeResponse as bu, type AuthTokenResponse as bv, type AuthUser as bw, type BalanceCustody as bx, type BalanceRefillAttemptStatus as by, type BalanceRefillPolicyStatus as bz, type ChartCandle as c, type PaperTradingMarkSource as c$, type DiagnosticEvent as c0, type ExecuteManagedRequest as c1, type ExecuteTradeRequest as c2, type ExecuteTradeResponse as c3, type ExecutionDagProgress as c4, type ExecutionDisplayGroupStatus as c5, type ExecutionDisplayStepKind as c6, type ExecutionMode as c7, type ExecutionOverallState as c8, type ExecutionStatusOrder as c9, type NewsFeedArticleFeedItem as cA, type NewsFeedArticleWithSummary as cB, type NewsFeedLinkedMarket as cC, type NewsFeedMarketFeedArticle as cD, type NewsFeedMarketFeedItem as cE, type NewsFeedMarketNewsResult as cF, type NonceResponse as cG, type NovigExecutionMode as cH, OPTIONAL_SIGNATURE_TIMEOUT_MS as cI, type OrderListItem as cJ, OrderStatus as cK, OrderType as cL, type OrderbookBatchItemError as cM, type OrderbookBatchItemErrorCode as cN, type OrderbookBatchItemStatus as cO, type OrderbookHistoryPoint as cP, type OrderbookHistoryResponse as cQ, type OrderbookLevel as cR, type OrderbookQuoteFill as cS, type OrderbookQuoteParams as cT, type OrderbookQuoteResponse as cU, type OrderbookServiceUnavailableError as cV, type OrderbooksOnlyError as cW, type OutcomeMidpoint as cX, type OutcomeMidpointRow as cY, type PaperTradingBalanceAdjustment as cZ, type PaperTradingLiquidityStatus as c_, type ExecutionStatusStep as ca, type GetBalanceQuery as cb, type GetBalanceResponse as cc, type GetHoldingsQuery as cd, type GetHoldingsResponse as ce, type GetOrdersParams as cf, type GetOrdersQuery as cg, type GetPositionsQuery as ch, type HelloResponse as ci, type HistoryRangeRequest as cj, INACTIVE_VENUES as ck, type LeaderboardMetric as cl, type LeaderboardSeriesPoint as cm, type LeaderboardStats as cn, type LimitOrderTimeInForce as co, type MarkSource as cp, type MarketPriceHistory as cq, type MarketView as cr, type MarketViewBatch as cs, MatchType as ct, type MatchedMidpoint as cu, type MatchedMidpointOutcome as cv, type MatchedOrderbookMarket as cw, type MatchedVenueMarketOutcomeRef as cx, type MidpointItem as cy, type MidpointRow as cz, type AggWebSocketDiagnostics as d, type UserActivityTrade as d$, type PaperTradingPosition as d0, type PersistedAuthSnapshot as d1, type PositionRedeemStatus as d2, type PricePoint as d3, type PriceSource as d4, type PricesHistoryResponse as d5, type ProphetxExecutionMode as d6, RECURRENCE_CADENCES as d7, type RecurrenceCadence as d8, type RecurringCryptoComparisonPoint as d9, type SetupDepositAddressStep as dA, type SetupVenueKeyStep as dB, type SignatureRequest as dC, type SignatureRequestType as dD, type SignerFn as dE, type SimpleOrderbookLevel as dF, type SmartRouteAllocation as dG, type SmartRouteBridgeStep as dH, type SmartRouteFeeBreakdown as dI, type SmartRouteFill as dJ, type SmartRouteSettlementLeg as dK, type SmartRouteSettlementPlan as dL, type SmartRouteSetupCostLine as dM, type SmartRouteSide as dN, type SmartRouteStatus as dO, type SmartRouteVenueFill as dP, type SportsGameStatus as dQ, type SportsLiveParticipant as dR, type SportsLiveState as dS, TERMINAL_EXECUTION_STATES as dT, TimeInForce as dU, type TradeExecutorOrder as dV, type TradeStep as dW, type UserActivityBridge as dX, type UserActivityDeposit as dY, type UserActivityRedeem as dZ, type UserActivityRedeemLeg as d_, type RecurringCryptoComparisonPriceSource as da, type RecurringCryptoDuration as db, type RecurringCryptoDurationInput as dc, type RecurringCryptoMarketMetrics as dd, type RecurringCryptoOrderbookDepthLevel as de, type RecurringCryptoOrderbookDepthSide as df, type RecurringCryptoOutcome as dg, type RecurringCryptoOutcomeOrderbookDepth as dh, type RecurringCryptoPriceComparison as di, type RecurringCryptoReferencePrice as dj, type RecurringCryptoResolution as dk, type RecurringCryptoSourceConfidence as dl, type RecurringCryptoVenueMarket as dm, type RecurringCryptoWindowComparisons as dn, type RecurringCryptoWindowMarket as dp, type RedeemLegResult as dq, type RedeemLegStatus as dr, type RequestedOrderbookMarket as ds, type ResolvedCorrelatedMarketsResponse as dt, SELF_CUSTODY_FILL_TIMEOUT_MS as du, SELF_CUSTODY_POLL_INTERVAL_MS as dv, type ServerWallet as dw, type SettlementDiff as dx, type SettlementDifference as dy, type SettlementSource as dz, type WsArbFeedBatch as e, type WsWithdrawalLifecycleLeg as e$, type UserActivityType as e0, type UserActivityUserOp as e1, type UserActivityWithdrawal as e2, VENUES as e3, VENUE_CHAIN_IDS as e4, type ValidateBalanceOnClientStep as e5, type ValidateManagedParams as e6, type ValidateManagedRequest as e7, type ValidateManagedResponse as e8, type ValidateTradeRequest as e9, type WithdrawalSourceTokenSymbol as eA, type WsArbFeedEntry as eB, type WsAttributedLevel as eC, type WsAuthenticated as eD, type WsBalanceUpdate as eE, type WsCandleInterval as eF, type WsClientMessage as eG, type WsConnected as eH, type WsError as eI, type WsHeartbeat as eJ, type WsMarkSource as eK, type WsMarketResolved as eL, type WsOrderEvent as eM, type WsOrderEventType as eN, type WsOrderSubmitted as eO, type WsOrderbookDelta as eP, type WsOrderbookSnapshot as eQ, type WsRedeemEvent as eR, type WsServerMessage as eS, type WsSubscribed as eT, type WsTrade as eU, type WsUnsubscribed as eV, type WsVenueBook as eW, type WsVenueInfo as eX, type WsVenueLevel as eY, type WsWithdrawalLegStatus as eZ, type WsWithdrawalLifecycleEvent as e_, type ValidateTradeResponse as ea, type VenueEventListItem as eb, type VenueEventWithMarkets as ec, type VenueGeoPolicyEntry as ed, type VenueMarketListItem as ee, type VenueMarketRef as ef, type VenueOrderbookEntry as eg, type VenueOrderbookLevel as eh, type VenuePositionBalance as ei, type VenuePriceInfo as ej, type VenueSoloQuote as ek, type VerifyBody as el, type VerifyResponse as em, type WalletChainBalance as en, type WalletTokenBalance as eo, type WithdrawManagedRequest as ep, type WithdrawManagedSourceItem as eq, type WithdrawTokenSymbol as er, type WithdrawalExpected as es, type WithdrawalLeg as et, type WithdrawalLegStatus as eu, type WithdrawalLegType as ev, type WithdrawalLifecycleStatus as ew, type WithdrawalSource as ex, type WithdrawalSourceItem as ey, type WithdrawalSourceStatus as ez, type AggWebSocketCallbacks as f, type WsWithdrawalLifecycleStatus as f0, applyOrderbookDelta as f1, computeChecksum as f2, getEffectiveDisabledVenues as f3, isVenueActive as f4, isVenueDataVisible as f5, isVenueInactive as f6, snapshotToOrderbook as f7, type VenueMarket as g, type VenueMarketOutcome as h, type Orderbook as i, TradeSide$1 as j, type AggClientOptions as k, type AggClientSessionInput as l, type AuthStatus as m, type SiwsMessageParams as n, type AggAuthVerifyBody as o, type AggAuthStartBody as p, type AggAuthStartResult as q, type AggLinkAccountBody as r, type AggLinkAccountResult as s, type AggLinkAccountWalletConfirmBody as t, type AggLinkAccountConfirmResult as u, type UpdateUserBody as v, type UserHolding as w, type OrderListQuery as x, type TradeExecutorOrderListResponse as y, type ExecutionOrderItem as z };
@@ -388,6 +388,18 @@ type DiagnosticEvent = {
388
388
  } | {
389
389
  type: "stale_connection";
390
390
  lastMessageAge: number;
391
+ } | {
392
+ type: "book_watchdog_resync";
393
+ outcomeId: string;
394
+ /** null when there is no local book (its snapshot never arrived). */
395
+ localSeq: number | null;
396
+ serverSeq: number;
397
+ action: "resnapshot" | "resubscribe";
398
+ }
399
+ /** `status` is null when the REST check failed before a response (network error or timeout). */
400
+ | {
401
+ type: "book_watchdog_error";
402
+ status: number | null;
391
403
  };
392
404
  type DiagnosticCallback = (event: DiagnosticEvent) => void;
393
405
 
@@ -1054,6 +1066,12 @@ type GetPositionsQuery = {
1054
1066
  cursor?: string | undefined;
1055
1067
  limit?: number | undefined;
1056
1068
  status?: "active" | "closed" | undefined;
1069
+ venueEventId?: string | undefined;
1070
+ venueMarketId?: string | undefined;
1071
+ /** Only positions on events in any of these categories (a league is a category). At most 20. */
1072
+ categoryIds?: string[] | undefined;
1073
+ /** `realizedPnl`: highest realized P&L first. Live positions only. */
1074
+ sort?: "realizedPnl" | undefined;
1057
1075
  };
1058
1076
  type OrderListItem = {
1059
1077
  status: string;
@@ -1205,6 +1223,8 @@ type PositionGroup = {
1205
1223
  currentPrice: number;
1206
1224
  totalValue: number;
1207
1225
  unrealizedPnlPercent: number;
1226
+ /** Realized P&L across the legs (sells + settlement), before fees. USD. */
1227
+ realizedPnl: number;
1208
1228
  priceSource: PriceSource;
1209
1229
  bookQuality: BookQuality;
1210
1230
  }[];
@@ -2110,12 +2130,24 @@ interface RequestedOrderbookMarket {
2110
2130
  venue: string;
2111
2131
  marketStatus: "open" | "closed" | "resolved" | "unopened" | "paused";
2112
2132
  tickSize: number | null;
2133
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
2134
+ * Absent means a 1-unit step. */
2135
+ sizeStepRaw?: string;
2136
+ /** Smallest limit-order size on this market, raw 6-dec shares.
2137
+ * Absent means no known minimum. */
2138
+ minSizeRaw?: string;
2113
2139
  endDate: string | null;
2114
2140
  resolutionDate: string | null;
2115
2141
  }
2116
2142
  interface MatchedOrderbookMarket extends VenueMarketRef {
2117
2143
  marketStatus: "open" | "closed" | "resolved" | "unopened" | "paused";
2118
2144
  tickSize: number | null;
2145
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
2146
+ * Absent means a 1-unit step. */
2147
+ sizeStepRaw?: string;
2148
+ /** Smallest limit-order size on this market, raw 6-dec shares.
2149
+ * Absent means no known minimum. */
2150
+ minSizeRaw?: string;
2119
2151
  hasOrderbook: boolean;
2120
2152
  /**
2121
2153
  * Hyperliquid HIP-4 deployer namespace this member belongs to (e.g. "ap").
@@ -2374,6 +2406,12 @@ interface RecurringCryptoMarketsResponse {
2374
2406
  interface VenueOrderbookEntry {
2375
2407
  venueMarketId: string;
2376
2408
  tickSize: number | null;
2409
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
2410
+ * Absent means a 1-unit step. */
2411
+ sizeStepRaw?: string;
2412
+ /** Smallest limit-order size on this market, raw 6-dec shares.
2413
+ * Absent means no known minimum. */
2414
+ minSizeRaw?: string;
2377
2415
  orderbook: Orderbook;
2378
2416
  /**
2379
2417
  * Sticky tick of this venue's book inferred at runtime by the engine. May
@@ -2996,6 +3034,8 @@ interface GetPositionsParams {
2996
3034
  limit?: number;
2997
3035
  status?: "active" | "closed";
2998
3036
  mode?: ExecutionMode;
3037
+ categoryIds?: string[];
3038
+ sort?: "realizedPnl";
2999
3039
  }
3000
3040
  interface GetOrdersParams {
3001
3041
  status?: string;
@@ -3385,15 +3425,30 @@ interface UserActivityQuery {
3385
3425
  /** Column a leaderboard is ranked by. */
3386
3426
  type LeaderboardMetric = "realizedPnl" | "volume";
3387
3427
  interface LeaderboardQuery {
3388
- /** Inclusive UTC calendar day, `YYYY-MM-DD`. Omit both for all time. */
3428
+ /** Inclusive UTC day `YYYY-MM-DD`. Omit both `from` and `to` for all time. */
3389
3429
  from?: string;
3390
- /** Inclusive UTC calendar day, `YYYY-MM-DD`. */
3391
3430
  to?: string;
3392
- /** Default `realizedPnl`. */
3393
3431
  metric?: LeaderboardMetric;
3394
3432
  /** 1..100, default 50. */
3395
3433
  limit?: number;
3396
3434
  cursor?: string;
3435
+ /** Look up one user (at most one of these four). */
3436
+ userId?: string;
3437
+ externalId?: string;
3438
+ /** Only when the app's `leaderboardIdentity` is `profile`. */
3439
+ username?: string;
3440
+ /** Not when the app's `leaderboardIdentity` is `anonymous`. */
3441
+ walletAddress?: string;
3442
+ /** One `Category.id` (a league is a category); includes sub-categories. At most 1. */
3443
+ categoryIds?: string[];
3444
+ /** Up to 5 event ids, each merged across venues. All time only; not with `categoryIds`. */
3445
+ venueEventIds?: string[];
3446
+ /**
3447
+ * Up to 100 AGG user ids; unpaginated. Not with the single-user lookups or `cursor`.
3448
+ * Returns rows only for users that have stats: a requested user with no activity is
3449
+ * simply absent (the single-user lookups return a zero row instead).
3450
+ */
3451
+ userIds?: string[];
3397
3452
  }
3398
3453
  interface LeaderboardRow {
3399
3454
  /** Exact within the top 100, `null` beyond. */
@@ -3413,8 +3468,14 @@ interface LeaderboardRow {
3413
3468
  spent: number;
3414
3469
  /** Gross realized P&L in USD (sells + settlements, before fees). */
3415
3470
  realizedPnl: number;
3416
- }
3417
- /** Exactly one of `userId`, `externalId`, `username`, `walletAddress` is required. */
3471
+ /** Settled position legs whose settlement booked a profit. */
3472
+ wins: number;
3473
+ /** Settled position legs whose settlement booked a loss. A zero settlement (void, refund) is neither. */
3474
+ losses: number;
3475
+ /** wins / (wins + losses), 0 to 1; `null` before any settlement. */
3476
+ winRate: number | null;
3477
+ }
3478
+ /** At most one of `userId`, `externalId`, `username`, `walletAddress`; none = the whole app. */
3418
3479
  interface LeaderboardSeriesQuery {
3419
3480
  /** Inclusive UTC calendar day, `YYYY-MM-DD`. Default: 29 days before `to`. */
3420
3481
  from?: string;
@@ -3426,25 +3487,33 @@ interface LeaderboardSeriesQuery {
3426
3487
  username?: string;
3427
3488
  /** Not when the app's `leaderboardIdentity` is `anonymous`. */
3428
3489
  walletAddress?: string;
3490
+ /** One `Category.id`. At most 1. */
3491
+ categoryIds?: string[];
3429
3492
  }
3430
- interface LeaderboardSeriesPoint {
3431
- /** UTC calendar day, `YYYY-MM-DD`. */
3432
- day: string;
3433
- /** Filled orders on this day. */
3493
+ interface LeaderboardStats {
3434
3494
  orders: number;
3435
- /** USD notional of every filled order on this day, buys and sells. */
3436
3495
  volume: number;
3437
- /** USD notional of filled buy orders only. */
3438
3496
  spent: number;
3439
- /** Gross realized P&L in USD booked this day (sells + settlements, before fees). */
3440
3497
  realizedPnl: number;
3498
+ wins: number;
3499
+ losses: number;
3500
+ winRate: number | null;
3501
+ }
3502
+ interface LeaderboardSeriesPoint extends LeaderboardStats {
3503
+ /** UTC calendar day, `YYYY-MM-DD`. */
3504
+ day: string;
3441
3505
  /** Running total of `realizedPnl` from `from` through this day. */
3442
3506
  cumulativeRealizedPnl: number;
3507
+ /** Win rate over `from` through this day; `null` until a position settles. */
3508
+ cumulativeWinRate: number | null;
3443
3509
  }
3444
3510
  interface LeaderboardSeries {
3445
- userId: string;
3511
+ /** `null` for an app-wide series (no user given). */
3512
+ userId: string | null;
3446
3513
  from: string;
3447
3514
  to: string;
3515
+ /** Sums over `[from, to]`. */
3516
+ totals: LeaderboardStats;
3448
3517
  /** One point per day in `[from, to]`, oldest first; days without activity are 0. */
3449
3518
  points: LeaderboardSeriesPoint[];
3450
3519
  }
@@ -3827,6 +3896,12 @@ interface SmartRouteResponse {
3827
3896
  * `slippage.slippageBps` to flag thin liquidity.
3828
3897
  */
3829
3898
  slippage?: SmartRouteSlippage;
3899
+ /** Limit-order size step on this venue, raw 6-dec shares ("10000" = 0.01).
3900
+ * Only on a single-venue quote; absent means a 1-unit step. */
3901
+ sizeStepRaw?: string;
3902
+ /** Smallest limit-order size on this venue/market, raw 6-dec shares.
3903
+ * Only on a single-venue quote; absent means no known minimum. */
3904
+ minSizeRaw?: string;
3830
3905
  /** Estimated payout if the outcome wins (= totalFilled shares × $1, less
3831
3906
  * settlement fees — see `fills[].settlementFee`). */
3832
3907
  estimatedPayout?: number;
@@ -3835,6 +3910,9 @@ interface SmartRouteResponse {
3835
3910
  * into this number and `estimatedProfit` / `returnPct` are recomputed
3836
3911
  * against it. */
3837
3912
  totalCostIncFees?: number;
3913
+ /** Sell only: gross proceeds minus venue, builder, app, and user-paid
3914
+ * referral fees, in USD — what the sell returns. */
3915
+ estimatedNetProceeds?: number;
3838
3916
  /** Estimated profit if the outcome wins (= estimatedPayout − totalCostIncFees). */
3839
3917
  estimatedProfit?: number;
3840
3918
  /** Return on investment percentage (= estimatedProfit / totalCostIncFees × 100). */
@@ -4333,6 +4411,20 @@ interface AggWebSocketDiagnostics {
4333
4411
  bridgeListeners?: number;
4334
4412
  host?: Record<string, unknown>;
4335
4413
  }
4414
+ /**
4415
+ * Per-outcome staleness check against REST. Plain data (no functions) so it
4416
+ * can be passed into the market-data Worker.
4417
+ */
4418
+ interface BookWatchdogOptions {
4419
+ /** REST API base URL, e.g. `https://api.agg.market`. */
4420
+ baseUrl: string;
4421
+ /** Headers for `GET /orderbooks/outcomes` (`x-app-id`, optional `x-app-api-key`). */
4422
+ headers?: Record<string, string>;
4423
+ /** A book with no update for this long is checked. Default 5 minutes. */
4424
+ silenceMs?: number;
4425
+ /** How often silent books are looked for. Default 1 minute. */
4426
+ checkIntervalMs?: number;
4427
+ }
4336
4428
  interface AggWebSocketOptions {
4337
4429
  /** Full WebSocket URL including query params (appId). Token should NOT be in the URL. */
4338
4430
  url: string;
@@ -4343,6 +4435,8 @@ interface AggWebSocketOptions {
4343
4435
  enableLogs?: boolean;
4344
4436
  /** Engine-only: read immutable books through getBook at presentation cadence. */
4345
4437
  deferBookViews?: boolean;
4438
+ /** Check silent books against REST and heal any that drifted. Off when omitted. */
4439
+ bookWatchdog?: BookWatchdogOptions;
4346
4440
  }
4347
4441
  /**
4348
4442
  * Agg WebSocket client. Single WS connection with refcounted market subscriptions.
@@ -4370,6 +4464,19 @@ declare class AggWebSocket {
4370
4464
  private readonly deferBookViews;
4371
4465
  /** Markets currently resyncing (awaiting snapshot after seq gap / checksum mismatch). */
4372
4466
  private readonly resyncing;
4467
+ private readonly bookWatchdog?;
4468
+ /**
4469
+ * Per subscribed orderbook outcome: last time it made progress (subscribe,
4470
+ * snapshot, applied delta) or was checked against REST (ms). Tracked from
4471
+ * subscribe, not from the first snapshot, so a book that never arrives or
4472
+ * is stuck resyncing is still found by the watchdog.
4473
+ */
4474
+ private readonly bookCheckedAt;
4475
+ /** Outcomes the watchdog already resnapshotted; a repeat mismatch resubscribes. */
4476
+ private readonly watchdogResnapshotted;
4477
+ private watchdogTimer;
4478
+ private watchdogAbort;
4479
+ private watchdogPausedUntil;
4373
4480
  private connecting;
4374
4481
  private _connected;
4375
4482
  private reconnectAttempts;
@@ -4457,6 +4564,18 @@ declare class AggWebSocket {
4457
4564
  private handleOrderSubmitted;
4458
4565
  private handleBalanceUpdate;
4459
4566
  private handleRedeemEvent;
4567
+ /**
4568
+ * Heartbeats prove the socket, not each stream. Every subscribed outcome
4569
+ * with no progress for `silenceMs` is checked against the REST `seq`:
4570
+ *
4571
+ * - book present, not resyncing, same `seq` → the market is just quiet;
4572
+ * - different `seq`, no book (snapshot never arrived, or a resubscribe's
4573
+ * snapshot was lost), or stuck resyncing (any recovery whose snapshot
4574
+ * was lost) → resnapshot, then resubscribe on the next overdue check;
4575
+ * - REST can't serve it (`null`) → counted as an attempt, so the next
4576
+ * batch moves on to other outcomes instead of retrying the same 100.
4577
+ */
4578
+ private checkSilentBooks;
4460
4579
  private requestResnapshot;
4461
4580
  /**
4462
4581
  * Schedule a microtask that flushes queued subscribe/unsubscribe frames.
@@ -4476,4 +4595,4 @@ declare class AggWebSocket {
4476
4595
  private isOrderbookDebugEnabled;
4477
4596
  }
4478
4597
 
4479
- export { type PaperTradingAppOptions as $, AggWebSocket as A, type ExecutionStatusQuery as B, type ChartBarsResponse as C, type ExecutionStatusResponse as D, type ExecutionOrdersQuery as E, type UserActivityQuery as F, type UserActivityItem as G, type LeaderboardRow as H, type LeaderboardSeriesQuery as I, type LeaderboardSeries as J, type ExecutionPositionsQuery as K, type LeaderboardQuery as L, MarketDataEngine as M, type ExecutionPositionGroup as N, type OrderbookState as O, type PaginatedResponse as P, type ManagedBalancesParams as Q, type UnifiedBalanceResponse as R, type SiweMessageParams as S, type TradeSplit as T, type UserProfile as U, Venue as V, type WsArbMarketUpdate as W, type UpsertVenueKey as X, type VenueKeySummary as Y, type VenueKeyStatus as Z, type CreatePaperTradingAccountParams as _, type AggWebSocketOptions as a, type WithdrawManagedResponse as a$, type PaperTradingAccount as a0, type PaperTradingAccountListParams as a1, type PaperTradingAccountsPage as a2, type SetPaperTradingBalanceParams as a3, type PaperTradingBalanceResponse as a4, type ResetPaperTradingAccountParams as a5, type PlacePaperTradingOrderParams as a6, type PaperTradingOrder as a7, type PaperTradingListParams as a8, type PaperTradingPositionsPage as a9, type SearchParams as aA, type SearchResponse as aB, type CorrelatedMarketsStatus as aC, type CorrelatedMarketSignalBatch as aD, type CorrelatedMarketQueryResult as aE, type CorrelatedMarketCascadeResponse as aF, type ResolveCorrelatedMarketsParams as aG, type ResolveCorrelatedMarketsResponse as aH, type ChartResolution as aI, type BatchOrderbooksResponse as aJ, type BatchMidpointsResponse as aK, type OutcomeOrderbookResponse as aL, type SmartRouteParams as aM, type SmartRouteResponse as aN, type ExecuteManagedParams as aO, type ExecuteManagedResponse as aP, type PlaceLimitOrderParams as aQ, type PlaceLimitOrderResponse as aR, type PlaceOrderParams as aS, type PlaceOrderResponse as aT, type RedeemRequest as aU, type RedeemResponse as aV, type BalanceRefillPolicy as aW, type CreateBalanceRefillPolicyParams as aX, type UpdateBalanceRefillPolicyParams as aY, type BalanceRefillAttempt as aZ, type WithdrawManagedParams as a_, type PaperTradingOrdersPage as aa, type PaperTradingPortfolio as ab, type CancelOrderSignature as ac, type CancelManagedExecutionResponse as ad, type CancelVenueOrderParams as ae, MatchStatus as af, MarketStatus as ag, type RecurrenceFilter as ah, type VenueEvent as ai, type EventBootstrapResponse as aj, type SportsLiveResponse as ak, type ListRecurringCryptoMarketsOptions as al, type RecurringCryptoMarketsResponse as am, type GetCryptoReferencePricesOptions as an, type CryptoReferencePricesResponse as ao, type Category as ap, type AppClientConfigResponse as aq, type VenueGeoPolicyResponse as ar, type RpcTokenResponse as as, type NewsFeedListResponse as at, type NewsFeedPageOptions as au, type NewsFeedArticleFeedResponse as av, type NewsFeedMarketFeedResponse as aw, type NewsFeedStatusResponse as ax, type NewsFeedMarketNewsParams as ay, type NewsFeedMarketNewsResponse as az, type ChartHistoryManifest as b, type DiagnosticEvent as b$, type WithdrawPreviewParams as b0, type WithdrawPreviewResponse as b1, type WithdrawalQuoteParams as b2, type WithdrawalQuoteResponse as b3, type SyncBalancesResponse as b4, type DepositAddressesResponse as b5, type GetPositionsParams as b6, type PositionGroup as b7, type RampQuoteRequest as b8, type RampQuote as b9, CONFIRMED_MATCH_STATUSES as bA, CandleBuilder as bB, type CandleInterval as bC, type CandleTail as bD, Chain as bE, type ChartBarsMeta as bF, type ChartVenueCandles as bG, type ComputeSplitsRequest as bH, type ComputeSplitsResponse as bI, type ComputeSplitsSelection as bJ, type CorrelatedMarketCascadeItem as bK, type CorrelatedMarketSide as bL, type CorrelatedMarketSignal as bM, type CorrelatedMarketSignalDirection as bN, type CreateApp as bO, type CryptoReferencePriceError as bP, type CryptoReferencePriceExternalMarketInput as bQ, type CryptoReferencePriceMarketInput as bR, type CryptoReferencePriceResult as bS, type CryptoReferencePriceSource as bT, type CryptoReferencePriceTarget as bU, type DepositAddressesPendingResponse as bV, type DepositAddressesReadyResponse as bW, type DepositAddressesSupportedChain as bX, type DepositAddressesToken as bY, type DepositStep as bZ, type DiagnosticCallback as b_, type RampSessionRequest as ba, type RampWidgetSession as bb, type Candle as bc, ACTIVE_VENUES as bd, type Account as be, AccountProvider as bf, AccountType as bg, type AggAuthDeliveryMode as bh, type AggAuthPrivyVerifyBody as bi, type AggAuthProviderType as bj, type AggAuthWalletVerifyBody as bk, type AggClientAuthOptions as bl, type AggSessionUser as bm, type AggregatedOrderbookLevel as bn, type AggregatedOrderbookResponse as bo, type App as bp, type AppTradingMode as bq, type AttributedOrderbook as br, type AttributedOrderbookLevel as bs, type AuthCodeResponse as bt, type AuthTokenResponse as bu, type AuthUser as bv, type BalanceCustody as bw, type BalanceRefillAttemptStatus as bx, type BalanceRefillPolicyStatus as by, type BookQuality as bz, type ChartCandle as c, type PersistedAuthSnapshot as c$, type ExecuteManagedRequest as c0, type ExecuteTradeRequest as c1, type ExecuteTradeResponse as c2, type ExecutionDagProgress as c3, type ExecutionDisplayGroupStatus as c4, type ExecutionDisplayStepKind as c5, type ExecutionMode as c6, type ExecutionOverallState as c7, type ExecutionStatusOrder as c8, type ExecutionStatusStep as c9, type NewsFeedLinkedMarket as cA, type NewsFeedMarketFeedArticle as cB, type NewsFeedMarketFeedItem as cC, type NewsFeedMarketNewsResult as cD, type NonceResponse as cE, type NovigExecutionMode as cF, OPTIONAL_SIGNATURE_TIMEOUT_MS as cG, type OrderListItem as cH, OrderStatus as cI, OrderType as cJ, type OrderbookBatchItemError as cK, type OrderbookBatchItemErrorCode as cL, type OrderbookBatchItemStatus as cM, type OrderbookHistoryPoint as cN, type OrderbookHistoryResponse as cO, type OrderbookLevel as cP, type OrderbookQuoteFill as cQ, type OrderbookQuoteParams as cR, type OrderbookQuoteResponse as cS, type OrderbookServiceUnavailableError as cT, type OrderbooksOnlyError as cU, type OutcomeMidpoint as cV, type OutcomeMidpointRow as cW, type PaperTradingBalanceAdjustment as cX, type PaperTradingLiquidityStatus as cY, type PaperTradingMarkSource as cZ, type PaperTradingPosition as c_, type GetBalanceQuery as ca, type GetBalanceResponse as cb, type GetHoldingsQuery as cc, type GetHoldingsResponse as cd, type GetOrdersParams as ce, type GetOrdersQuery as cf, type GetPositionsQuery as cg, type HelloResponse as ch, type HistoryRangeRequest as ci, INACTIVE_VENUES as cj, type LeaderboardMetric as ck, type LeaderboardSeriesPoint as cl, type LimitOrderTimeInForce as cm, type MarkSource as cn, type MarketPriceHistory as co, type MarketView as cp, type MarketViewBatch as cq, MatchType as cr, type MatchedMidpoint as cs, type MatchedMidpointOutcome as ct, type MatchedOrderbookMarket as cu, type MatchedVenueMarketOutcomeRef as cv, type MidpointItem as cw, type MidpointRow as cx, type NewsFeedArticleFeedItem as cy, type NewsFeedArticleWithSummary as cz, type AggWebSocketDiagnostics as d, type UserActivityUserOp as d$, type PositionRedeemStatus as d0, type PricePoint as d1, type PriceSource as d2, type PricesHistoryResponse as d3, type ProphetxExecutionMode as d4, RECURRENCE_CADENCES as d5, type RecurrenceCadence as d6, type RecurringCryptoComparisonPoint as d7, type RecurringCryptoComparisonPriceSource as d8, type RecurringCryptoDuration as d9, type SignatureRequest as dA, type SignatureRequestType as dB, type SignerFn as dC, type SimpleOrderbookLevel as dD, type SmartRouteAllocation as dE, type SmartRouteBridgeStep as dF, type SmartRouteFeeBreakdown as dG, type SmartRouteFill as dH, type SmartRouteSettlementLeg as dI, type SmartRouteSettlementPlan as dJ, type SmartRouteSetupCostLine as dK, type SmartRouteSide as dL, type SmartRouteStatus as dM, type SmartRouteVenueFill as dN, type SportsGameStatus as dO, type SportsLiveParticipant as dP, type SportsLiveState as dQ, TERMINAL_EXECUTION_STATES as dR, TimeInForce as dS, type TradeExecutorOrder as dT, type TradeStep as dU, type UserActivityBridge as dV, type UserActivityDeposit as dW, type UserActivityRedeem as dX, type UserActivityRedeemLeg as dY, type UserActivityTrade as dZ, type UserActivityType as d_, type RecurringCryptoDurationInput as da, type RecurringCryptoMarketMetrics as db, type RecurringCryptoOrderbookDepthLevel as dc, type RecurringCryptoOrderbookDepthSide as dd, type RecurringCryptoOutcome as de, type RecurringCryptoOutcomeOrderbookDepth as df, type RecurringCryptoPriceComparison as dg, type RecurringCryptoReferencePrice as dh, type RecurringCryptoResolution as di, type RecurringCryptoSourceConfidence as dj, type RecurringCryptoVenueMarket as dk, type RecurringCryptoWindowComparisons as dl, type RecurringCryptoWindowMarket as dm, type RedeemLegResult as dn, type RedeemLegStatus as dp, type RequestedOrderbookMarket as dq, type ResolvedCorrelatedMarketsResponse as dr, SELF_CUSTODY_FILL_TIMEOUT_MS as ds, SELF_CUSTODY_POLL_INTERVAL_MS as dt, type ServerWallet as du, type SettlementDiff as dv, type SettlementDifference as dw, type SettlementSource as dx, type SetupDepositAddressStep as dy, type SetupVenueKeyStep as dz, type WsArbFeedBatch as e, applyOrderbookDelta as e$, type UserActivityWithdrawal as e0, VENUES as e1, VENUE_CHAIN_IDS as e2, type ValidateBalanceOnClientStep as e3, type ValidateManagedParams as e4, type ValidateManagedRequest as e5, type ValidateManagedResponse as e6, type ValidateTradeRequest as e7, type ValidateTradeResponse as e8, type VenueEventListItem as e9, type WsAttributedLevel as eA, type WsAuthenticated as eB, type WsBalanceUpdate as eC, type WsCandleInterval as eD, type WsClientMessage as eE, type WsConnected as eF, type WsError as eG, type WsHeartbeat as eH, type WsMarkSource as eI, type WsMarketResolved as eJ, type WsOrderEvent as eK, type WsOrderEventType as eL, type WsOrderSubmitted as eM, type WsOrderbookDelta as eN, type WsOrderbookSnapshot as eO, type WsRedeemEvent as eP, type WsServerMessage as eQ, type WsSubscribed as eR, type WsTrade as eS, type WsUnsubscribed as eT, type WsVenueBook as eU, type WsVenueInfo as eV, type WsVenueLevel as eW, type WsWithdrawalLegStatus as eX, type WsWithdrawalLifecycleEvent as eY, type WsWithdrawalLifecycleLeg as eZ, type WsWithdrawalLifecycleStatus as e_, type VenueEventWithMarkets as ea, type VenueGeoPolicyEntry as eb, type VenueMarketListItem as ec, type VenueMarketRef as ed, type VenueOrderbookEntry as ee, type VenueOrderbookLevel as ef, type VenuePositionBalance as eg, type VenuePriceInfo as eh, type VenueSoloQuote as ei, type VerifyBody as ej, type VerifyResponse as ek, type WalletChainBalance as el, type WalletTokenBalance as em, type WithdrawManagedRequest as en, type WithdrawManagedSourceItem as eo, type WithdrawTokenSymbol as ep, type WithdrawalExpected as eq, type WithdrawalLeg as er, type WithdrawalLegStatus as es, type WithdrawalLegType as et, type WithdrawalLifecycleStatus as eu, type WithdrawalSource as ev, type WithdrawalSourceItem as ew, type WithdrawalSourceStatus as ex, type WithdrawalSourceTokenSymbol as ey, type WsArbFeedEntry as ez, type AggWebSocketCallbacks as f, computeChecksum as f0, getEffectiveDisabledVenues as f1, isVenueActive as f2, isVenueDataVisible as f3, isVenueInactive as f4, snapshotToOrderbook as f5, type VenueMarket as g, type VenueMarketOutcome as h, type Orderbook as i, TradeSide$1 as j, type AggClientOptions as k, type AggClientSessionInput as l, type AuthStatus as m, type SiwsMessageParams as n, type AggAuthVerifyBody as o, type AggAuthStartBody as p, type AggAuthStartResult as q, type AggLinkAccountBody as r, type AggLinkAccountResult as s, type AggLinkAccountWalletConfirmBody as t, type AggLinkAccountConfirmResult as u, type UpdateUserBody as v, type UserHolding as w, type OrderListQuery as x, type TradeExecutorOrderListResponse as y, type ExecutionOrderItem as z };
4598
+ export { type PaperTradingAppOptions as $, AggWebSocket as A, type ExecutionStatusQuery as B, type ChartBarsResponse as C, type ExecutionStatusResponse as D, type ExecutionOrdersQuery as E, type UserActivityQuery as F, type UserActivityItem as G, type LeaderboardRow as H, type LeaderboardSeriesQuery as I, type LeaderboardSeries as J, type ExecutionPositionsQuery as K, type LeaderboardQuery as L, MarketDataEngine as M, type ExecutionPositionGroup as N, type OrderbookState as O, type PaginatedResponse as P, type ManagedBalancesParams as Q, type UnifiedBalanceResponse as R, type SiweMessageParams as S, type TradeSplit as T, type UserProfile as U, Venue as V, type WsArbMarketUpdate as W, type UpsertVenueKey as X, type VenueKeySummary as Y, type VenueKeyStatus as Z, type CreatePaperTradingAccountParams as _, type AggWebSocketOptions as a, type WithdrawManagedParams as a$, type PaperTradingAccount as a0, type PaperTradingAccountListParams as a1, type PaperTradingAccountsPage as a2, type SetPaperTradingBalanceParams as a3, type PaperTradingBalanceResponse as a4, type ResetPaperTradingAccountParams as a5, type PlacePaperTradingOrderParams as a6, type PaperTradingOrder as a7, type PaperTradingListParams as a8, type PaperTradingPositionsPage as a9, type SearchParams as aA, type SearchResponse as aB, type CorrelatedMarketsStatus as aC, type CorrelatedMarketSignalBatch as aD, type CorrelatedMarketQueryResult as aE, type CorrelatedMarketCascadeResponse as aF, type ResolveCorrelatedMarketsParams as aG, type ResolveCorrelatedMarketsResponse as aH, type ChartResolution as aI, type BatchOrderbooksResponse as aJ, type BatchMidpointsResponse as aK, type OutcomeOrderbookResponse as aL, type SmartRouteParams as aM, type SmartRouteResponse as aN, type BookWatchdogOptions as aO, type ExecuteManagedParams as aP, type ExecuteManagedResponse as aQ, type PlaceLimitOrderParams as aR, type PlaceLimitOrderResponse as aS, type PlaceOrderParams as aT, type PlaceOrderResponse as aU, type RedeemRequest as aV, type RedeemResponse as aW, type BalanceRefillPolicy as aX, type CreateBalanceRefillPolicyParams as aY, type UpdateBalanceRefillPolicyParams as aZ, type BalanceRefillAttempt as a_, type PaperTradingOrdersPage as aa, type PaperTradingPortfolio as ab, type CancelOrderSignature as ac, type CancelManagedExecutionResponse as ad, type CancelVenueOrderParams as ae, MatchStatus as af, MarketStatus as ag, type RecurrenceFilter as ah, type VenueEvent as ai, type EventBootstrapResponse as aj, type SportsLiveResponse as ak, type ListRecurringCryptoMarketsOptions as al, type RecurringCryptoMarketsResponse as am, type GetCryptoReferencePricesOptions as an, type CryptoReferencePricesResponse as ao, type Category as ap, type AppClientConfigResponse as aq, type VenueGeoPolicyResponse as ar, type RpcTokenResponse as as, type NewsFeedListResponse as at, type NewsFeedPageOptions as au, type NewsFeedArticleFeedResponse as av, type NewsFeedMarketFeedResponse as aw, type NewsFeedStatusResponse as ax, type NewsFeedMarketNewsParams as ay, type NewsFeedMarketNewsResponse as az, type ChartHistoryManifest as b, type DiagnosticCallback as b$, type WithdrawManagedResponse as b0, type WithdrawPreviewParams as b1, type WithdrawPreviewResponse as b2, type WithdrawalQuoteParams as b3, type WithdrawalQuoteResponse as b4, type SyncBalancesResponse as b5, type DepositAddressesResponse as b6, type GetPositionsParams as b7, type PositionGroup as b8, type RampQuoteRequest as b9, type BookQuality as bA, CONFIRMED_MATCH_STATUSES as bB, CandleBuilder as bC, type CandleInterval as bD, type CandleTail as bE, Chain as bF, type ChartBarsMeta as bG, type ChartVenueCandles as bH, type ComputeSplitsRequest as bI, type ComputeSplitsResponse as bJ, type ComputeSplitsSelection as bK, type CorrelatedMarketCascadeItem as bL, type CorrelatedMarketSide as bM, type CorrelatedMarketSignal as bN, type CorrelatedMarketSignalDirection as bO, type CreateApp as bP, type CryptoReferencePriceError as bQ, type CryptoReferencePriceExternalMarketInput as bR, type CryptoReferencePriceMarketInput as bS, type CryptoReferencePriceResult as bT, type CryptoReferencePriceSource as bU, type CryptoReferencePriceTarget as bV, type DepositAddressesPendingResponse as bW, type DepositAddressesReadyResponse as bX, type DepositAddressesSupportedChain as bY, type DepositAddressesToken as bZ, type DepositStep as b_, type RampQuote as ba, type RampSessionRequest as bb, type RampWidgetSession as bc, type Candle as bd, ACTIVE_VENUES as be, type Account as bf, AccountProvider as bg, AccountType as bh, type AggAuthDeliveryMode as bi, type AggAuthPrivyVerifyBody as bj, type AggAuthProviderType as bk, type AggAuthWalletVerifyBody as bl, type AggClientAuthOptions as bm, type AggSessionUser as bn, type AggregatedOrderbookLevel as bo, type AggregatedOrderbookResponse as bp, type App as bq, type AppTradingMode as br, type AttributedOrderbook as bs, type AttributedOrderbookLevel as bt, type AuthCodeResponse as bu, type AuthTokenResponse as bv, type AuthUser as bw, type BalanceCustody as bx, type BalanceRefillAttemptStatus as by, type BalanceRefillPolicyStatus as bz, type ChartCandle as c, type PaperTradingMarkSource as c$, type DiagnosticEvent as c0, type ExecuteManagedRequest as c1, type ExecuteTradeRequest as c2, type ExecuteTradeResponse as c3, type ExecutionDagProgress as c4, type ExecutionDisplayGroupStatus as c5, type ExecutionDisplayStepKind as c6, type ExecutionMode as c7, type ExecutionOverallState as c8, type ExecutionStatusOrder as c9, type NewsFeedArticleFeedItem as cA, type NewsFeedArticleWithSummary as cB, type NewsFeedLinkedMarket as cC, type NewsFeedMarketFeedArticle as cD, type NewsFeedMarketFeedItem as cE, type NewsFeedMarketNewsResult as cF, type NonceResponse as cG, type NovigExecutionMode as cH, OPTIONAL_SIGNATURE_TIMEOUT_MS as cI, type OrderListItem as cJ, OrderStatus as cK, OrderType as cL, type OrderbookBatchItemError as cM, type OrderbookBatchItemErrorCode as cN, type OrderbookBatchItemStatus as cO, type OrderbookHistoryPoint as cP, type OrderbookHistoryResponse as cQ, type OrderbookLevel as cR, type OrderbookQuoteFill as cS, type OrderbookQuoteParams as cT, type OrderbookQuoteResponse as cU, type OrderbookServiceUnavailableError as cV, type OrderbooksOnlyError as cW, type OutcomeMidpoint as cX, type OutcomeMidpointRow as cY, type PaperTradingBalanceAdjustment as cZ, type PaperTradingLiquidityStatus as c_, type ExecutionStatusStep as ca, type GetBalanceQuery as cb, type GetBalanceResponse as cc, type GetHoldingsQuery as cd, type GetHoldingsResponse as ce, type GetOrdersParams as cf, type GetOrdersQuery as cg, type GetPositionsQuery as ch, type HelloResponse as ci, type HistoryRangeRequest as cj, INACTIVE_VENUES as ck, type LeaderboardMetric as cl, type LeaderboardSeriesPoint as cm, type LeaderboardStats as cn, type LimitOrderTimeInForce as co, type MarkSource as cp, type MarketPriceHistory as cq, type MarketView as cr, type MarketViewBatch as cs, MatchType as ct, type MatchedMidpoint as cu, type MatchedMidpointOutcome as cv, type MatchedOrderbookMarket as cw, type MatchedVenueMarketOutcomeRef as cx, type MidpointItem as cy, type MidpointRow as cz, type AggWebSocketDiagnostics as d, type UserActivityTrade as d$, type PaperTradingPosition as d0, type PersistedAuthSnapshot as d1, type PositionRedeemStatus as d2, type PricePoint as d3, type PriceSource as d4, type PricesHistoryResponse as d5, type ProphetxExecutionMode as d6, RECURRENCE_CADENCES as d7, type RecurrenceCadence as d8, type RecurringCryptoComparisonPoint as d9, type SetupDepositAddressStep as dA, type SetupVenueKeyStep as dB, type SignatureRequest as dC, type SignatureRequestType as dD, type SignerFn as dE, type SimpleOrderbookLevel as dF, type SmartRouteAllocation as dG, type SmartRouteBridgeStep as dH, type SmartRouteFeeBreakdown as dI, type SmartRouteFill as dJ, type SmartRouteSettlementLeg as dK, type SmartRouteSettlementPlan as dL, type SmartRouteSetupCostLine as dM, type SmartRouteSide as dN, type SmartRouteStatus as dO, type SmartRouteVenueFill as dP, type SportsGameStatus as dQ, type SportsLiveParticipant as dR, type SportsLiveState as dS, TERMINAL_EXECUTION_STATES as dT, TimeInForce as dU, type TradeExecutorOrder as dV, type TradeStep as dW, type UserActivityBridge as dX, type UserActivityDeposit as dY, type UserActivityRedeem as dZ, type UserActivityRedeemLeg as d_, type RecurringCryptoComparisonPriceSource as da, type RecurringCryptoDuration as db, type RecurringCryptoDurationInput as dc, type RecurringCryptoMarketMetrics as dd, type RecurringCryptoOrderbookDepthLevel as de, type RecurringCryptoOrderbookDepthSide as df, type RecurringCryptoOutcome as dg, type RecurringCryptoOutcomeOrderbookDepth as dh, type RecurringCryptoPriceComparison as di, type RecurringCryptoReferencePrice as dj, type RecurringCryptoResolution as dk, type RecurringCryptoSourceConfidence as dl, type RecurringCryptoVenueMarket as dm, type RecurringCryptoWindowComparisons as dn, type RecurringCryptoWindowMarket as dp, type RedeemLegResult as dq, type RedeemLegStatus as dr, type RequestedOrderbookMarket as ds, type ResolvedCorrelatedMarketsResponse as dt, SELF_CUSTODY_FILL_TIMEOUT_MS as du, SELF_CUSTODY_POLL_INTERVAL_MS as dv, type ServerWallet as dw, type SettlementDiff as dx, type SettlementDifference as dy, type SettlementSource as dz, type WsArbFeedBatch as e, type WsWithdrawalLifecycleLeg as e$, type UserActivityType as e0, type UserActivityUserOp as e1, type UserActivityWithdrawal as e2, VENUES as e3, VENUE_CHAIN_IDS as e4, type ValidateBalanceOnClientStep as e5, type ValidateManagedParams as e6, type ValidateManagedRequest as e7, type ValidateManagedResponse as e8, type ValidateTradeRequest as e9, type WithdrawalSourceTokenSymbol as eA, type WsArbFeedEntry as eB, type WsAttributedLevel as eC, type WsAuthenticated as eD, type WsBalanceUpdate as eE, type WsCandleInterval as eF, type WsClientMessage as eG, type WsConnected as eH, type WsError as eI, type WsHeartbeat as eJ, type WsMarkSource as eK, type WsMarketResolved as eL, type WsOrderEvent as eM, type WsOrderEventType as eN, type WsOrderSubmitted as eO, type WsOrderbookDelta as eP, type WsOrderbookSnapshot as eQ, type WsRedeemEvent as eR, type WsServerMessage as eS, type WsSubscribed as eT, type WsTrade as eU, type WsUnsubscribed as eV, type WsVenueBook as eW, type WsVenueInfo as eX, type WsVenueLevel as eY, type WsWithdrawalLegStatus as eZ, type WsWithdrawalLifecycleEvent as e_, type ValidateTradeResponse as ea, type VenueEventListItem as eb, type VenueEventWithMarkets as ec, type VenueGeoPolicyEntry as ed, type VenueMarketListItem as ee, type VenueMarketRef as ef, type VenueOrderbookEntry as eg, type VenueOrderbookLevel as eh, type VenuePositionBalance as ei, type VenuePriceInfo as ej, type VenueSoloQuote as ek, type VerifyBody as el, type VerifyResponse as em, type WalletChainBalance as en, type WalletTokenBalance as eo, type WithdrawManagedRequest as ep, type WithdrawManagedSourceItem as eq, type WithdrawTokenSymbol as er, type WithdrawalExpected as es, type WithdrawalLeg as et, type WithdrawalLegStatus as eu, type WithdrawalLegType as ev, type WithdrawalLifecycleStatus as ew, type WithdrawalSource as ex, type WithdrawalSourceItem as ey, type WithdrawalSourceStatus as ez, type AggWebSocketCallbacks as f, type WsWithdrawalLifecycleStatus as f0, applyOrderbookDelta as f1, computeChecksum as f2, getEffectiveDisabledVenues as f3, isVenueActive as f4, isVenueDataVisible as f5, isVenueInactive as f6, snapshotToOrderbook as f7, type VenueMarket as g, type VenueMarketOutcome as h, type Orderbook as i, TradeSide$1 as j, type AggClientOptions as k, type AggClientSessionInput as l, type AuthStatus as m, type SiwsMessageParams as n, type AggAuthVerifyBody as o, type AggAuthStartBody as p, type AggAuthStartResult as q, type AggLinkAccountBody as r, type AggLinkAccountResult as s, type AggLinkAccountWalletConfirmBody as t, type AggLinkAccountConfirmResult as u, type UpdateUserBody as v, type UserHolding as w, type OrderListQuery as x, type TradeExecutorOrderListResponse as y, type ExecutionOrderItem as z };
@@ -1,4 +1,4 @@
1
- import { A as AggWebSocket, a as AggWebSocketOptions, C as ChartBarsResponse, b as ChartHistoryManifest, c as ChartCandle, d as AggWebSocketDiagnostics, M as MarketDataEngine, O as OrderbookState, W as WsArbMarketUpdate, e as WsArbFeedBatch, f as AggWebSocketCallbacks } from './agg-websocket-Bxt9PzTz.mjs';
1
+ import { A as AggWebSocket, a as AggWebSocketOptions, C as ChartBarsResponse, b as ChartHistoryManifest, c as ChartCandle, d as AggWebSocketDiagnostics, M as MarketDataEngine, O as OrderbookState, W as WsArbMarketUpdate, e as WsArbFeedBatch, f as AggWebSocketCallbacks } from './agg-websocket-x_U4-orL.mjs';
2
2
 
3
3
  /** The application owns the native module Worker URL so its static bundler fingerprints it. */
4
4
  type MarketDataWorkerFactory = () => Worker;