// Generated by the Circuit CLI for `circuit:sdk`. Do not edit. // Run `circuit check` to regenerate. declare module "circuit:sdk" { type ThreadState = { [key: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null)[] | { [key: string]: string | number | boolean | any | any | null; } | null; }; type Duration = number | `${number}d` | `${number}h` | `${number}m`; type DecimalInput = string | number | Dec; type AssetRef = string | { network: Network; asset: string; }; type Dec = { readonly value: string; } & Record<"add" | "max" | "min" | "mul" | "sub", (other: DecimalInput) => Dec> & Record<"eq" | "gt" | "gte" | "lt" | "lte", (other: DecimalInput) => boolean> & Record<"abs" | "neg", () => Dec> & Record<"isNegative" | "isPositive" | "isZero", () => boolean> & Record<"toJSON" | "toString" | "valueOf", () => string> & { div(other: DecimalInput, scale?: number): Dec; divCeil(other: DecimalInput, scale?: number): Dec; align(step: DecimalInput, up?: boolean): Dec; toNumber(): number; }; export const d: (v: DecimalInput) => Dec; export const resolveAsset: (ref: AssetRef) => { network: Network; asset: string; }; type SettingSpec = { readonly type: SettingKind; readonly default: T; readonly description?: string | undefined; readonly options?: readonly string[] | undefined; readonly min?: number | undefined; readonly max?: number | undefined; }; type SettingsSchema = { [x: string]: SettingSpec; }; type SettingsOf

