/** * LiveExchange — ExchangeClient backed by a real pricing source (CoinGecko * by default) but with *simulated* fills. This is the default adapter the * agent uses out of the box: it sees real market prices when valuing * positions (so P&L tracks reality) but trades are paper — no real assets * are moved, no real USDC is spent on exchange fees. * * A future commit will add a `RealExchange` that actually routes orders * through Coinbase/Kraken; it plugs into the same ExchangeClient contract * here. Keep this seam clean: the agent loop, risk engine, and portfolio * math never need to know whether they're in paper or live mode. * * Pricing is injected (not imported directly from `./data.js`) so tests * can validate behavior without hitting CoinGecko. */ import type { ExchangeClient } from './mock-exchange.js'; import type { Fill, Side } from './portfolio.js'; /** Subset of src/trading/data.ts's PriceData that we actually consume. */ export interface PricingClientResponse { price: number; change24h: number; volume24h: number; marketCap: number; } export interface PricingClient { /** Returns live price data on success, a string error on failure — matches data.ts. */ getPrice(ticker: string): Promise; } export interface LiveExchangeOptions { pricing: PricingClient; feeBps: number; } export declare class LiveExchange implements ExchangeClient { private opts; constructor(opts: LiveExchangeOptions); getPrice(symbol: string): Promise; placeOrder(order: { symbol: string; side: Side; qty: number; priceUsd: number; }): Promise; }