#solana #simulation #message

litesvm

A fast and lightweight Solana VM simulator for testing solana programs

15 releases (8 breaking)

0.9.1 Jan 15, 2026
0.8.2 Nov 19, 2025
0.6.1 Mar 31, 2025
0.4.0 Dec 30, 2024
0.0.1 Feb 8, 2024

#78 in #solana

Download history 5088/week @ 2025-10-17 5038/week @ 2025-10-24 6051/week @ 2025-10-31 4854/week @ 2025-11-07 5007/week @ 2025-11-14 4329/week @ 2025-11-21 4789/week @ 2025-11-28 4720/week @ 2025-12-05 4887/week @ 2025-12-12 4012/week @ 2025-12-19 2501/week @ 2025-12-26 4829/week @ 2026-01-02 5785/week @ 2026-01-09 7660/week @ 2026-01-16 7128/week @ 2026-01-23 5788/week @ 2026-01-30

27,497 downloads per month
Used in 28 crates (25 directly)

Apache-2.0

1.5MB
2.5K SLoC

Contains (ELF lib, 510KB) spl_token_2022-10.0.0.so, (ELF lib, 170KB) src/programs/elf/address_lookup_table.so, (ELF lib, 160KB) src/programs/elf/config.so, (ELF lib, 200KB) src/programs/elf/core_bpf_stake-1.0.1.so, (ELF lib, 135KB) src/programs/elf/spl_token-3.5.0.so, (ELF lib, 105KB) spl_associated_token_account-1.1.1.so and 2 more.


LiteSVM

github crates.io docs.rs build status

📍 Overview

litesvm is a fast and lightweight library for testing Solana programs. It works by creating an in-process Solana VM optimized for program developers. This makes it much faster to run and compile than alternatives like solana-program-test and solana-test-validator. In a further break from tradition, it has an ergonomic API with sane defaults and extensive configurability for those who want it.

🚀 Getting Started

🔧 Installation

cargo add --dev litesvm

🤖 Minimal Example

use litesvm::LiteSVM;
use solana_address::Address;
use solana_keypair::Keypair;
use solana_message::Message;
use solana_signer::Signer;
use solana_system_interface::instruction::transfer;
use solana_transaction::Transaction;

let from_keypair = Keypair::new();
let from = from_keypair.pubkey();
let to = Address::new_unique();

let mut svm = LiteSVM::new();
svm.airdrop(&from, 10_000).unwrap();

let instruction = transfer(&from, &to, 64);
let tx = Transaction::new(
    &[&from_keypair],
    Message::new(&[instruction], Some(&from)),
    svm.latest_blockhash(),
);
let tx_res = svm.send_transaction(tx).unwrap();

let from_account = svm.get_account(&from);
let to_account = svm.get_account(&to);
assert_eq!(from_account.unwrap().lamports, 4936);
assert_eq!(to_account.unwrap().lamports, 64);

🛠️ Developing litesvm

Run the tests

The tests in this repo use some test programs you need to build first (Solana CLI >= 1.18.8 required):

cd crates/litesvm/test_programs && cargo build-sbf

Then just run cargo test.

Dependencies

~28MB
~483K SLoC