= { readonly [K in keyof P]: P[K] extends SettingSpec ? T : never; }; export const setting: { int: (o: { default: number; min?: number; max?: number; description?: string; }) => SettingSpec; number: (o: { default: number; min?: number; max?: number; description?: string; }) => SettingSpec; percent: (o: { default: number; min?: number; max?: number; description?: string; }) => SettingSpec; bool: (o: { default: boolean; description?: string; }) => SettingSpec; text: (o: { default: string; description?: string; }) => SettingSpec; address: (o: { default: string; description?: string; }) => SettingSpec; select: (o: { default: O[number]; options: O; description?: string; }) => SettingSpec; }; type WalletWatchEvent = (V extends TradeVenue ? Extract : WalletTrade) & { wallet: string }; type WatchSpec = { readonly kind: WakeupSpec["kind"]; readonly wakeup: WakeupSpec; readonly venue?: TradeVenue | undefined; readonly item?: Item; }; type WatchMap = { [x: string]: WatchSpec | undefined; }; type EventsOf = { readonly [K in WatchKeys]: WatchVal extends WatchSpec ? Item | undefined : never; }; type AgentRunInput, S extends ThreadState = ThreadState, P extends SettingsSchema = Record> = { readonly events: EventsOf; readonly state: S; readonly settings: SettingsOf

}; type AgentConfig, S extends ThreadState = ThreadState, P extends SettingsSchema = Record> = { settings?: P; state?: S; every?: Duration; watch?: W | ((args: { readonly state: S; readonly settings: SettingsOf

}) => W); run: (args: AgentRunInput) => Promise | void; }; type AgentDefinition = { readonly kind: "circuit:agent"; } & Omit, "run"> & { readonly run: (args: AgentRunInput) => Promise | unknown; }; export const on: { at: (at: string | Date, o?: { expiresAt?: string | Date; }) => WatchSpec<{ at: Timestamp; }>; every: (interval: Duration, o?: { expiresAt?: string | Date; }) => WatchSpec<{ at: Timestamp; }>; after: (delay: Duration, o?: { expiresAt?: string | Date; }) => WatchSpec<{ at: Timestamp; }>; price: (target: AssetRef | ({ asset: string; } & ({ expiresAt?: string | Date; } & (({ gte: DecimalInput; lte?: DecimalInput; crosses?: DecimalInput; } | { gte?: DecimalInput; lte: DecimalInput; crosses?: DecimalInput; } | { gte?: DecimalInput; lte?: DecimalInput; crosses: DecimalInput; }) & { network?: "derive" | "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901" | "hypercore" | "lighter" | "lighter-robinhood" | "papertrade" | "polymarket-perps" | "solana" | undefined; }))), opts?: { expiresAt?: string | Date; } & (({ gte: DecimalInput; lte?: DecimalInput; crosses?: DecimalInput; } | { gte?: DecimalInput; lte: DecimalInput; crosses?: DecimalInput; } | { gte?: DecimalInput; lte?: DecimalInput; crosses: DecimalInput; }) & { network?: "derive" | "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901" | "hypercore" | "lighter" | "lighter-robinhood" | "papertrade" | "polymarket-perps" | "solana" | undefined; })) => WatchSpec<{ asset: string; priceUsd: Decimal; at: Timestamp; }>; wallet: (address: string, o?: { venue?: V; network?: WatchedNetwork | undefined; } & { expiresAt?: string | Date; }) => WatchSpec>; fill: (o?: { venue?: "binance" | "bybit" | "coinbase" | "derive" | "hyperliquid" | "kalshi" | "kraken" | "lighter" | "lighterRobinhood" | "okx" | "papertrade" | "polymarket" | "polymarketPerps" | "qfex" | undefined; asset?: string; } & { expiresAt?: string | Date; }) => WatchSpec<{ assetKey: string; venueAsset?: string | undefined; occurredAt: Timestamp; }>; resolution: (assetKey: string, o?: { expiresAt?: string | Date; }) => WatchSpec<{ assetKey: string; market: string; outcome?: string | undefined; }>; news: (prompt: string, o?: { expiresAt?: string | Date; }) => WatchSpec<{ headline: string; summary: (string | null); source: string; url: (string | null); emittedAt: Timestamp; }>; webhook: (provider: WebhookProvider, o?: { expiresAt?: string | Date; }) => WatchSpec<{ provider: WebhookProvider; id: string; payload: unknown; }>; operation: (operationId: string, o?: { expiresAt?: string | Date; }) => WatchSpec<{ operationId: string; status: OperationStatus; error?: OperationFailure | undefined; }>; }; export const agent: , S extends ThreadState = ThreadState, P extends SettingsSchema = Record>(cfg: AgentConfig) => AgentDefinition; type ActionKind = "account:hyperliquid" | "cancel:binance" | "cancel:bybit" | "cancel:coinbase" | "cancel:derive" | "cancel:hyperliquid" | "cancel:kalshi" | "cancel:kraken" | "cancel:lighter" | "cancel:lighterRobinhood" | "cancel:okx" | "cancel:polymarket" | "cancel:polymarketPerps" | "cancel:qfex" | "claim:papertrade" | "close:papertrade" | "evmTx" | "lendingAccount" | "lendingBorrow" | "lendingRepay" | "lendingSupply" | "lendingWithdraw" | "liquidity" | "margin:lighter" | "margin:lighterRobinhood" | "margin:polymarketPerps" | "order:binance" | "order:bybit" | "order:coinbase" | "order:derive" | "order:hyperliquid" | "order:kalshi" | "order:kraken" | "order:lighter" | "order:lighterRobinhood" | "order:okx" | "order:papertrade" | "order:polymarket" | "order:polymarketPerps" | "order:qfex" | "positionChange:polymarket" | "redeem:polymarket" | "rewardsClaim" | "setup:derive" | "setup:hyperliquid" | "setup:lighter" | "setup:lighterRobinhood" | "setup:papertrade" | "setup:polymarket" | "setup:polymarketPerps" | "solanaTx" | "stake:papertrade" | "swap" | "transfer" | "unstake:papertrade" | "withdraw:kraken" | "withdraw:polymarketPerps" | "withdraw:qfex"; type EvmMoneyAction = { chainId: number; toAddress: EvmAddress; valueWei: RawAmount; data: HexBytes; }; type OnceInput = { once: OnceNameInput; per?: (PerInput | null) | undefined; }; type OperationResource = { status: OperationStatus; operationId: string; readError?: string | undefined; kind: ActionKind; request: unknown; receipts: Array; createdAt: Timestamp; deadlineAt: (Timestamp | null); finishedAt: (Timestamp | null); error: unknown; result: unknown; }; type PolymarketOrderProposal = { kind: PolymarketOrderKind; asset: RawAmount; amount: OrderAmount; execution?: PolymarketExecution | undefined; }; type SessionMovement = { operationId: string; observationIndex: number; role: LegRole; network: string; assetKey: string; amount: Decimal; priceUsd: (Decimal | null); timestamp: Timestamp; references: Array; }; type SolanaMoneyAction = SolanaBytes | SolanaInstructions; type SwapProvider = "across" | "cowswap" | "derive" | "erc4626" | "hypercore" | "jupiter" | "kyberswap" | "lighter" | "metric" | "nearIntents" | "papertrade" | "polymarketPerps" | "pusd" | "relay" | "uniswap" | "velora" | "weth"; type ThinkRequest = { prompt: string; context?: unknown | undefined; schema?: unknown | undefined; }; export const MINIMUM_SWAP_USD: "1"; export const isEvmNetwork: (value: string | null | undefined) => value is "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901"; export const isSolanaNetwork: (network: string) => network is "solana"; export class ApiError extends Error { readonly code: string | undefined; readonly context: ApiErrorDetails["context"] | undefined; readonly details: ApiErrorDetails | undefined; readonly evidence: string | undefined; readonly operationId: string | undefined; readonly moneyFailure: ApiErrorDetails["moneyFailure"]; readonly receipts: ApiErrorDetails["receipts"] | undefined; readonly requestId: string | undefined; readonly statusCode: number | undefined; readonly httpErrorStatus: number | undefined; readonly target: string | undefined; constructor(message: string, options: Partial< Pick< ApiError, "requestId" | "statusCode" | "code" | "details" | "cause" | "target" | "evidence" > >); } type ApiErrorDetails = { success: false; error: string; code?: string | undefined; detail?: FailureDetail | undefined; context?: ErrorContext | undefined; operationId?: string | undefined; moneyFailure?: MoneyFailure | undefined; receipts?: Array | undefined; }; type NetworkId = "derive" | "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901" | "hypercore" | "lighter" | "lighter-robinhood" | "papertrade" | "polymarket-perps" | "solana"; export class MoneyActionError extends ApiError { readonly moneyFailure: NonNullable; readonly outcome: MoneyActionOutcome; constructor(cause: unknown, outcome: MoneyActionOutcome); } type MoneyActionOutcome = { status: "rejected"; } | { status: "error"; operation: OperationResource; } | { status: "unresolved"; operationId: string; operation: OperationResource | null; }; type AgentContext = { threadId: string; eventId: string; walletAddress: string; state: ThreadState; log: (message: string, options?: { error?: boolean; }) => Promise; reply: (text: string) => undefined; stop: () => undefined; setTitle: (title: string) => undefined; settings: Record; binance: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "binance"; orderId: ExchangeOrderId; asset: BinancePair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; bybit: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "bybit"; orderId: ExchangeOrderId; asset: BybitPair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; coinbase: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "coinbase"; orderId: ExchangeOrderId; asset: CoinbasePair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; data: { readonly assetFundamentals: (params?: { asset?: (Array | null) | undefined; vendor?: (FundamentalsVendor | null) | undefined; assetType?: (DataAssetType | null) | undefined; categoryKey?: (string | null) | undefined; sortBy?: (FigureInput | null) | undefined; order?: (SortOrderInput | null) | undefined; /** min 0, format "uint32" */ limit?: (number | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly assets: (params?: { venue?: (Venue | null) | undefined; venueSymbol?: (Array | null) | undefined; dex?: (string | null) | undefined; asset?: (Array | null) | undefined; network?: (Network | null) | undefined; address?: (string | null) | undefined; vendor?: (FundamentalsVendor | null) | undefined; vendorKey?: (string | null) | undefined; assetType?: (DataAssetType | null) | undefined; categoryKey?: (string | null) | undefined; search?: (string | null) | undefined; underlyingAsset?: (Array | null) | undefined; includeDelisted?: (boolean | null) | undefined; cursor?: (string | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly calendar: (params?: { kind?: (Array | null) | undefined; subject?: (Array | null) | undefined; asset?: (Array | null) | undefined; /** format "date" */ fromDay?: (string | null) | undefined; /** format "date" */ toDay?: (string | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly categories: (params?: { categoryKey?: (Array | null) | undefined; search?: (string | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly fundingRates: (params: { venue: Venue; venueSymbol: Array; dex?: (string | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; }) => Promise> & AsyncIterable; readonly markets: (params: { venue: Venue; venueSymbol?: (Array | null) | undefined; dex?: (string | null) | undefined; assetType?: (DataAssetType | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; sortBy?: (MarketSortByInput | null) | undefined; order?: (SortOrderInput | null) | undefined; /** min 0, format "uint32" */ limit?: (number | null) | undefined; }) => Promise>; readonly metrics: (params: { subjectKind: MetricSubjectKind; subject?: (Array | null) | undefined; asset?: (Array | null) | undefined; search?: (string | null) | undefined; category?: (string | null) | undefined; sortBy?: (MetricSortByInput | null) | undefined; /** min 0, format "uint32" */ limit?: (number | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; }) => Promise> & AsyncIterable; readonly openInterest: (params: { venue: Venue; venueSymbol: Array; dex?: (string | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; }) => Promise> & AsyncIterable; readonly pools: (params?: { network?: (Array | null) | undefined; protocol?: (string | null) | undefined; factory?: (Array | null) | undefined; pool?: (Array | null) | undefined; token?: (Array | null) | undefined; asset?: (Array | null) | undefined; quoteToken?: (Array | null) | undefined; /** min 0, format "uint64" */ createdWithinMs?: (number | null) | undefined; /** max length 80 */ minLiquidityUsd?: (NonnegativeDecimal | null) | undefined; minQuoteReserve?: (string | null) | undefined; sortBy?: (PoolSortByInput | null) | undefined; order?: (SortOrderInput | null) | undefined; /** min 0, format "uint32" */ limit?: (number | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; } | undefined) => Promise>; readonly prices: { (params: { network: PricedNetworkInput; asset: string; tokenId?: (string | null) | undefined; /** A bar width. */ interval: GrainInput; /** integer, min 0, max 65535, format "uint16" */ bars: number; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; }): Promise; (asset: AssetRef, opts?: Omit<{ network: PricedNetworkInput; asset: string; tokenId?: (string | null) | undefined; interval: GrainInput; bars: number; asOf?: (Timestamp | null) | undefined; }, "network" | "asset">): Promise; }; readonly yields: (params?: { pool?: (Array | null) | undefined; depositToken?: (Array | null) | undefined; depositAsset?: (Array | null) | undefined; constituent?: (Array | null) | undefined; protocol?: (string | null) | undefined; network?: (Network | null) | undefined; vendor?: (YieldVendor | null) | undefined; yieldKind?: (YieldKind | null) | undefined; stablecoinOnly?: (boolean | null) | undefined; singleAssetExposure?: (boolean | null) | undefined; impermanentLossRisk?: (boolean | null) | undefined; exploited?: (boolean | null) | undefined; offPeg?: (boolean | null) | undefined; sortBy?: (YieldSortByInput | null) | undefined; order?: (SortOrderInput | null) | undefined; /** min 0, format "uint32" */ limit?: (number | null) | undefined; /** min 0, format "uint64" */ lookbackMs?: (number | null) | undefined; /** format "date-time" */ asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; }; derive: { readonly options: { readonly list: (params: { currency: Perp; /** format "date". One expiry, YYYY-MM-DD, to quote with mark, book and greeks. */ expiry?: (string | null) | undefined; }) => Promise; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "derive"; orderId: NonceCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; readonly vaults: { readonly list: () => Promise; }; }; exchanges: { readonly markets: { readonly list: (params: { /** A centralized exchange Circuit reads and trades through the user's API key. */ exchange: Exchange; /** Asset code, e.g. BTC. */ base?: (string | null) | undefined; quote?: (string | null) | undefined; }) => Promise; }; }; fomo: { readonly leaderboards: { readonly retrieve: (params: { window: FomoWindow; /** integer, min 0, max 255, format "uint8", default 10. Traders to return, best rank first; 1–150. */ top?: number | undefined; }) => Promise<{ window: FomoWindow; traders: Array; }>; }; readonly traders: { readonly retrieve: (params: { /** FOMO (fomo.family) username; @ optional. 1–64 characters. */ username: string; }) => Promise<{ handle: string; wallets: FomoWallets; }>; }; }; hyperliquid: { readonly account: { readonly update: (value: HyperliquidAccountChange, options?: OnceInput) => Promise; }; readonly close: (asset: string, opts?: HyperliquidCloseInput, once?: OnceInput) => Promise; readonly open: (params: HyperliquidOpenInput, opts?: OnceInput) => Promise; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "hyperliquid"; orderId: OrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; readonly outcomes: { readonly list: () => Promise; }; readonly spotMarkets: { readonly list: () => Promise; }; readonly staking: { readonly retrieve: () => Promise; }; }; kalshi: { readonly events: { readonly search: (params?: { /** min length 1, max length 200. Words a series title, category or tag holds, e.g. Fed, Basketball, Bitcoin. */ query?: (string | null) | undefined; /** min length 1, max length 200. A series ticker a query returned: lists its open events. */ seriesTicker?: (string | null) | undefined; /** min length 1, max length 200. An event ticker: returns its markets. */ eventTicker?: (string | null) | undefined; } | undefined) => Promise<{ series: Array; events: Array; }>; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "kalshi"; orderId: ExchangeOrderId; asset: KalshiPair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; kraken: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "kraken"; orderId: ExchangeOrderId; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; lending: { readonly account: { readonly update: (value: ValueUsdLendingAccountChange, options?: OnceInput) => Promise; }; readonly markets: { readonly list: (params: { network: Network; /** A protocol Circuit lends and borrows on. */ protocol?: (LendingProtocol | null) | undefined; }) => Promise<{ markets: Array; unavailable: Array; }>; }; readonly positions: { readonly borrow: (value: ValueUsdBorrow, options?: OnceInput) => Promise; readonly repay: (value: ValueUsdRepay, options?: OnceInput) => Promise; readonly supply: (value: ValueUsdSupply, options?: OnceInput) => Promise; readonly withdraw: (value: ValueUsdWithdraw, options?: OnceInput) => Promise; }; }; lighter: { readonly margin: { readonly update: (value: LighterMarginChange, options?: OnceInput) => Promise; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "lighter"; orderId: LighterOrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; lighterRobinhood: { readonly margin: { readonly update: (value: LighterMarginChange, options?: OnceInput) => Promise; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "lighterRobinhood"; orderId: LighterOrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; liquidity: { readonly pools: { readonly retrieve: (params: { /** A network with an EVM chain id. */ network: EvmNetwork; protocol: MetricInput; /** A green-tier Metric pool deployed by the network's registered Metric factory. */ pool: MetricPool; }) => Promise<{ span: Span; }>; }; readonly positions: { readonly change: (value: LiquidityAction, options?: OnceInput) => Promise; }; }; memory: { readonly delete: (params: { /** A memory key: no `.` or `..` path segments. */ key: MemoryKey; }) => Promise; readonly get: (params: { /** A memory key: no `.` or `..` path segments. */ key: MemoryKey; }) => Promise; readonly list: (params?: { prefix?: (string | null) | undefined; } | undefined) => Promise; readonly set: (params: { /** A memory key: no `.` or `..` path segments. */ key: MemoryKey; value: string; }) => Promise; }; okx: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "okx"; orderId: ExchangeOrderId; asset: OkxPair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; operations: { readonly cancel: (params: { /** format "uuid" */ operationId: string; }) => Promise<{ status: OperationStatus; operationId: string; readError?: string | undefined; kind: ActionKind; request: unknown; receipts: Array; createdAt: Timestamp; deadlineAt: (Timestamp | null); finishedAt: (Timestamp | null); error: unknown; result: unknown; }>; readonly list: (params?: { /** An opaque history page position: pass `nextCursor` back unchanged. */ cursor?: (CursorInput | null) | undefined; /** Only the session's pending operations. */ pendingOnly?: (boolean | null) | undefined; } | undefined) => Promise<{ rows: Array; nextCursor: (string | null); }> & AsyncIterable; readonly pending: () => Promise; readonly retrieve: (params: { /** format "uuid" */ operationId: string; }) => Promise<{ status: OperationStatus; operationId: string; readError?: string | undefined; kind: ActionKind; request: unknown; receipts: Array; createdAt: Timestamp; deadlineAt: (Timestamp | null); finishedAt: (Timestamp | null); error: unknown; result: unknown; action: (MoneyAction | null); }>; }; orders: { readonly listOpen: (params: { venue: Venue; }) => Promise<{ orders: Array; errors: Array; }>; }; papertrade: { readonly account: { readonly retrieve: () => Promise; }; readonly headroom: { readonly list: () => Promise; }; readonly markets: { readonly list: () => Promise; }; readonly paper: { readonly claim: (params?: Omit<{ kind: "claim"; } & { venue: "papertrade"; }, "kind" | "venue"> | undefined, options?: OnceInput | undefined) => Promise; readonly stake: (params: Omit<{ kind: "stake"; } & { venue: "papertrade"; amount: PositiveDecimal; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly unstake: (params: Omit<{ kind: "unstake"; } & { venue: "papertrade"; amount: PositiveDecimal; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; }; readonly positions: { readonly close: (params: Omit<{ kind: "close"; } & { venue: "papertrade"; positionIds: Array; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly closed: (params: { positionIds: string[]; }) => Promise; readonly open: (value: PapertradeOrderProposal, options?: OnceInput) => Promise; }; }; polymarket: { readonly events: { readonly list: (params: { rail: DiscoverRailInput; }) => Promise; readonly retrieve: (params: { slug: string; }) => Promise<{ slug: string; title: string; imageUrl: (string | null); openInterestPusd: (PositiveDecimal | null); markets: Array; }>; readonly search: (params: { query: string; }) => Promise; }; readonly markets: { readonly retrieve: (params: { asset: RawAmount; }) => Promise<{ question: string; slug: string; sportsMarketType: (string | null); groupItemTitle: (string | null); negRisk: boolean; line: (number | null); gameStartTime: (string | null); endDate: (string | null); liquidityPusd: NonnegativeDecimal; volume24hPusd: NonnegativeDecimal; dayChangePercent: (number | null); updatedAt: (string | null); outcomes: Array; imageUrl: (string | null); eventUrl: (string | null); eventTitle: (string | null); description: (string | null); acceptingOrders: boolean; resolving: boolean; minimumNotional: (PositiveDecimal | null); priceTick: (PositiveDecimal | null); minimumSize: (NonnegativeDecimal | null); takerFee: (TakerFee | null); }>; readonly screen: (params: { /** integer, min 0, format "uint64". At most 30 days, in milliseconds. */ endsWithinMs: number; /** max length 80 */ lowestPricePusd: PricePusd; /** max length 80 */ highestPricePusd: PricePusd; /** max length 80 */ minLiquidityPusd: NonnegativeDecimal; /** max length 80. pUSD buy walked against each book to price it. */ stakePusd: PositiveDecimal; orderBy?: (ScreenOrderInput | null) | undefined; tagSlug?: (string | null) | undefined; excludeTagSlugs?: (Array | null) | undefined; sportsMarketTypes?: (Array | null) | undefined; }) => Promise<{ events: Array; scanned: number; truncated: boolean; }>; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "polymarket"; orderId: PolymarketOrderId; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: PolymarketOrderProposal, options?: OnceInput) => Promise; readonly quote: (params: { kind: PolymarketOrderKind; asset: RawAmount; /** Total order notional in the market's quote asset (USDC; USDG on Lighter Robinhood; pUSD on Polymarket; USD on KRAKEN:XBT/USD), never margin or a USD conversion. */ amount: OrderAmount; execution?: (PolymarketExecution | null) | undefined; }) => Promise; }; readonly positions: { readonly change: (value: PolymarketPositionChange, options?: OnceInput) => Promise; readonly redeem: (params: Omit<{ kind: "redeem"; } & { venue: "polymarket"; asset: RawAmount; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; }; readonly prices: { readonly list: (params: { asset: RawAmount; /** default "all". Chart window; all, the default, returns the market's whole life. */ window?: ChartWindowInput | undefined; }) => Promise; }; }; polymarketPerps: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "polymarketPerps"; orderId: PolymarketPerpsOrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; portfolio: { readonly balance: (asset: AssetRef) => Promise; readonly perp: (venue: string, asset: string) => Promise; readonly positions: () => Promise; readonly retrieve: () => Promise<{ holdings: Array; totalValueUsd: (string | null); }>; }; qfex: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "qfex"; orderId: ExchangeOrderId; asset: QfexSymbol; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; rewards: { readonly claim: (params: Omit<{ kind: "rewardsClaim"; network: EvmNetwork; claim: RewardClaim; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly list: (params?: { /** A network with an EVM chain id. */ network?: (EvmNetwork | null) | undefined; } | undefined) => Promise; }; solana: { readonly holdings: { readonly retrieve: (params: { /** A Solana address in base58. */ wallet: SolanaAddress; }) => Promise<{ wallet: SolanaAddress; sol: NonnegativeDecimal; tokens: Array; unreadable: Array; }>; }; }; swaps: { readonly create: (value: ValueUsdSwap, options?: OnceInput) => Promise; readonly quote: (swap: SwapRequest) => Promise; readonly swap: (params: SwapInput, opts?: OnceInput) => Promise; }; think: (params: { prompt: string; context?: unknown | undefined; schema?: unknown | undefined; }) => Promise<{ text: string; data?: unknown | undefined; }>; transactions: { readonly list: (params?: { /** An opaque ledger page position: pass `nextCursor` back unchanged. */ cursor?: (LedgerCursorInput | null) | undefined; } | undefined) => Promise<{ rows: Array; nextCursor: (string | null); }> & AsyncIterable; }; transfers: { readonly create: (value: ValueUsdTransfer, options?: OnceInput) => Promise; readonly quote: (transfer: TransferRequest) => Promise; }; wallet: { readonly messages: { readonly sign: (params: { messageType: "eip712"; /** EIP-712 typed data for typed message signing. | An EIP-191 message for simple message signing. */ data: Eip712TypedDataInput; /** integer, min 0, format "uint64" */ chainId: number; } | { messageType: "eip191"; /** EIP-712 typed data for typed message signing. | An EIP-191 message for simple message signing. */ data: Eip191MessageInput; /** integer, min 0, format "uint64" */ chainId: number; }) => Promise<{ v: number; r: string; s: string; formattedSignature: string; type: string; }>; }; readonly transactions: { readonly create: (params: WalletTransactionRequest, opts?: OnceInput) => Promise; readonly preview: (params: WalletTransactionRequest) => Promise; }; }; }; type HyperliquidCloseInput = Partial> & { size?: DecimalInput | "max"; }; type HyperliquidOpenInput = Omit<{ kind: "perpOpen"; asset: string; side: PerpSide; amount: OrderAmount; execution?: OrderExecution | undefined; takeProfit?: PositiveDecimalExit | undefined; stopLoss?: PositiveDecimalExit | undefined; message?: OrderMessage | undefined; margin?: PerpMargin | undefined; }, "amount" | "kind"> & ({ value: DecimalInput; size?: never; } | { size: DecimalInput; value?: never; }); type PriceCandle = { opensAt: Timestamp; open: Dec; high: Dec; low: Dec; close: Dec; volume: string | null; }; type PricesResult = { price: Dec | null; bars: PriceCandle[] | null; }; type SwapInput = Omit & { from: AssetRef; to: AssetRef; amount: DecimalInput | "max"; }; export const thread: { readonly id: any; readonly eventId: any; readonly walletAddress: any; }; export const log: (message: string, options?: { error?: boolean; }) => Promise; export const reply: (text: string) => undefined; export const stop: () => undefined; export const setTitle: (title: string) => undefined; export const think: (params: { prompt: string; context?: unknown | undefined; schema?: unknown | undefined; }) => Promise<{ text: string; data?: unknown | undefined; }>; export const kv: { readonly delete: (params: { key: MemoryKey; }) => Promise; readonly get: (params: { key: MemoryKey; }) => Promise; readonly list: (params?: { prefix?: (string | null) | undefined; } | undefined) => Promise; readonly set: (params: { key: MemoryKey; value: string; }) => Promise; }; export const portfolio: { readonly balance: (asset: AssetRef) => Promise; readonly perp: (venue: string, asset: string) => Promise; readonly positions: () => Promise; readonly retrieve: () => Promise<{ holdings: Array; totalValueUsd: (string | null); }>; }; export const orders: { readonly listOpen: (params: { venue: Venue; }) => Promise<{ orders: Array; errors: Array; }>; }; export const operations: { readonly cancel: (params: { operationId: string; }) => Promise<{ status: OperationStatus; operationId: string; readError?: string | undefined; kind: ActionKind; request: unknown; receipts: Array; createdAt: Timestamp; deadlineAt: (Timestamp | null); finishedAt: (Timestamp | null); error: unknown; result: unknown; }>; readonly list: (params?: { cursor?: (CursorInput | null) | undefined; pendingOnly?: (boolean | null) | undefined; } | undefined) => Promise<{ rows: Array; nextCursor: (string | null); }> & AsyncIterable; readonly pending: () => Promise; readonly retrieve: (params: { operationId: string; }) => Promise<{ status: OperationStatus; operationId: string; readError?: string | undefined; kind: ActionKind; request: unknown; receipts: Array; createdAt: Timestamp; deadlineAt: (Timestamp | null); finishedAt: (Timestamp | null); error: unknown; result: unknown; action: (MoneyAction | null); }>; }; export const transactions: { readonly list: (params?: { cursor?: (LedgerCursorInput | null) | undefined; } | undefined) => Promise<{ rows: Array; nextCursor: (string | null); }> & AsyncIterable; }; export const wallet: { readonly messages: { readonly sign: (params: { messageType: "eip712"; data: Eip712TypedDataInput; chainId: number; } | { messageType: "eip191"; data: Eip191MessageInput; chainId: number; }) => Promise<{ v: number; r: string; s: string; formattedSignature: string; type: string; }>; }; readonly transactions: { readonly create: (params: WalletTransactionRequest, opts?: OnceInput) => Promise; readonly preview: (params: WalletTransactionRequest) => Promise; }; }; export const transfers: { readonly create: (value: ValueUsdTransfer, options?: OnceInput) => Promise; readonly quote: (transfer: TransferRequest) => Promise; }; export const swaps: { readonly create: (value: ValueUsdSwap, options?: OnceInput) => Promise; readonly quote: (swap: SwapRequest) => Promise; readonly swap: (params: SwapInput, opts?: OnceInput) => Promise; }; export const lending: { readonly account: { readonly update: (value: ValueUsdLendingAccountChange, options?: OnceInput) => Promise; }; readonly markets: { readonly list: (params: { network: Network; protocol?: (LendingProtocol | null) | undefined; }) => Promise<{ markets: Array; unavailable: Array; }>; }; readonly positions: { readonly borrow: (value: ValueUsdBorrow, options?: OnceInput) => Promise; readonly repay: (value: ValueUsdRepay, options?: OnceInput) => Promise; readonly supply: (value: ValueUsdSupply, options?: OnceInput) => Promise; readonly withdraw: (value: ValueUsdWithdraw, options?: OnceInput) => Promise; }; }; export const rewards: { readonly claim: (params: Omit<{ kind: "rewardsClaim"; network: EvmNetwork; claim: RewardClaim; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly list: (params?: { network?: (EvmNetwork | null) | undefined; } | undefined) => Promise; }; export const liquidity: { readonly pools: { readonly retrieve: (params: { network: EvmNetwork; protocol: MetricInput; pool: MetricPool; }) => Promise<{ span: Span; }>; }; readonly positions: { readonly change: (value: LiquidityAction, options?: OnceInput) => Promise; }; }; export const fomo: { readonly leaderboards: { readonly retrieve: (params: { window: FomoWindow; top?: number | undefined; }) => Promise<{ window: FomoWindow; traders: Array; }>; }; readonly traders: { readonly retrieve: (params: { username: string; }) => Promise<{ handle: string; wallets: FomoWallets; }>; }; }; export const solana: { readonly holdings: { readonly retrieve: (params: { wallet: SolanaAddress; }) => Promise<{ wallet: SolanaAddress; sol: NonnegativeDecimal; tokens: Array; unreadable: Array; }>; }; }; export const hyperliquid: { readonly account: { readonly update: (value: HyperliquidAccountChange, options?: OnceInput) => Promise; }; readonly close: (asset: string, opts?: HyperliquidCloseInput, once?: OnceInput) => Promise; readonly open: (params: HyperliquidOpenInput, opts?: OnceInput) => Promise; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "hyperliquid"; orderId: OrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; readonly outcomes: { readonly list: () => Promise; }; readonly spotMarkets: { readonly list: () => Promise; }; readonly staking: { readonly retrieve: () => Promise; }; }; export const lighter: { readonly margin: { readonly update: (value: LighterMarginChange, options?: OnceInput) => Promise; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "lighter"; orderId: LighterOrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const lighterRobinhood: { readonly margin: { readonly update: (value: LighterMarginChange, options?: OnceInput) => Promise; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "lighterRobinhood"; orderId: LighterOrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const derive: { readonly options: { readonly list: (params: { currency: Perp; expiry?: (string | null) | undefined; }) => Promise; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "derive"; orderId: NonceCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; readonly vaults: { readonly list: () => Promise; }; }; export const papertrade: { readonly account: { readonly retrieve: () => Promise; }; readonly headroom: { readonly list: () => Promise; }; readonly markets: { readonly list: () => Promise; }; readonly paper: { readonly claim: (params?: Omit<{ kind: "claim"; } & { venue: "papertrade"; }, "kind" | "venue"> | undefined, options?: OnceInput | undefined) => Promise; readonly stake: (params: Omit<{ kind: "stake"; } & { venue: "papertrade"; amount: PositiveDecimal; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly unstake: (params: Omit<{ kind: "unstake"; } & { venue: "papertrade"; amount: PositiveDecimal; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; }; readonly positions: { readonly close: (params: Omit<{ kind: "close"; } & { venue: "papertrade"; positionIds: Array; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly closed: (params: { positionIds: string[]; }) => Promise; readonly open: (value: PapertradeOrderProposal, options?: OnceInput) => Promise; }; }; export const polymarket: { readonly events: { readonly list: (params: { rail: DiscoverRailInput; }) => Promise; readonly retrieve: (params: { slug: string; }) => Promise<{ slug: string; title: string; imageUrl: (string | null); openInterestPusd: (PositiveDecimal | null); markets: Array; }>; readonly search: (params: { query: string; }) => Promise; }; readonly markets: { readonly retrieve: (params: { asset: RawAmount; }) => Promise<{ question: string; slug: string; sportsMarketType: (string | null); groupItemTitle: (string | null); negRisk: boolean; line: (number | null); gameStartTime: (string | null); endDate: (string | null); liquidityPusd: NonnegativeDecimal; volume24hPusd: NonnegativeDecimal; dayChangePercent: (number | null); updatedAt: (string | null); outcomes: Array; imageUrl: (string | null); eventUrl: (string | null); eventTitle: (string | null); description: (string | null); acceptingOrders: boolean; resolving: boolean; minimumNotional: (PositiveDecimal | null); priceTick: (PositiveDecimal | null); minimumSize: (NonnegativeDecimal | null); takerFee: (TakerFee | null); }>; readonly screen: (params: { endsWithinMs: number; lowestPricePusd: PricePusd; highestPricePusd: PricePusd; minLiquidityPusd: NonnegativeDecimal; stakePusd: PositiveDecimal; orderBy?: (ScreenOrderInput | null) | undefined; tagSlug?: (string | null) | undefined; excludeTagSlugs?: (Array | null) | undefined; sportsMarketTypes?: (Array | null) | undefined; }) => Promise<{ events: Array; scanned: number; truncated: boolean; }>; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "polymarket"; orderId: PolymarketOrderId; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: PolymarketOrderProposal, options?: OnceInput) => Promise; readonly quote: (params: { kind: PolymarketOrderKind; asset: RawAmount; amount: OrderAmount; execution?: (PolymarketExecution | null) | undefined; }) => Promise; }; readonly positions: { readonly change: (value: PolymarketPositionChange, options?: OnceInput) => Promise; readonly redeem: (params: Omit<{ kind: "redeem"; } & { venue: "polymarket"; asset: RawAmount; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; }; readonly prices: { readonly list: (params: { asset: RawAmount; window?: ChartWindowInput | undefined; }) => Promise; }; }; export const polymarketPerps: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "polymarketPerps"; orderId: PolymarketPerpsOrderIdCancelTarget; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const kalshi: { readonly events: { readonly search: (params?: { query?: (string | null) | undefined; seriesTicker?: (string | null) | undefined; eventTicker?: (string | null) | undefined; } | undefined) => Promise<{ series: Array; events: Array; }>; }; readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "kalshi"; orderId: ExchangeOrderId; asset: KalshiPair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const qfex: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "qfex"; orderId: ExchangeOrderId; asset: QfexSymbol; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const kraken: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "kraken"; orderId: ExchangeOrderId; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const coinbase: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "coinbase"; orderId: ExchangeOrderId; asset: CoinbasePair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const okx: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "okx"; orderId: ExchangeOrderId; asset: OkxPair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const binance: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "binance"; orderId: ExchangeOrderId; asset: BinancePair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const bybit: { readonly orders: { readonly cancel: (params: Omit<{ kind: "cancel"; } & { venue: "bybit"; orderId: ExchangeOrderId; asset: BybitPair; }, "kind" | "venue">, options?: OnceInput | undefined) => Promise; readonly create: (value: BookOrderProposal, options?: OnceInput) => Promise; }; }; export const exchanges: { readonly markets: { readonly list: (params: { exchange: Exchange; base?: (string | null) | undefined; quote?: (string | null) | undefined; }) => Promise; }; }; export const data: Omit<{ readonly assetFundamentals: (params?: { asset?: (Array | null) | undefined; vendor?: (FundamentalsVendor | null) | undefined; assetType?: (DataAssetType | null) | undefined; categoryKey?: (string | null) | undefined; sortBy?: (FigureInput | null) | undefined; order?: (SortOrderInput | null) | undefined; limit?: (number | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly assets: (params?: { venue?: (Venue | null) | undefined; venueSymbol?: (Array | null) | undefined; dex?: (string | null) | undefined; asset?: (Array | null) | undefined; network?: (Network | null) | undefined; address?: (string | null) | undefined; vendor?: (FundamentalsVendor | null) | undefined; vendorKey?: (string | null) | undefined; assetType?: (DataAssetType | null) | undefined; categoryKey?: (string | null) | undefined; search?: (string | null) | undefined; underlyingAsset?: (Array | null) | undefined; includeDelisted?: (boolean | null) | undefined; cursor?: (string | null) | undefined; asOf?: (Timestamp | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly calendar: (params?: { kind?: (Array | null) | undefined; subject?: (Array | null) | undefined; asset?: (Array | null) | undefined; fromDay?: (string | null) | undefined; toDay?: (string | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly categories: (params?: { categoryKey?: (Array | null) | undefined; search?: (string | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; readonly fundingRates: (params: { venue: Venue; venueSymbol: Array; dex?: (string | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; }) => Promise> & AsyncIterable; readonly markets: (params: { venue: Venue; venueSymbol?: (Array | null) | undefined; dex?: (string | null) | undefined; assetType?: (DataAssetType | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; sortBy?: (MarketSortByInput | null) | undefined; order?: (SortOrderInput | null) | undefined; limit?: (number | null) | undefined; }) => Promise>; readonly metrics: (params: { subjectKind: MetricSubjectKind; subject?: (Array | null) | undefined; asset?: (Array | null) | undefined; search?: (string | null) | undefined; category?: (string | null) | undefined; sortBy?: (MetricSortByInput | null) | undefined; limit?: (number | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; }) => Promise> & AsyncIterable; readonly openInterest: (params: { venue: Venue; venueSymbol: Array; dex?: (string | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; }) => Promise> & AsyncIterable; readonly pools: (params?: { network?: (Array | null) | undefined; protocol?: (string | null) | undefined; factory?: (Array | null) | undefined; pool?: (Array | null) | undefined; token?: (Array | null) | undefined; asset?: (Array | null) | undefined; quoteToken?: (Array | null) | undefined; createdWithinMs?: (number | null) | undefined; minLiquidityUsd?: (NonnegativeDecimal | null) | undefined; minQuoteReserve?: (string | null) | undefined; sortBy?: (PoolSortByInput | null) | undefined; order?: (SortOrderInput | null) | undefined; limit?: (number | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; } | undefined) => Promise>; readonly prices: { (params: { network: PricedNetworkInput; asset: string; tokenId?: (string | null) | undefined; interval: GrainInput; bars: number; asOf?: (Timestamp | null) | undefined; }): Promise; (asset: AssetRef, opts?: Omit<{ network: PricedNetworkInput; asset: string; tokenId?: (string | null) | undefined; interval: GrainInput; bars: number; asOf?: (Timestamp | null) | undefined; }, "network" | "asset">): Promise; }; readonly yields: (params?: { pool?: (Array | null) | undefined; depositToken?: (Array | null) | undefined; depositAsset?: (Array | null) | undefined; constituent?: (Array | null) | undefined; protocol?: (string | null) | undefined; network?: (Network | null) | undefined; vendor?: (YieldVendor | null) | undefined; yieldKind?: (YieldKind | null) | undefined; stablecoinOnly?: (boolean | null) | undefined; singleAssetExposure?: (boolean | null) | undefined; impermanentLossRisk?: (boolean | null) | undefined; exploited?: (boolean | null) | undefined; offPeg?: (boolean | null) | undefined; sortBy?: (YieldSortByInput | null) | undefined; order?: (SortOrderInput | null) | undefined; limit?: (number | null) | undefined; lookbackMs?: (number | null) | undefined; asOf?: (Timestamp | null) | undefined; cursor?: (string | null) | undefined; } | undefined) => Promise> & AsyncIterable; }, "prices"> & { readonly prices: AgentContext["data"]["prices"] & ((asset: AssetRef, params: Omit[0], "network" | "asset">) => Promise); }; type SwapRequest = { from: NetworkAsset; to: SwapDestination; amount: ValueUsdAmount; minimumReceive?: (PositiveDecimal | null) | undefined; slippage?: (Percentage | null) | undefined; engines?: (Engines | null) | undefined; confidential?: (boolean | null) | undefined; toWalletId?: (number | null) | undefined; }; type TransferRequest = { from: NetworkAsset; amount: ValueUsdAmount; to: TransferTo; }; type ThinkResponse = { text: string; data?: unknown | undefined; }; type EvmSignMessageRequest = { messageType: "eip712"; data: Eip712TypedDataInput; chainId: number; } | { messageType: "eip191"; data: Eip191MessageInput; chainId: number; }; type SignMessageData = { v: number; r: string; s: string; formattedSignature: string; type: string; }; type CompletedOperation = { [Action in Kind]: Omit & { status: "success"; kind: Action; result: MoneyActionResults[Action]; }; }[Kind]; type EvmNetworkId = "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901"; type WalletTransactionRequest = { network: EvmNetworkId; request: Omit; } | { network: "solana"; request: SolanaMoneyAction; }; type TransactionPreviewResponse = { gasBalanceWarning?: string | undefined; functionName: (string | null); assetChanges: Array; }; type TransferQuoteResponse = { type: TransferType; amount: PositiveDecimal; fee: NonnegativeDecimal; feeSymbol: string; minimumAmount?: PositiveDecimal | undefined; gasBalanceWarning?: string | undefined; }; type SwapQuoteResponse = { gasBalanceWarning?: string | undefined; engine: SwapProvider; assetSend: QuoteAsset; assetReceive: QuoteAsset; venuePriceImpact?: Decimal | undefined; feeBreakdown: Array; candidates?: Array | undefined; slippage: Percentage; quoteFreshness: QuoteFreshness; }; type HyperliquidStaking = { staking: Staking; vaults: Array; errors: Array; }; type PapertradeAccount = { balance: NonnegativeDecimal; queued: NonnegativeDecimal; positions: Array; paper: PaperHoldings; }; type PapertradeClosedPositions = ClosedPosition[]; type AgentMoneyRequest = { kind: "swap"; swap: ValueUsdSwap; } | { kind: "transfer"; transfer: ValueUsdTransfer; } | { kind: "lendingSupply"; lending: ValueUsdSupply; } | { kind: "lendingWithdraw"; lending: ValueUsdWithdraw; } | { kind: "lendingBorrow"; lending: ValueUsdBorrow; } | { kind: "lendingRepay"; lending: ValueUsdRepay; } | { kind: "lendingAccount"; account: ValueUsdLendingAccountChange; } | { kind: "evmTx"; evm: EvmMoneyAction; } | { kind: "solanaTx"; solana: SolanaMoneyAction; } | { kind: "liquidity"; liquidity: LiquidityAction; } | { kind: "rewardsClaim"; network: EvmNetwork; claim: RewardClaim; } | ({ kind: "margin"; } & ({ venue: "lighter"; margin: LighterMarginChange; } | { venue: "lighterRobinhood"; margin: LighterMarginChange; } | { venue: "polymarketPerps"; margin: Never; })) | ({ kind: "cancel"; } & ({ venue: "hyperliquid"; orderId: OrderIdCancelTarget; } | { venue: "lighter"; orderId: LighterOrderIdCancelTarget; } | { venue: "lighterRobinhood"; orderId: LighterOrderIdCancelTarget; } | { venue: "derive"; orderId: NonceCancelTarget; } | { venue: "polymarket"; orderId: PolymarketOrderId; } | { venue: "kraken"; orderId: ExchangeOrderId; } | { venue: "coinbase"; orderId: ExchangeOrderId; asset: CoinbasePair; } | { venue: "okx"; orderId: ExchangeOrderId; asset: OkxPair; } | { venue: "binance"; orderId: ExchangeOrderId; asset: BinancePair; } | { venue: "bybit"; orderId: ExchangeOrderId; asset: BybitPair; } | { venue: "kalshi"; orderId: ExchangeOrderId; asset: KalshiPair; } | { venue: "qfex"; orderId: ExchangeOrderId; asset: QfexSymbol; } | { venue: "polymarketPerps"; orderId: PolymarketPerpsOrderIdCancelTarget; })) | (ProposedOrder & { kind: "order"; }) | ({ kind: "account"; } & { venue: "hyperliquid"; account: HyperliquidAccountChange; }) | ({ kind: "close"; } & { venue: "papertrade"; positionIds: Array; }) | ({ kind: "stake"; } & { venue: "papertrade"; amount: PositiveDecimal; }) | ({ kind: "unstake"; } & { venue: "papertrade"; amount: PositiveDecimal; }) | ({ kind: "claim"; } & { venue: "papertrade"; }) | ({ kind: "redeem"; } & { venue: "polymarket"; asset: RawAmount; }) | ({ kind: "positionChange"; } & { venue: "polymarket"; change: PolymarketPositionChange; }); type RequestOf = Kind extends `${infer Verb}:${infer Venue}` ? MatchesVenue, Venue> : Extract; type KindOf = Request extends { venue: infer Venue extends string; } ? `${Request["kind"]}:${Venue}` & ActionKind : Request["kind"] & ActionKind; type PolymarketDiscoverRail = "economy" | "endingSoon" | "geopolitics" | "mostAtStake" | "mostTalkedAbout" | "politics" | "popCulture" | "sports" | "tooCloseToCall" | "trending" | "volume"; type PolymarketSearchEventsData = EventRef[]; type PolymarketResolvedEvent = { slug: string; title: string; imageUrl: (string | null); openInterestPusd: (PositiveDecimal | null); markets: Array; }; type PolymarketMarketLookup = { question: string; slug: string; sportsMarketType: (string | null); groupItemTitle: (string | null); negRisk: boolean; line: (number | null); gameStartTime: (string | null); endDate: (string | null); liquidityPusd: NonnegativeDecimal; volume24hPusd: NonnegativeDecimal; dayChangePercent: (number | null); updatedAt: (string | null); outcomes: Array; imageUrl: (string | null); eventUrl: (string | null); eventTitle: (string | null); description: (string | null); acceptingOrders: boolean; resolving: boolean; minimumNotional: (PositiveDecimal | null); priceTick: (PositiveDecimal | null); minimumSize: (NonnegativeDecimal | null); takerFee: (TakerFee | null); }; type PolymarketPricePoint = { timestamp: Timestamp; pricePusd: PricePusd; }; type PolymarketRedeemRequest = { asset: string; }; type PolymarketRedeemPositionsData = { redeemed: Array; }; type Network = "derive" | "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901" | "hypercore" | "lighter" | "lighter-robinhood" | "papertrade" | "polymarket-perps" | "solana"; type SettingVal = string | number | boolean; type SettingKind = "address" | "boolean" | "integer" | "number" | "percentage" | "single_select" | "text"; type TradeVenue = "chain" | "derive" | "hyperliquid" | "lighter" | "lighterRobinhood" | "papertrade" | "polymarketPerps"; type WalletTrade = { venue: "chain"; network: WatchedNetwork; transaction: string; sold: Array; bought: Array; boughtOn: WatchedNetwork; recipient: string; } | { venue: "hyperliquid"; asset: PerpCoin; side: OrderSide; size: PositiveDecimal; price: PositiveDecimal; at: Timestamp; id: string; positionAfter: Decimal; } | { venue: "papertrade"; action: PapertradeAction; positionId: PositionId; asset: PerpCoin; side: PerpSide; size: PositiveDecimal; entryPrice: PositiveDecimal; leverage: number; } | (InstrumentVenueFill & { venue: "derive"; }) | (PolymarketPerpsSymbolVenueFill & { venue: "polymarketPerps"; }) | (SymbolVenueFill & { venue: "lighter"; }) | (SymbolVenueFill & { venue: "lighterRobinhood"; }); type WakeupSpec = { kind: "timer"; name?: string | undefined; at?: Timestamp | undefined; everyMs?: number | undefined; afterMs?: number | undefined; expiresAt?: Timestamp | undefined; } | { kind: "price"; name?: string | undefined; asset: string; network?: Network | undefined; gte?: PositiveDecimal | undefined; lte?: PositiveDecimal | undefined; crosses?: PositiveDecimal | undefined; expiresAt?: Timestamp | undefined; } | { kind: "fill"; name?: string | undefined; venue?: Venue | undefined; asset?: string | undefined; expiresAt?: Timestamp | undefined; } | { kind: "resolution"; name?: string | undefined; assetKey: string; expiresAt?: Timestamp | undefined; } | { kind: "news"; name?: string | undefined; prompt: string; expiresAt?: Timestamp | undefined; } | { kind: "walletTrade"; name?: string | undefined; address: string; network?: WatchedNetwork | undefined; expiresAt?: Timestamp | undefined; } | { kind: "webhook"; name?: string | undefined; provider: WebhookProvider; expiresAt?: Timestamp | undefined; } | { kind: "operation"; name?: string | undefined; operationId: string; expiresAt?: Timestamp | undefined; }; type WatchKeys = W extends unknown ? keyof W : never; type WatchVal = W extends unknown ? K extends keyof W ? Exclude : never : never; type Timestamp = string; type Decimal = string; type WatchedNetwork = "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901" | "solana"; type WebhookProvider = "polysights"; type OperationStatus = "dismissed" | "error" | "expired" | "pending" | "review" | "success" | "unproven"; type OperationFailure = { code: FailureCode; message: string; detail?: FailureDetail | undefined; cause?: string | undefined; }; type EvmAddress = string; type RawAmount = string; type HexBytes = string; type OnceNameInput = string; type PerInput = "day" | "hour" | "week"; type Reference = { network: string; referenceKind: ReferenceKind; referenceValue: string; observationIndex: (number | null); position: (string | null); }; type PolymarketOrderKind = "spotBuy" | "spotSell"; type OrderAmount = AllOrSize | AllOrValue; type PolymarketExecution = { kind: "market"; } | { kind: "limit"; price: PricePusd; timeInForce: TimeInForce; expiresAt?: Timestamp | undefined; }; type LegRole = "circuit_fee" | "funding" | "network_fee" | "perp_settlement" | "principal" | "realized_pnl"; type SolanaBytes = { hexTransaction: NonEmptyHexBytes; }; type SolanaInstructions = { instructions: Array; }; type FailureDetail = { kind: "ACCOUNT_SETUP_REQUIRED"; requirement: AccountRequirement; } | { kind: "ACCOUNT_FUNDING_REQUIRED"; requirement: AccountRequirement; }; type ErrorContext = { code: "MARKET_NOT_CATALOGED"; venue: string; dex: (string | null); venueSymbols: Array; }; type MoneyFailure = { stage: "preparation"; operationId: (Never | null); } | { stage: "execution"; operationId: string; }; type ExchangeOrderId = string; type BinancePair = string; type BookOrderProposal = { kind: "perpOpen"; asset: string; side: PerpSide; amount: OrderAmount; execution?: OrderExecution | undefined; takeProfit?: PositiveDecimalExit | undefined; stopLoss?: PositiveDecimalExit | undefined; message?: OrderMessage | undefined; margin?: PerpMargin | undefined; } | { kind: "perpReduce"; asset: string; expectedSide?: PerpSide | undefined; amount: OrderAmount; execution?: OrderExecution | undefined; message?: OrderMessage | undefined; } | { kind: "spotBuy"; asset: string; amount: OrderAmount; execution?: OrderExecution | undefined; message?: OrderMessage | undefined; } | { kind: "spotSell"; asset: string; amount: OrderAmount; execution?: OrderExecution | undefined; message?: OrderMessage | undefined; } | { kind: "optionBuy"; asset: OptionName; amount: PositiveDecimalSize; execution?: OrderExecution | undefined; reduceOnly?: boolean | undefined; message?: OrderMessage | undefined; } | { kind: "optionSell"; asset: OptionName; amount: PositiveDecimalSize; execution?: OrderExecution | undefined; reduceOnly?: boolean | undefined; message?: OrderMessage | undefined; }; type BybitPair = string; type CoinbasePair = string; type AssetReferenceInput = string | TokenFieldsInput; type FundamentalsVendor = "coingecko" | "coingecko-rwa" | "defillama"; type DataAssetType = "bond" | "coin" | "commodity" | "etf" | "fiat" | "perpetual" | "prediction" | "stock" | "vault"; type FigureInput = "circulatingSupply" | "fullyDilutedValuation" | "marketCap" | "maxSupply" | "price" | "totalSupply" | "volume"; type SortOrderInput = "asc" | "desc"; type FundamentalsRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type FundamentalsRow = { asset: string; vendor: FundamentalsVendor; vendorKey: string; denominationAsset: string; denominationSymbol: string; day: string; firstObservedAt: Timestamp; volume: (Decimal | null); price: (Decimal | null); marketCap: (Decimal | null); fullyDilutedValuation: (Decimal | null); circulatingSupply: (Decimal | null); totalSupply: (Decimal | null); maxSupply: (Decimal | null); } | { asset: string; vendor: FundamentalsVendor; symbol: string; denominationAsset: string; denominationSymbol: string; observedDayCount: number; vendorKey: string; volume: (Decimal | null); price: (Decimal | null); marketCap: (Decimal | null); fullyDilutedValuation: (Decimal | null); circulatingSupply: (Decimal | null); totalSupply: (Decimal | null); maxSupply: (Decimal | null); }; type Venue = "binance" | "bybit" | "coinbase" | "derive" | "hyperliquid" | "kalshi" | "kraken" | "lighter" | "lighterRobinhood" | "okx" | "papertrade" | "polymarket" | "polymarketPerps" | "qfex"; type AssetRowIdentityPage = { rows: Array; nextCursor: (string | null); }; type AssetRow = { id: string; symbol: string; name: string; assetType: DataAssetType; underlyingAsset: (string | null); venueIdentifiers: Array; vendorIdentifiers: Array; categoryKeys: Array; contracts: Array; }; type CalendarKind = "earnings" | "filing" | "governance" | "hack" | "unlock"; type DataCalendarRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type DataCalendarRow = { vendor: string; kind: CalendarKind; subject: string; name?: string | undefined; day: string; firstObservedAt: Timestamp; asset?: string | undefined; unlockType?: string | undefined; recipient?: string | undefined; category?: string | undefined; amount?: Decimal | undefined; weeklyRate?: Decimal | undefined; linearEndDay?: string | undefined; fiscalYear?: number | undefined; fiscalPeriod?: string | undefined; dateStatus?: string | undefined; session?: string | undefined; amountUsd?: Decimal | undefined; returnedUsd?: Decimal | undefined; technique?: string | undefined; classification?: string | undefined; form?: string | undefined; reportDay?: string | undefined; documentUrl?: string | undefined; description?: string | undefined; status?: string | undefined; platform?: string | undefined; }; type DataCategoryRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type DataCategoryRow = { vendor: FundamentalsVendor; categoryKey: string; name: (string | null); denominationAsset: string; denominationSymbol: string; day: string; firstObservedAt: Timestamp; marketCap: (Decimal | null); volume: (Decimal | null); }; type FundingRateRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type FundingRateRow = { venue: Venue; dex: string; venueSymbol: string; settlesAt: Timestamp; fundingRate: Decimal; }; type MarketSortByInput = "cumulativeFundingRate" | "fundingRate" | "medianDailyVolumeUsd" | "openInterestUsd" | "volumeUsd"; type DataMarketRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type MetricSubjectKind = "bridge" | "category" | "category_trailing" | "chain" | "chain_trailing" | "equity" | "etf" | "exchange" | "liquidation" | "protocol" | "protocol_trailing" | "stablecoin" | "sub_protocol" | "total"; type MetricSortByInput = "aggregatorVolume" | "borrowedTvl" | "bridgeDeposits" | "bridgeInflows" | "bridgeVolume" | "bridgeWithdrawals" | "chainFees" | "chainFees30d" | "chainFees7d" | "chainRevenue" | "collateralUsd" | "dexVolume" | "dexVolume30d" | "dexVolume7d" | "dividendYield" | "etfFlow" | "evToEbitda" | "fees" | "fees30d" | "fees7d" | "fullyDilutedValuation" | "holdersRevenue" | "holdersRevenue30d" | "holdersRevenue7d" | "holdersYield" | "incentives" | "liquidatable10pct" | "liquidatable25pct" | "liquidatable5pct" | "marketCap" | "marketDepth" | "newUsers" | "openInterest" | "optionsNotionalVolume" | "optionsVolume" | "perpAggregatorVolume" | "perpVolume" | "pool2Tvl" | "price" | "priceToBook" | "priceToFees" | "priceToRevenue" | "revenue" | "revenue30d" | "revenue7d" | "spotVolume" | "stablecoinSupply" | "stakingTvl" | "trailingPe" | "transactions" | "treasuryTvl" | "tvl" | "tvlChange30d" | "tvlChange7d" | "users" | "vestingTvl"; type DataMetricRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type DataMetricRow = { vendor: string; subjectKind: MetricSubjectKind; subject: string; name?: string | undefined; parent?: string | undefined; category?: string | undefined; day: string; firstObservedAt: Timestamp; token?: string | undefined; asset?: string | undefined; protocolCount?: number | undefined; tvl?: Decimal | undefined; stakingTvl?: Decimal | undefined; borrowedTvl?: Decimal | undefined; pool2Tvl?: Decimal | undefined; treasuryTvl?: Decimal | undefined; vestingTvl?: Decimal | undefined; dexVolume?: Decimal | undefined; aggregatorVolume?: Decimal | undefined; perpVolume?: Decimal | undefined; perpAggregatorVolume?: Decimal | undefined; optionsVolume?: Decimal | undefined; optionsNotionalVolume?: Decimal | undefined; fees?: Decimal | undefined; revenue?: Decimal | undefined; holdersRevenue?: Decimal | undefined; incentives?: Decimal | undefined; openInterest?: Decimal | undefined; chainFees?: Decimal | undefined; chainRevenue?: Decimal | undefined; bridgeInflows?: Decimal | undefined; stablecoinSupply?: Decimal | undefined; etfFlow?: Decimal | undefined; bridgeDeposits?: Decimal | undefined; bridgeWithdrawals?: Decimal | undefined; bridgeVolume?: Decimal | undefined; spotVolume?: Decimal | undefined; marketDepth?: Decimal | undefined; price?: Decimal | undefined; marketCap?: Decimal | undefined; trailingPe?: Decimal | undefined; priceToBook?: Decimal | undefined; priceToRevenue?: Decimal | undefined; evToEbitda?: Decimal | undefined; dividendYield?: Decimal | undefined; holdersYield?: Decimal | undefined; collateralUsd?: Decimal | undefined; liquidatable5pct?: Decimal | undefined; liquidatable10pct?: Decimal | undefined; liquidatable25pct?: Decimal | undefined; fullyDilutedValuation?: Decimal | undefined; fees7d?: Decimal | undefined; fees30d?: Decimal | undefined; revenue7d?: Decimal | undefined; revenue30d?: Decimal | undefined; holdersRevenue7d?: Decimal | undefined; holdersRevenue30d?: Decimal | undefined; priceToFees?: Decimal | undefined; tvlChange7d?: Decimal | undefined; tvlChange30d?: Decimal | undefined; chainFees7d?: Decimal | undefined; chainFees30d?: Decimal | undefined; dexVolume7d?: Decimal | undefined; dexVolume30d?: Decimal | undefined; users?: Decimal | undefined; newUsers?: Decimal | undefined; transactions?: Decimal | undefined; }; type OpenInterestRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type OpenInterestRow = { venue: Venue; dex: string; venueSymbol: string; timestamp: Timestamp; openInterestBase: (Decimal | null); }; type PoolTokenReferenceInput = string | TokenFieldsInput; type NonnegativeDecimal = string; type PoolSortByInput = "createdAt" | "liquidityUsd" | "priceChangeInWindow" | "tradeCount" | "volumeQuote" | "volumeUsd"; type PoolRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type PricedNetworkInput = "derive" | "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901" | "hypercore" | "lighter" | "lighter-robinhood" | "papertrade" | "polymarket-perps" | "solana" | PricedExchangeInput; type GrainInput = "15m" | "1d" | "1h" | "1m" | "4h" | "5m"; type YieldVendor = "defillama"; type YieldKind = "advertised" | "measured"; type YieldSortByInput = "apyExcludingRewards" | "apyIncludingRewards" | "apyVolatility" | "totalValueLockedUsd"; type YieldRowPage = { rows: Array; nextCursor: (string | null); ageMs: (number | null); }; type YieldRow = { vendor: YieldVendor; pool: string; yieldKind: YieldKind; protocol: string; network: Network; label: string; depositToken: (TokenSeen | null); depositAsset: (string | null); stablecoinOnly: boolean; singleAssetExposure: boolean; impermanentLossRisk: boolean; constituents: Array; day: string; firstObservedAt: Timestamp; apyIncludingRewards: (Decimal | null); apyExcludingRewards: (Decimal | null); totalValueLockedUsd: (Decimal | null); withdrawalOutcome: (WithdrawalOutcome | null); withdrawalEtaMs: (number | null); withdrawableUsd: (Decimal | null); withdrawalSlippagePercent: (Decimal | null); measurementConfidence: (MeasurementConfidence | null); borrowApy: (Decimal | null); borrowRewardApy: (Decimal | null); totalBorrowedUsd: (Decimal | null); availableBorrowUsd: (Decimal | null); loanToValue: (Decimal | null); exploited: (boolean | null); apyVolatility: (Decimal | null); holderCount: (number | null); topHoldersShare: (Decimal | null); offPegToken: (string | null); pegDeviation: (Decimal | null); }; type Perp = string; type OptionListing = { asset: OptionName; expiresAt: Timestamp; strike: PositiveDecimal; optionType: OptionType; minimumSize: PositiveDecimal; sizeStep: PositiveDecimal; priceTick: PositiveDecimal; quote: (OptionQuote | null); }; type NonceCancelTarget = string; type VaultListing = { vault: number; name: string; description: (string | null); depositAsset: string; navUsd: NonnegativeDecimal; sharePriceUsd: NonnegativeDecimal; closed: boolean; }; type Exchange = "binance" | "bybit" | "coinbase" | "kalshi" | "kraken" | "okx" | "qfex"; type ExchangeMarket = { asset: string; nativeId: string; base: string; quote: string; tradable: boolean; minimumSize: string; minimumNotional: string; priceTick: string; sizeStep: string; }; type FomoWindow = "24h" | "30d" | "7d" | "all"; type RankedTrader = { handle: string; wallets: FomoWallets; rank: number; pnlUsd: Pnl; volumeUsd: Notional; trades: number; }; type FomoWallets = { evm?: string | undefined; solana?: string | undefined; }; type HyperliquidAccountChange = { kind: "isolatedMargin"; asset: string; change: MarginChange; amountUsdc: PositiveDecimal; } | { kind: "staking"; change: FundsChange; amount: PositiveDecimal; } | { kind: "delegation"; change: DelegationChange; validator: UncheckedEvmAddress; amount: PositiveDecimal; } | { kind: "vault"; vault: UncheckedEvmAddress; change: FundsChange; amountUsdc: PositiveDecimal; } | { kind: "scheduleCancel"; at: (Timestamp | null); } | { kind: "move"; from: CoreBalance; to: CoreBalance; amount: PositiveDecimal; }; type OrderIdCancelTarget = string; type HyperliquidOutcome = { asset: string; outcome: number; side: number; question: (number | null); name: string; description: string; sideName: string; mid: (string | null); }; type HyperliquidSpotMarket = { asset: string; baseToken: number; quoteToken: number; baseSymbol: string; quoteSymbol: string; }; type Series = { ticker: string; title: string; category: string; volume: string; }; type Event = { eventTicker: string; title: string; subTitle: string; url: string; markets: Array; }; type KalshiPair = string; type ValueUsdLendingAccountChange = ValueUsdLendingAccountChangeByMarket | ValueUsdLendingAccountChangeByPosition; type LendingProtocol = "aave" | "aave-v4" | "euler" | "kamino" | "morpho" | "spark"; type MarketRow = { protocol: LendingProtocol; market: Market; name: string; asset: Asset; symbol: (string | null); decimals: number; canSupply: boolean; canBorrow: boolean; supplyApr: (Decimal | null); borrowApr: (Decimal | null); loanToValue: (Decimal | null); liquidationLoanToValue: (Decimal | null); collateral: Array; categories: Array; }; type Unavailable = { protocol: LendingProtocol; market: (Market | null); error: string; }; type ValueUsdBorrow = ValueUsdBorrowByMarket | ValueUsdBorrowByPosition; type ValueUsdRepay = { network: Network; position: Position; amount: ValueUsdExitAmount; payWith?: PayWith | undefined; }; type ValueUsdSupply = ValueUsdSupplyByMarket | ValueUsdSupplyByPosition; type ValueUsdWithdraw = { network: Network; position: Position; amount: ValueUsdExitAmount; }; type LighterMarginChange = { kind: "isolatedMargin"; asset: string; change: MarginChange; amountUsdc: PositiveDecimal; } | { kind: "routeTransfer"; to: LighterRoute; amountUsdc: PositiveDecimal; }; type LighterOrderIdCancelTarget = string; type EvmNetwork = "ethereum:1" | "ethereum:10" | "ethereum:137" | "ethereum:143" | "ethereum:42161" | "ethereum:4663" | "ethereum:5042" | "ethereum:56" | "ethereum:57073" | "ethereum:747474" | "ethereum:8453" | "ethereum:999" | "ethereum:99901"; type MetricInput = "metric"; type MetricPool = { pool: UncheckedEvmAddress; }; type Span = { lowerPercent: Decimal; upperPercent: Decimal; currentBin: Range; }; type LiquidityAction = { network: EvmNetwork; action: Action; }; type MemoryKey = string; type MemoryValue = { key: MemoryKey; updatedAt: Timestamp; value: string; }; type MemoryItem = { key: MemoryKey; updatedAt: Timestamp; }; type OkxPair = string; type CursorInput = string; type AgentOperationRow = { status: OperationStatus; operationId: string; readError?: string | undefined; kind: ActionKind; request: unknown; receipts: Array; createdAt: Timestamp; deadlineAt: (Timestamp | null); finishedAt: (Timestamp | null); error: unknown; result: unknown; action: (MoneyAction | null); threadId: (string | null); walletId: (number | null); }; type MoneyAction = { kind: "swap"; swap: SwapAction; } | { kind: "transfer"; transfer: TransferAction; } | { kind: "lendingSupply"; lending: Move; } | { kind: "lendingWithdraw"; lending: Move; } | { kind: "lendingBorrow"; lending: Move; } | { kind: "lendingRepay"; lending: Move; } | { kind: "lendingAccount"; account: PinnedAccountChange; } | { kind: "evmTx"; evm: EvmMoneyAction; } | { kind: "solanaTx"; solana: SolanaMoneyAction; } | { kind: "liquidity"; liquidity: LiquidityAction; } | { kind: "rewardsClaim"; network: EvmNetwork; claim: RewardClaim; } | ({ kind: "setup"; } & ({ venue: "hyperliquid"; } | { venue: "lighter"; } | { venue: "lighterRobinhood"; } | { venue: "derive"; } | { venue: "papertrade"; } | { venue: "polymarket"; } | { venue: "polymarketPerps"; })) | ({ kind: "margin"; } & ({ venue: "lighter"; margin: LighterMarginChangeOrLeverage; } | { venue: "lighterRobinhood"; margin: LighterMarginChangeOrLeverage; } | { venue: "polymarketPerps"; margin: PerpLeverage; })) | ({ kind: "withdraw"; } & ({ venue: "kraken"; withdrawal: KrakenWithdrawal; } | { venue: "qfex"; withdrawal: EvmWithdrawal; } | { venue: "polymarketPerps"; withdrawal: EvmWithdrawal; })) | ({ kind: "cancel"; } & ({ venue: "hyperliquid"; orderId: OrderIdCancelTarget; } | { venue: "lighter"; orderId: LighterOrderIdCancelTarget; } | { venue: "lighterRobinhood"; orderId: LighterOrderIdCancelTarget; } | { venue: "derive"; orderId: NonceCancelTarget; } | { venue: "polymarket"; orderId: PolymarketOrderId; } | { venue: "kraken"; orderId: ExchangeOrderId; } | { venue: "coinbase"; orderId: ExchangeOrderId; asset: CoinbasePair; } | { venue: "okx"; orderId: ExchangeOrderId; asset: OkxPair; } | { venue: "binance"; orderId: ExchangeOrderId; asset: BinancePair; } | { venue: "bybit"; orderId: ExchangeOrderId; asset: BybitPair; } | { venue: "kalshi"; orderId: ExchangeOrderId; asset: KalshiPair; } | { venue: "qfex"; orderId: ExchangeOrderId; asset: QfexSymbol; } | { venue: "polymarketPerps"; orderId: PolymarketPerpsOrderIdCancelTarget; })) | (PinnedOrder & { kind: "order"; }) | ({ kind: "account"; } & { venue: "hyperliquid"; account: HyperliquidAccountChangeOrLeverage; }) | ({ kind: "close"; } & { venue: "papertrade"; positionIds: Array; }) | ({ kind: "stake"; } & { venue: "papertrade"; amount: PositiveDecimal; }) | ({ kind: "unstake"; } & { venue: "papertrade"; amount: PositiveDecimal; }) | ({ kind: "claim"; } & { venue: "papertrade"; }) | ({ kind: "redeem"; } & { venue: "polymarket"; asset: RawAmount; }) | ({ kind: "positionChange"; } & { venue: "polymarket"; change: PolymarketPositionChange; }); type VenueUuidOpenVenueOrder = { orderId: string; asset: string; side: OrderSide; limitPrice: PositiveDecimal; size: PositiveDecimal; filled: NonnegativeDecimal; averageFillPrice: (PositiveDecimal | null); reduceOnly: boolean; venue: Venue; operationId: string; placedAt: string; entryOperationId: (string | null); entryOrderId: (string | null); type: OrderType; triggerPrice: (PositiveDecimal | null); }; type OrderError = { operationId: string; error: string; }; type HeadroomRow = { asset: PerpCoin; errors: Array; long: (NonnegativeDecimal | null); short: (NonnegativeDecimal | null); }; type PapertradeMarket = { asset: PerpCoin; paused: Paused; minimumMargin: NonnegativeDecimal; minimumNotional: NonnegativeDecimal; minimumStake: NonnegativeDecimal; maximumNotional: (NonnegativeDecimal | null); maximumLeverage: (number | null); headroom: (Headroom | null); bustBuffer: (NonnegativeDecimal | null); winFeeRate: (NonnegativeDecimal | null); impact: (Impact | null); errors: Array; }; type PositiveDecimal = string; type PositionId = string; type PapertradeOrderProposal = { asset: PerpCoin; side: PerpSide; amount: PositiveDecimalValue; leverage: PapertradeLeverage; fundFrom?: FundFrom | undefined; }; type DiscoverRailInput = "economy" | "endingSoon" | "geopolitics" | "mostAtStake" | "mostTalkedAbout" | "politics" | "popCulture" | "sports" | "tooCloseToCall" | "trending" | "volume"; type ResolvedEvent = { slug: string; title: string; imageUrl: (string | null); openInterestPusd: (PositiveDecimal | null); markets: Array; }; type ResolvedMarket = { question: string; slug: string; sportsMarketType: (string | null); groupItemTitle: (string | null); negRisk: boolean; line: (number | null); gameStartTime: (string | null); endDate: (string | null); liquidityPusd: NonnegativeDecimal; volume24hPusd: NonnegativeDecimal; dayChangePercent: (number | null); updatedAt: (string | null); outcomes: Array; imageUrl: (string | null); }; type EventRef = { slug: string; title: string; startDate: (string | null); }; type PolymarketOutcome = { name: string; asset: RawAmount; pricePusd: PricePusd; }; type TakerFee = { rate: NonnegativeDecimal; exponent: number; }; type PricePusd = string; type ScreenOrderInput = "competitive" | "endDate" | "lastTradePrice" | "liquidityNum" | "spread" | "startDate" | "volume24hr" | "volumeNum"; type ScreenEvent = { slug: (string | null); outcomes: Array; }; type PolymarketOrderId = string; type PolymarketQuote = { price: string; signedSharesChange: string; expectedPusdAmount: string; }; type PolymarketPositionChange = { kind: "split"; asset: RawAmount; amountPusd: PositiveDecimal; } | { kind: "merge"; asset: RawAmount; shares: PositiveDecimal; } | { kind: "convert"; assets: Array; shares: PositiveDecimal; }; type ChartWindowInput = "1d" | "1yr" | "30d" | "7d" | "all"; type PricePoint = { timestamp: Timestamp; pricePusd: PricePusd; }; type PolymarketPerpsOrderIdCancelTarget = string; type PortfolioHolding = { network: string; assetKey: string; asset: string; symbol: (string | null); kind: string; quantity: string; priceUsd: (string | null); valueUsd: (string | null); side: (string | null); protocol: (string | null); }; type QfexSymbol = string; type RewardClaim = { protocol: "merkl"; tokens?: Array | undefined; } | { protocol: "aero-slipstream"; pool: EvmAddress; }; type Reward = { network: Network; claim: RewardClaim; asset: string; symbol: (string | null); claimable: Decimal; }; type SolanaAddress = string; type SolanaToken = { mint: SolanaAddress; amount: PositiveDecimal; decimals: number; }; type UnreadableMint = { mint: SolanaAddress; reason: string; }; type ValueUsdSwap = { from: NetworkAsset; to: SwapDestination; amount: ValueUsdAmount; minimumReceive?: PositiveDecimal | undefined; slippage?: Percentage | undefined; engines?: Engines | undefined; confidential?: boolean | undefined; toWalletId?: number | undefined; }; type LedgerCursorInput = string; type ValueUsdTransfer = { from: NetworkAsset; amount: ValueUsdAmount; to: TransferTo; }; type Eip712TypedDataInput = { domain: Eip712DomainInput; types: Record>; primaryType: string; message: Record; }; type Eip191MessageInput = { message: string; }; type PerpSide = "long" | "short"; type OrderExecution = { kind: "market"; slippage?: MidSlippage | undefined; } | { kind: "limit"; price: PositiveDecimal; timeInForce: TimeInForce; expiresAt?: Timestamp | undefined; } | { kind: "takeProfit"; triggerPrice: PositiveDecimal; } | { kind: "stopLoss"; triggerPrice: PositiveDecimal; } | { kind: "takeProfitLimit"; triggerPrice: PositiveDecimal; price: PositiveDecimal; } | { kind: "stopLossLimit"; triggerPrice: PositiveDecimal; price: PositiveDecimal; }; type OrderMessage = string; type PositiveDecimalExit = { triggerPrice: PositiveDecimal; price?: PositiveDecimal | undefined; }; type PerpMargin = { mode: MarginMode; leverage?: Leverage | undefined; }; type NetworkAsset = { network: "solana"; asset: string; } | { network: "hypercore"; asset: string; } | { network: "lighter"; asset: string; } | { network: "lighter-robinhood"; asset: string; } | { network: "papertrade"; asset: string; } | { network: "derive"; asset: string; } | { network: "polymarket-perps"; asset: string; } | { network: ("ethereum:1" | "ethereum:42161" | "ethereum:137" | "ethereum:10" | "ethereum:8453" | "ethereum:56" | "ethereum:143" | "ethereum:999" | "ethereum:4663" | "ethereum:5042" | "ethereum:57073" | "ethereum:747474" | "ethereum:99901"); asset: string; }; type SwapDestination = StockDestination | NetworkAsset; type ValueUsdAmount = string | ProposalBalancePercent | ValueUsd; type Percentage = string; type Engines = SwapProvider[]; type TransferTo = AddressTarget | KrakenTarget | ProposalWalletTarget | QfexTarget; type MoneyActionResults = { swap: Received; transfer: null; liquidity: null; lendingSupply: null; lendingWithdraw: null; lendingBorrow: null; lendingRepay: null; lendingAccount: null; rewardsClaim: null; evmTx: null; solanaTx: null; "order:hyperliquid": VenueOrder; "order:lighter": VenueOrder; "order:lighterRobinhood": VenueOrder; "order:derive": VenueOrder; "order:papertrade": VenueOrder; "order:polymarket": VenueOrder; "order:kraken": VenueOrder; "order:coinbase": VenueOrder; "order:binance": VenueOrder; "order:okx": VenueOrder; "order:bybit": VenueOrder; "order:kalshi": VenueOrder; "order:qfex": VenueOrder; "order:polymarketPerps": VenueOrder; "cancel:hyperliquid": Canceled; "cancel:lighter": Canceled; "cancel:lighterRobinhood": Canceled; "cancel:derive": Canceled; "cancel:polymarket": Canceled; "cancel:kraken": Canceled; "cancel:coinbase": Canceled; "cancel:okx": Canceled; "cancel:binance": Canceled; "cancel:bybit": Canceled; "cancel:kalshi": Canceled; "cancel:qfex": Canceled; "cancel:polymarketPerps": Canceled; "setup:hyperliquid": null; "setup:lighter": null; "setup:lighterRobinhood": null; "setup:derive": null; "setup:papertrade": null; "setup:polymarket": DepositWallet; "setup:polymarketPerps": null; "account:hyperliquid": null; "margin:lighter": null; "margin:lighterRobinhood": null; "margin:polymarketPerps": null; "close:papertrade": VenueOrders; "stake:papertrade": null; "unstake:papertrade": null; "claim:papertrade": ClaimResult; "redeem:polymarket": Redeemed; "positionChange:polymarket": null; "withdraw:kraken": Withdrawal; "withdraw:qfex": Withdrawal; "withdraw:polymarketPerps": Withdrawal; }; type AgentAssetChange = { asset: (string | null); symbol: (string | null); decimals: (number | null); diff: SignedInteger; }; type TransferType = "derive" | "evm" | "hypercore" | "lighter" | "lighter-robinhood" | "solana"; type QuoteAsset = { network: Network; asset: string; walletAddress: WalletAddress; name: string; symbol: string; decimals: number; amountRaw: PositiveRawAmount; amount: string; minimumAmountRaw?: PositiveRawAmount | undefined; minimumAmount?: PositiveDecimal | undefined; amountUsd?: Usd | undefined; }; type Fee = { kind: FeeKind; amountRaw?: RawAmount | undefined; amount?: NonnegativeDecimal | undefined; symbol?: string | undefined; asset?: string | undefined; amountUsd?: Decimal | undefined; }; type QuoteCandidate = { engine: SwapProvider; amount: PositiveDecimal; amountUsd?: Usd | undefined; selected: boolean; }; type QuoteFreshness = { issuedAtMs: number; ttlMs: number; }; type Staking = { delegated: NonnegativeDecimal; undelegated: NonnegativeDecimal; pendingWithdrawal: NonnegativeDecimal; }; type VaultEquity = { vault: EvmAddress; equityUsdc: NonnegativeDecimal; lockedUntil: (Timestamp | null); }; type AssetError = { asset: Unread; error: string; }; type PapertradePosition = { positionId: PositionId; asset: PerpCoin; side: PerpSide; size: PositiveDecimal; margin: NonnegativeDecimal; leverage: number; entryPrice: PositiveDecimal; liquidationPrice: NonnegativeDecimal; openedAt: Timestamp; }; type PaperHoldings = { balance: NonnegativeDecimal; staked: NonnegativeDecimal; rewards: NonnegativeDecimal; }; type ClosedPosition = { positionId: PositionId; asset: PerpCoin; side: PerpSide; exitPrice: PositiveDecimal; pnl: Decimal; paperMinted: NonnegativeDecimal; liquidated: boolean; }; type Never = never; type ProposedOrder = BookOrderRequest | PapertradeOrderRequest | PolymarketOrderRequest; type MatchesVenue = A extends { venue: infer AV } ? V extends AV ? A : never : never; type RedeemedPosition = { asset: RawAmount; conditionId: (string | null); shares: string; formattedShares: string; question: (string | null); outcome: (string | null); }; type WalletMovement = { asset: string; amount: PositiveDecimal; }; type PerpCoin = string; type OrderSide = "buy" | "sell"; type PapertradeAction = "close" | "open"; type InstrumentVenueFill = { asset: Instrument; side: OrderSide; size: PositiveDecimal; price: PositiveDecimal; at: Timestamp; id: string; }; type PolymarketPerpsSymbolVenueFill = { asset: PolymarketPerpsSymbol; side: OrderSide; size: PositiveDecimal; price: PositiveDecimal; at: Timestamp; id: string; }; type SymbolVenueFill = { asset: Symbol; side: OrderSide; size: PositiveDecimal; price: PositiveDecimal; at: Timestamp; id: string; }; type FailureCode = "ACCOUNT_FUNDING_REQUIRED" | "ACCOUNT_SETUP_REQUIRED" | "AGENT_FAILED" | "AGENT_RUN_ALREADY_OPEN" | "AGENT_TRANSACTION_REVERTED" | "BACKTEST_UNSUPPORTED" | "BAD_REQUEST" | "BELOW_MINIMUM" | "CANCELED" | "CAPACITY_EXHAUSTED" | "CIRCUIT_UPDATING" | "CLIENT_OUTDATED" | "CONFLICT" | "CREDENTIAL_REFUSED" | "EMBEDDED_MODE_UNSUPPORTED" | "FORBIDDEN" | "INSUFFICIENT_BALANCE" | "INSUFFICIENT_GAS" | "INTERNAL_ERROR" | "INTERNAL_SERVER_ERROR" | "INVALID_INPUT" | "LIFECYCLE_TIMEOUT" | "MARGIN_TIERS_CHANGED" | "MARKET_NOT_CATALOGED" | "NOT_FOUND" | "NO_ACTIVE_SESSION" | "NO_ROUTE_AVAILABLE" | "OPEN_INTEREST_CAP" | "POLYMARKET_FUNDING_REQUIRED" | "PRICE_IMPACT_TOO_HIGH" | "PROVIDER_RATE_LIMITED" | "PROVIDER_UNAVAILABLE" | "PROVIDER_UNREACHABLE" | "QUERY_TIMEOUT" | "QUOTE_FLOOR_NOT_MET" | "QUOTE_STALE" | "RUNTIME_UNAVAILABLE" | "SERVICE_UNAVAILABLE" | "SESSION_ORDER_OWNERSHIP" | "SIGNING_FAILED" | "SIMULATION_FAILED" | "SLIPPAGE_EXCEEDED" | "SUBMISSION_REJECTED" | "SUBMISSION_UNCERTAIN" | "SWAP_SETTLEMENT_FAILED" | "TOO_MANY_REQUESTS" | "TRANSACTION_REVERTED" | "TURN_TIMED_OUT" | "UNANSWERED" | "UNAUTHORIZED" | "VENUE_PAUSED" | "WALLET_UNAVAILABLE"; type ReferenceKind = "binance_cancel_order_id" | "binance_client_order_id" | "binance_order_id" | "binance_trade_id" | "bybit_cancel_order_id" | "bybit_client_order_id" | "bybit_order_id" | "bybit_trade_id" | "coinbase_cancel_order_id" | "coinbase_client_order_id" | "coinbase_order_id" | "coinbase_trade_id" | "derive_action_nonce" | "derive_cancel_order_id" | "derive_operation_id" | "derive_order_id" | "derive_trade_id" | "evm_balance_diff" | "evm_transaction_hash" | "hyperliquid_account_mode" | "hyperliquid_builder_fee" | "hyperliquid_cancel_order_id" | "hyperliquid_client_order_id" | "hyperliquid_fill_id" | "hyperliquid_order_id" | "hyperliquid_transaction_hash" | "hyperliquid_transfer_nonce" | "kalshi_cancel_order_id" | "kalshi_client_order_id" | "kalshi_order_id" | "kalshi_trade_id" | "kraken_cancel_order_id" | "kraken_client_order_id" | "kraken_order_id" | "kraken_trade_id" | "kraken_withdrawal_id" | "kraken_withdrawal_nonce" | "lighter_client_order_index" | "lighter_order_index" | "lighter_transaction_hash" | "okx_cancel_order_id" | "okx_client_order_id" | "okx_order_id" | "okx_trade_id" | "papertrade_intent_id" | "papertrade_position_id" | "polymarket_deposit_wallet_address" | "polymarket_observation_id" | "polymarket_order_id" | "polymarket_perps_cancel_order_id" | "polymarket_perps_client_order_id" | "polymarket_perps_deposit_hash" | "polymarket_perps_order_id" | "polymarket_perps_request_digest" | "polymarket_perps_trade_id" | "polymarket_perps_withdrawal_id" | "polymarket_relayer_request_digest" | "polymarket_relayer_transaction_id" | "qfex_cancel_order_id" | "qfex_client_order_id" | "qfex_deposit_id" | "qfex_order_id" | "qfex_trade_id" | "qfex_withdrawal_id" | "qfex_withdrawal_nonce" | "simulated_cancel_order_id" | "simulated_order_id" | "simulated_settlement_id" | "solana_signature" | "swap_request_id"; type AllOrSize = { size: AllOr; }; type AllOrValue = { value: AllOr; }; type TimeInForce = "alo" | "gtc" | "ioc"; type NonEmptyHexBytes = string; type Instruction = { programAddress: InstructionText; accounts: Array; data: Array; }; type AccountRequirement = { kind: "accountUnfunded"; venue: SetupVenue; accountAddress: string; } | { kind: "sessionKey"; venue: SetupVenue; accountAddress: string; } | { kind: "polymarketDepositWallet"; accountAddress: string; controllerAddress: string; } | { kind: "polymarketDepositWalletRequired"; accountAddress: string; depositWallet: string; }; type OptionName = string; type PositiveDecimalSize = { size: PositiveDecimal; }; type TokenFieldsInput = { network: string; address: string; }; type VenueListing = { venue: Venue; dex: (string | null); venueSymbol: string; quoteAsset: (string | null); quoteSymbol: string; delistedAt: (Timestamp | null); }; type VendorListing = { vendor: FundamentalsVendor; vendorKey: string; }; type TokenSeen = { network: string; address: string; error?: string | undefined; }; type DataMarketRow = { venue: Venue; dex: string; venueSymbol: string; assetType: DataAssetType; underlyingAsset: (string | null); underlyingAssetType: (DataAssetType | null); baseSymbol: string; quoteSymbol: string; maximumLeverage: (number | null); marginRule: (MarginRule | null); minimumNotional: (Decimal | null); minimumSize: (Decimal | null); sizeStep: (Decimal | null); priceTick: (Decimal | null); price: (Decimal | null); priceUsd: (Decimal | null); dayAgoPrice: (Decimal | null); volumeQuote: (Decimal | null); volumeUsd: (Decimal | null); openInterestBase: (Decimal | null); openInterestQuote: (Decimal | null); openInterestUsd: (Decimal | null); fundingRate: (Decimal | null); settlesAt: (Timestamp | null); medianDailyVolumeQuote: (Decimal | null); medianDailyVolumeUsd: (Decimal | null); observedDayCount: (number | null); cumulativeFundingRate: (Decimal | null); fundingSettlementCount: (number | null); }; type PoolRow = { pool: string; network: Network; protocol: string; factory: (TokenSeen | null); label: string; createdAt: (Timestamp | null); firstObservedAt: Timestamp; depositToken: (TokenSeen | null); fee: (number | null); tickSpacing: (number | null); hooks: (string | null); baseToken: (TokenSeen | null); baseAsset: (string | null); baseSymbol: (string | null); quoteToken: (TokenSeen | null); quoteRole: (QuoteRole | null); quoteAsset: (string | null); quoteSymbol: (string | null); tradeCount: (number | null); buyCount: (number | null); sellCount: (number | null); volumeBase: (Decimal | null); volumeQuote: (Decimal | null); volumeUsd: (Decimal | null); baseReserve: (Decimal | null); quoteReserve: (Decimal | null); liquidityUsd: (Decimal | null); feeYield24h: (Decimal | null); lastPrice: (string | null); lastTradeMinute: (Timestamp | null); priceChangeInWindow: (string | null); liquidityChangeInWindow: (string | null); constituents: (Array | null); }; type PricedExchangeInput = "kraken" | "qfex"; type Constituent = { address: string; symbol: (string | null); decimals: (number | null); asset: (string | null); }; type WithdrawalOutcome = "delayed" | "error_rpc" | "no_exit_primary" | "ok_full" | "ok_partial" | "reverted_liquidity" | "reverted_paused" | "reverted_unknown"; type MeasurementConfidence = "high" | "low" | "medium"; type OptionType = "call" | "put"; type OptionQuote = { mark: (Decimal | null); bid: (Decimal | null); ask: (Decimal | null); impliedVolatility: (Decimal | null); delta: (Decimal | null); gamma: (Decimal | null); vega: (Decimal | null); theta: (Decimal | null); }; type Pnl = string; type Notional = string; type MarginChange = "add" | "remove"; type FundsChange = "deposit" | "withdraw"; type DelegationChange = "delegate" | "undelegate"; type UncheckedEvmAddress = string; type CoreBalance = { kind: "spot"; } | { kind: "perps"; dex: string; }; type EventMarket = { ticker: string; title: string; yesSubTitle: string; noSubTitle: string; trading: boolean; closeTime: string; volume24h: string; yes: Quote; no: Quote; }; type ValueUsdLendingAccountChangeByMarket = { network: Network; protocol: LendingProtocol; market: Market; category: number; }; type ValueUsdLendingAccountChangeByPosition = { network: Network; position: Position; category: number; }; type Market = string; type Asset = string; type Collateral = { market: Market; asset: Asset; loanToValue: Decimal; liquidationLoanToValue: Decimal; }; type CategoryRow = { id: number; name: string; loanToValue: Decimal; liquidationLoanToValue: Decimal; securesLoans: boolean; canBorrow: boolean; }; type ValueUsdBorrowByMarket = { network: Network; protocol: LendingProtocol; market: Market; asset: Asset; amount: ValueUsdBorrowAmount; category?: number | undefined; }; type ValueUsdBorrowByPosition = { network: Network; position: Position; asset: Asset; amount: ValueUsdBorrowAmount; category?: number | undefined; }; type Position = string; type ValueUsdExitAmount = string | ProposalBalancePercent | TargetLoanToValue | ValueUsd; type PayWith = "supply" | "wallet"; type ValueUsdSupplyByMarket = { network: Network; protocol: LendingProtocol; market: Market; asset: Asset; amount: ValueUsdAmount; category?: number | undefined; }; type ValueUsdSupplyByPosition = { network: Network; position: Position; asset: Asset; amount: ValueUsdAmount; category?: number | undefined; }; type LighterRoute = "perps" | "spot"; type Range = { lowerPercent: Decimal; upperPercent: Decimal; }; type Action = { kind: "add"; protocol: LiquidityProtocol; position: string; budgets: Budgets; slippagePercent: Percentage; } | { kind: "remove"; protocol: LiquidityProtocol; position: string; percent: PositivePercentage; slippagePercent?: Percentage | undefined; } | { kind: "stake"; protocol: GaugeProtocol; position: PositionNft; } | { kind: "unstake"; protocol: GaugeProtocol; position: PositionNft; } | ({ kind: "open"; } & ({ protocol: "metric"; pool: MetricPool; range: Range; budgets: Budgets; slippagePercent: Percentage; } | { protocol: "uniswap-v3"; pool: UniswapV3Pool; range: Range; budgets: Budgets; slippagePercent: Percentage; } | { protocol: "uniswap-v4"; pool: UniswapV4Pool; range: Range; budgets: Budgets; slippagePercent: Percentage; } | { protocol: "aero-slipstream"; pool: AeroSlipstreamPool; range: Range; budgets: Budgets; slippagePercent: Percentage; } | { protocol: "project-x"; pool: UniswapV3Pool; range: Range; budgets: Budgets; slippagePercent: Percentage; })); type SwapAction = { from: NetworkAsset; to: SwapSide; slippage: Percentage; engines?: Array | undefined; confidential: boolean; amountRaw: PositiveRawAmount; quoteFloor?: QuoteFloor | undefined; }; type TransferAction = { network: Network; asset: string; toAddress: string; amountRaw: PositiveRawAmount; decimals: number; }; type Move = { network: Network; protocol: LendingProtocol; market: Market; position: (Position | null); asset: Asset; amount: PinnedAmount; decimals: TokenDecimals; payWith: PayWith; category: (number | null); }; type PinnedAccountChange = { network: Network; protocol: LendingProtocol; market: Market; position: (Position | null); category: number; }; type LighterMarginChangeOrLeverage = PerpLeverage | LighterMarginChange; type PerpLeverage = { kind: "leverage"; asset: string; leverage: Leverage; marginMode: MarginMode; }; type KrakenWithdrawal = { asset: KrakenAssetId; network: string; address: string; amount: PositiveDecimal; addressId: KrakenAddressId; methodId: string; maxFee: NonnegativeDecimal; }; type EvmWithdrawal = { amount: PositiveDecimal; address: EvmAddress; }; type PinnedOrder = BookPlacement | PapertradePlacement | PolymarketPlacement; type HyperliquidAccountChangeOrLeverage = PerpLeverage | HyperliquidAccountChange; type OrderType = "limit" | "stopLoss" | "stopLossLimit" | "takeProfit" | "takeProfitLimit"; type Paused = { registerSessionKey: boolean; openPosition: (boolean | null); closePositions: boolean; paperStake: boolean; paperUnstake: boolean; paperClaim: boolean; registerDeposit: boolean; withdrawToCore: boolean; }; type Headroom = { long: Decimal; short: Decimal; }; type Impact = { baseRate: NonnegativeDecimal; rateMultiplier: NonnegativeDecimal; positionMultiplier: NonnegativeDecimal; referenceNotional: NonnegativeDecimal; deadband: NonnegativeDecimal; }; type PositiveDecimalValue = { value: PositiveDecimal; }; type PapertradeLeverage = number; type FundFrom = "balance" | "queued"; type ScreenOutcome = { question: string; slug: string; sportsMarketType: (string | null); groupItemTitle: (string | null); negRisk: boolean; line: (number | null); gameStartTime: (string | null); endDate: (string | null); liquidityPusd: NonnegativeDecimal; volume24hPusd: NonnegativeDecimal; dayChangePercent: (number | null); outcome: string; asset: RawAmount; conditionId: string; tags: Array; pricePusd: string; estimatedShares: string; excludesFees: boolean; }; type Eip712DomainInput = { name?: (string | null) | undefined; version?: (string | null) | undefined; chainId?: (number | null) | undefined; verifyingContract?: (string | null) | undefined; salt?: (string | null) | undefined; }; type Eip712FieldInput = { name: string; type: string; }; type MidSlippage = string; type MarginMode = "cross" | "isolated"; type Leverage = number; type StockDestination = { stock: StockTicker; }; type ProposalBalancePercent = { balancePercent: PositivePercentage; }; type ValueUsd = { valueUsd: PositiveDecimal; }; type AddressTarget = { address: InstructionText; }; type KrakenTarget = { kraken: KrakenDeposit; }; type ProposalWalletTarget = { walletId: number; }; type QfexTarget = { qfex: QfexDeposit; }; type Received = { received: Decimal; }; type VenueOrder = { orderId: string; asset: string; side: OrderSide; limitPrice: PositiveDecimal; size: PositiveDecimal; filled: NonnegativeDecimal; averageFillPrice?: PositiveDecimal | undefined; state: VenueOrderState; venueStatus: string; type: OrderType; triggerPrice: (PositiveDecimal | null); reduceOnly: boolean; }; type Canceled = { orderId: string; state: Ended; }; type DepositWallet = { wallet: string; }; type VenueOrders = VenueOrder[]; type ClaimResult = { claimed: NonnegativeDecimal; }; type Redeemed = { redeemed: Array; }; type Withdrawal = { referenceId: string; transactionId: (string | null); }; type SignedInteger = string; type WalletAddress = string; type PositiveRawAmount = string; type Usd = string; type FeeKind = "circuit" | "execution" | "liquidity" | "network"; type Unread = { kind: "asset"; key: AssetKey; } | { kind: "dex"; dex: string; } | { kind: "unnamed"; } | { kind: "book"; key: AssetKey; }; type BookOrderRequest = { venue: MarketVenue; order: BookOrderProposal; }; type PapertradeOrderRequest = { venue: PapertradeTag; order: PapertradeOrderProposal; }; type PolymarketOrderRequest = { venue: PolymarketTag; order: PolymarketOrderProposal; }; type Instrument = string; type PolymarketPerpsSymbol = string; type Symbol = string; type AllOr = string; type InstructionText = string; type AccountMeta = { address: InstructionText; isSigner: boolean; isWritable: boolean; }; type DataPart = { kind: "integer"; value: RawAmount; bytes: IntegerWidth; } | { kind: "address"; value: InstructionText; } | { kind: "utf8"; value: InstructionText; } | { kind: "hex"; value: InstructionText; } | { kind: "anchor"; value: InstructionText; }; type SetupVenue = "derive" | "hyperliquid" | "lighter" | "lighterRobinhood" | "papertrade" | "polymarketPerps"; type MarginRule = "crossOrIsolated" | "isolatedOnly" | "strictIsolated"; type QuoteRole = "dollar" | "native"; type PoolConstituent = { address: string; symbol: (string | null); asset: (string | null); inflow: (Decimal | null); outflow: (Decimal | null); reserve: (Decimal | null); }; type Quote = { asset: string; bid: (string | null); ask: (string | null); }; type ValueUsdBorrowAmount = string | TargetLoanToValue | ValueUsd; type TargetLoanToValue = { loanToValue: LoanToValue; }; type LiquidityProtocol = "aero-slipstream" | "metric" | "project-x" | "uniswap-v3" | "uniswap-v4"; type Budgets = Budget[]; type PositivePercentage = string; type GaugeProtocol = "aero-slipstream"; type PositionNft = string; type UniswapV3Pool = { token0: UncheckedEvmAddress; token1: UncheckedEvmAddress; fee: FeeTier; }; type UniswapV4Pool = { currency0: UncheckedEvmAddress; currency1: UncheckedEvmAddress; fee: V4Fee; tickSpacing: number; hooks: UncheckedEvmAddress; }; type AeroSlipstreamPool = { token0: UncheckedEvmAddress; token1: UncheckedEvmAddress; tickSpacing: number; }; type SwapSide = { network: Network; asset: string; walletAddress: WalletAddress; }; type QuoteFloor = { sellRaw: PositiveRawAmount; receiveRaw: PositiveRawAmount; }; type PinnedAmount = "max" | PositionRaw | UnderlyingRaw; type TokenDecimals = number; type KrakenAssetId = string; type KrakenAddressId = string; type BookPlacement = { venue: MarketVenue; order: BookOrder; }; type PapertradePlacement = { venue: PapertradeTag; order: OpenRequest; }; type PolymarketPlacement = { venue: PolymarketTag; order: PolymarketOrder; shareContract: ShareContract; }; type StockTicker = string; type KrakenDeposit = { asset: KrakenAssetId; credentialId: string; }; type QfexDeposit = { credentialId: string; }; type VenueOrderState = "canceled" | "filled" | "fired" | "open" | "partiallyFilled"; type Ended = "canceled" | "filled" | "fired"; type AssetKey = string; type MarketVenue = "binance" | "bybit" | "coinbase" | "derive" | "hyperliquid" | "kalshi" | "kraken" | "lighter" | "lighterRobinhood" | "okx" | "polymarketPerps" | "qfex"; type PapertradeTag = "papertrade"; type PolymarketTag = "polymarket"; type IntegerWidth = number; type LoanToValue = string; type Budget = { token: UncheckedEvmAddress; amount: PositiveDecimal; }; type FeeTier = number; type V4Fee = number; type PositionRaw = { positionRaw: PositiveRawAmount; }; type UnderlyingRaw = { underlyingRaw: PositiveRawAmount; }; type BookOrder = { asset: string; side: OrderSide; size: PositiveDecimal; pricing: PositiveDecimalPricing; reduceOnly: boolean; takeProfit?: PositiveDecimalExit | undefined; stopLoss?: PositiveDecimalExit | undefined; margin?: PerpMargin | undefined; message?: OrderMessage | undefined; expiresAt?: Timestamp | undefined; }; type OpenRequest = { asset: PerpCoin; side: PerpSide; margin: PositiveDecimal; leverage: PapertradeLeverage; fundFrom?: FundFrom | undefined; }; type PolymarketOrder = { type: "marketBuy"; asset: RawAmount; value: PositiveDecimal; } | { type: "marketSell"; asset: RawAmount; size: PositiveDecimal; } | { type: "limit"; asset: RawAmount; side: OrderSide; size: PositiveDecimal; price: PricePusd; timeInForce: TimeInForce; expiresAt?: Timestamp | undefined; }; type ShareContract = "ConditionalTokens" | "PositionManager"; type PositiveDecimalPricing = { type: "limit"; price: PositiveDecimal; timeInForce: TimeInForce; } | { type: "takeProfit"; triggerPrice: PositiveDecimal; } | { type: "stopLoss"; triggerPrice: PositiveDecimal; } | { type: "takeProfitLimit"; triggerPrice: PositiveDecimal; price: PositiveDecimal; } | { type: "stopLossLimit"; triggerPrice: PositiveDecimal; price: PositiveDecimal; }; export type { ActionKind, AgentConfig, AgentContext, AgentDefinition, AgentMoneyRequest, AgentRunInput, ApiErrorDetails, AssetRef, CompletedOperation, Dec, DecimalInput, Duration, EventsOf, EvmMoneyAction, EvmNetworkId, EvmSignMessageRequest, HyperliquidCloseInput, HyperliquidOpenInput, HyperliquidStaking, KindOf, MoneyActionOutcome, NetworkId, OnceInput, OperationResource, PapertradeAccount, PapertradeClosedPositions, PolymarketDiscoverRail, PolymarketMarketLookup, PolymarketOrderProposal, PolymarketPricePoint, PolymarketRedeemPositionsData, PolymarketRedeemRequest, PolymarketResolvedEvent, PolymarketSearchEventsData, PriceCandle, PricesResult, RequestOf, SessionMovement, SettingSpec, SettingsOf, SettingsSchema, SignMessageData, SolanaMoneyAction, SwapInput, SwapProvider, SwapQuoteResponse, SwapRequest, ThinkRequest, ThinkResponse, ThreadState, TransactionPreviewResponse, TransferQuoteResponse, TransferRequest, WalletTransactionRequest, WalletWatchEvent, WatchMap, WatchSpec }; }