/** * MockExchange — deterministic in-memory exchange used by tests and dev mode. * * Implements the same `ExchangeClient` contract (src/trading/exchange.ts) a * real adapter would, so the agent flow can be verified end-to-end without * hitting a network or placing real orders. Fills land at the requested * price (no slippage) with a configured taker fee in basis points; no * latency is simulated. * * The fee it CHARGES is the exact bps fee; the fee it ESTIMATES is that * number rounded up to the cent — the same ceiling/actual split a real venue * exhibits, so the engine's fill-fee invariant is exercised honestly here. */ import type { Fill } from './portfolio.js'; import type { ExchangeClient, ExchangeOrder } from './exchange.js'; export type { ExchangeClient, ExchangeOrder } from './exchange.js'; export interface MockExchangeOptions { prices: Record; feeBps: number; } export declare class MockExchange implements ExchangeClient { private prices; private feeBps; constructor(opts: MockExchangeOptions); /** Update the synthetic price book (e.g. to simulate a move in tests). */ setPrice(symbol: string, priceUsd: number): void; estimateFee(order: ExchangeOrder): number; placeOrder(order: ExchangeOrder): Promise; getPrice(symbol: string): Promise; } /** Fill construction shared by the paper adapters: echo the order, attach the fee. */ export declare function paperFill(order: ExchangeOrder, feeUsd: number): Fill;