Skip to main content

High-level overview

opendev takes a Solana transaction signature and produces a decoded execution profile:

Data flow

1. Fetch

Input: Transaction signature
Output: On-chain transaction data + metadata
  • Supports mainnet, devnet, custom RPC
  • Optional IDL cache (speedup for repeat analysis)

2. Parse & decode

Input: Raw transaction bytes
Output: Decoded instructions, account state
Each program has a decoder (custom logic or generic IDL-based).

3. CPI call tree

Input: Decoded instructions
Output: Hierarchical call tree
Built by tracking invoke_signed / invoke during simulation.

4. Compute & gas analysis

Input: CPI tree + instruction costs
Output: Per-instruction and aggregate compute units

Account state tracking

Before/after state for every account touched:

Decoder registry

Programs are matched to decoders by pubkey:

Custom decoders

Programs like Token, Swap, and Stake have hand-written decoders for rich output.

IDL decoders

Generic IDL-based decoder for any program with an onchain IDL.

Rule-based insights

Deterministic analysis of the transaction (no AI required):
  • Anomaly detection — unusual account access patterns, spam-like behavior
  • MEV detection — front-running signatures, sandwich attack indicators
  • Nondeterministic failures — execution paths that might fail under different slot conditions
  • Compute warnings — approaching limit or inefficient patterns
Always available. AI insights augment these with LLM-generated suggestions.

AI insights (optional)

Integration with Groq / Anthropic for optimization suggestions. Flow:
MCP (Model Context Protocol): Used for standardized communication with LLMs. See AI Insights docs for setup.

Simulation

opendev simulate re-executes a transaction offline:
Uses:
  • sigVerify: false — skip signature validation
  • replaceRecentBlockhash: true — use fake blockhash
  • Current mainnet state (by default)

CLI architecture


Performance characteristics

  • Mainnet tx: ~1–3s (network + decode + analysis)
  • Simulation: ~100–500ms (depends on source file execution time)
  • Batch: Linear in number of transactions (parallelizable)
  • IDL cache: Cuts repeat analysis by ~40%
See Performance & Quality for detailed benchmarks.

Dependency design

Production (installed globally):
  • @solana/web3.js — RPC client, transaction parsing
  • @solana/spl-token — token program utilities
  • Small, vetted set for security
Dev-only:
  • Testing frameworks, type definitions, build tools
  • Never shipped in the published bundle
Audit: