phoenix-rise-litesvm-test provides deterministic LiteSVM fixtures for Phoenix program integration tests. It loads Phoenix Eternal and Ember, optionally Hawkeye and Flight, creates fake USDC collateral, initializes markets, seeds actors, and exposes helpers for replaying setup and action transactions.
References:
- phoenix-rise-litesvm-test README
- LiteSVM fixture crate
- SDK localnet fixture tests
- Example program tests
- TypeScript LiteSVM harness
- TypeScript SDK localnet VM tests
- TypeScript SDK localnet flow tests
Setup
The fixture helpers look for local protocol SBF artifacts. In CI you can use the fixture package directly; locally, set the artifact paths or point the helpers at a Phoenix repo checkout.Context
Build aSdkLocalnetContext, load any extra program under test, execute fixture setup, then send instructions through the context.
Rust
Prime Markets
Most order tests need current oracle and spline prices plus maker liquidity. The example program primes those from fixture transactions before sending taker instructions.Rust
Test A Flow
Write tests against the behavior you expect from your program, not against Phoenix internals. This example places a market order, places a limit order, extracts the order id from return data/log helpers, and cancels it.Rust
TypeScript LiteSVM
The TypeScript SDK tests use thelitesvm npm package with the same generated
localnet fixture. The published package exposes the fixture at
@ellipsis-labs/rise/test-fixtures/default-localnet.json; the public repo’s
test harness shows how to load local SBF artifacts, replay setup transactions,
attach fixture signers, and send SDK-built instructions into LiteSVM.
TypeScript
createSdkLocalnetContext and exposes
helpers for fixture-backed market params, account contexts, signing, and
transaction submission.
TypeScript
Fixture Metadata
When your off-chain test client needs the same market params as LiteSVM, buildPhoenixMetadata from the fixture instead of calling mainnet APIs.
Rust
PhoenixTxBuilder flows against the local fixture and keep transaction construction deterministic.