hoodkit
    Preparing search index...

    Function streamSwaps

    • Stream Uniswap v3 swaps for a specific pool, or for every WETH/USDG pool of a token. Backed by the gap-fill log cursor: a dropped RPC connection or blip re-reads the missed block range instead of silently losing swaps.

      Parameters

      • client: HoodClient
      • target: { pool: `0x${string}` } | { token: `0x${string}` }
      • options: StreamSwapsOptions = {}

      Returns Promise<Stream<SwapEvent>>

      const swaps = await streamSwaps(hood, { token: '0x…' })
      swaps.on('data', (s) => console.log(s.buysToken0 ? 'BUY' : 'SELL', s.price))