/** * Orderbook-aware split order execution. * * Unlike TWAP (time-based splitting), this strategy reads the orderbook * before each slice and calculates optimal slice sizes based on available * depth. Each slice is placed as an IOC limit order at the worst acceptable * price within the slippage tolerance, ensuring no sweep beyond the target. * * Flow per slice: * 1. Fetch fresh orderbook * 2. Walk levels via computeExecutableSize to find fillable amount * 3. Place IOC limit at best price + slippage tolerance * 4. Wait for book to refresh, then repeat */ import type { ExchangeAdapter } from "../exchanges/index.js"; export interface SplitOrderParams { symbol: string; side: "buy" | "sell"; totalSizeUsd: number; maxSlippagePct?: number; maxSlices?: number; delayMs?: number; minSliceUsd?: number; } export interface SplitSlice { index: number; size: string; price: string; notionalUsd: number; slippagePct: number; method: "limit_ioc" | "market"; status: "filled" | "partial" | "failed"; } export interface SplitOrderResult { symbol: string; side: "buy" | "sell"; requestedUsd: number; filledUsd: number; filledSize: number; avgPrice: number; totalSlippagePct: number; slices: SplitSlice[]; status: "complete" | "partial" | "failed"; runtime: number; } /** * Execute a split order: orderbook-aware slicing with IOC limits. */ export declare function runSplitOrder(adapter: ExchangeAdapter, params: SplitOrderParams, log?: (msg: string) => void): Promise;