Solana Inner Instructions and Token Balance Decoding for Bot Developers
Why top-level instructions are insufficient for understanding Solana swaps and wallet activity.
Why top-level instructions are insufficient for understanding Solana swaps and wallet activity.
Top-level limits
Aggregators invoke multiple programs through CPI, so the economic transfer often appears only in inner instructions and balance deltas.
Account resolution
Resolve versioned transaction address lookup tables and map token accounts back to owners and mints.
Net effects
Compare pre/post SOL and token balances, then subtract fees and temporary wrapped-SOL movements.
Decoder strategy
Use protocol-specific parsers when available but keep a generic balance-delta fallback and preserve raw unknown events.
Building this for production?
We turn this architecture into tested, non-custodial software with monitoring, documentation and deployment support.
Related technical guides
Best Solana RPC for Trading Bots: Reproducible Latency Benchmark
Benchmark Helius, QuickNode, Triton and self-hosted Solana RPC endpoints with a reproducible Node.js harness for p50/p95/p99 latency, errors and slot freshness.
Read articleJupiter Legacy Swap v1/v6 Guide: Quote and Route Migration Notes
Understand legacy Jupiter v6 quote and route responses, then migrate new Solana integrations to the currently supported Jupiter Swap API.
Read articleSanctum and LST Arbitrage: Trading Solana Liquid Staking Tokens
Build a Solana LST arbitrage bot around Sanctum: capture jitoSOL, mSOL and INF peg deviations against SOL via Infinity pool routes and unstake tickets.
Read article