hoodkit
    Preparing search index...

    Interface TwapExecutor

    Execute a large swap as a Time-Weighted Average Price schedule: split totalAmountIn into equal slices spaced intervalMs apart, each quoted and slippage-bounded independently. Enforces a hard SpendCap, honors an AbortSignal kill switch between slices, and defaults to dry-run (simulate via eth_call, send nothing) until you opt into live execution.

    const twap = createTwapExecutor(hood, {
    tokenIn: usdg, tokenOut: weth, totalAmountIn: parseUsdg('1000'), slices: 5,
    })
    const results = await twap.run() // dryRun defaults on with no wallet
    interface TwapExecutor {
        plan(): TwapSlicePlan[];
        run(): Promise<TwapSliceResult[]>;
    }
    Index