SolFi simulator
A local simulator that runs swaps against SolFi's WSOL/USDC pools in LiteSVM, in memory.
Complete
Rust / Solana / LiteSVM
Why
To understand how a SolFi pool prices swaps across its whole curve, you need to simulate hundreds of them.
Sending those to an RPC node is slow, and there is no guarantee every request runs against the same slot. The pools update every slot, so the results would mix states.
What I built
- Fetches the accounts for four SolFi WSOL/USDC pools and their related data.
- Ships a snapshot of that state at slot 333456106 so simulations are repeatable.
- Runs WSOL to USDC swaps against every pool locally in LiteSVM.
- Reports slot cutoffs and other metadata from the fetched pool data.
Reproduce
cargo build --release
./target/release/solfi-sim fetch-accounts # optional: refresh pool state
./target/release/solfi-sim simulate