How buffalojoec/arb-program works
Project type and purpose
• This is a full-stack Solana dApp for automated arbitrage trading:
• Frontend: Next.js/React UI (“app/” directory)
• On-chain program: Rust Solana program (“program/” directory)
• Test harness: TypeScript tests that bootstrap accounts and invoke the program (“tests/”)
File structure
• Top-level: monorepo with package.json, Cargo.toml, tsconfig.json
• app/
• Next.js config, pages/api, public assets, components, contexts, stores, Tailwind/CSS, IDL JSON
• UI lets user paste two swap program IDs, set concurrency & temperature, connect wallet and trigger bot
• program/
• Rust crate using solana_program (no Anchor)
• src/arb.rs, swap.rs, processor.rs, util.rs (partial deserialization)
• Single TryArbitrage instruction → nested loops → CPI to swap programs
• tests/
• main.test.ts: creates token accounts, airdrops, builds Address Lookup Table (ALT), sends TryArbitrage TXs
• util/: fixtures for assets, instructions
README for insights
• Architecture overview: UI → RPC Node → TX v0 with ALT → Arbitrage Program → CPI into two Swap Programs
• Preflight simulation: program errors on no-arbitrage, so client only pays fees on success
• Optimizations: bytemuck zero-copy, ALT to pack many accounts into one TX