$PRIVY is live -

Skip to content
Docs

Developers

Tracking transactions

Poll a trade until it finishes.

Poll the compact status endpoint every 2 to 5 seconds until terminal is true, then fetch the full trade once for display.

JavaScript
async function waitForTrade(id) {
  for (let i = 0; i < 120; i++) {
    const { data } = await privy(`/trades/${id}/status`)
    if (data.terminal) return (await privy(`/trades/${id}`)).data
    await new Promise((r) => setTimeout(r, 3000))
  }
  throw new Error("Trade still running after 6 minutes")
}

Every on-chain step has a signature in signatures. Open one in any Solana explorer to verify it independently.