Core and agents
The core program only accounts. It knows what each margin account holds and owes, and asks two agent programs for the rest. The admin registers the agents. The core calls them read-only, with no writable accounts and no signers, and accepts their answer only as return data from the program it called. The interface lives inprograms/vanna_credit_layer/src/interface.rs.
Every asset names its oracle (
AssetConfig.oracle). Every whitelisted program names its validator (Integration.validator).
On-chain accounts
Remaining accounts
Any instruction that values the account or reviews a call takes, inremaining_accounts:
- For
margin_executeandpublic_liquidate: the external call’s accounts first. - One
[asset_config, margin_vault]group per allowed token, in the allowed list’s order. The instruction’s own token is left out. A vault that does not exist yet counts as zero. - One
[asset_config, margin]group per venue the margin holds. - One
[asset_config, reserve, debt_position]group per active debt. The instruction’s own debt is left out. - The agent segments:
[vanna_oracle, price_book, …price accounts], and for calls that need it the validator’s segment (for Phoenix:[vanna_validator, market_book, exchange]).
lib/solana/margin.ts (buildHealthRemainingAccounts). The scripts build them in scripts/src/devnet-positions.ts.
Application
The Solana app (apps/solana in the Vanna_Finance_Backend monorepo, which also holds the Stellar app; it grew out of vanna-credit-backend) is a Next.js app with React Query hooks, Zustand stores, an Anchor client, Wallet Standard wallets (Backpack) and Dynamic embedded wallets for email and social login.
The browser uses
NEXT_PUBLIC_SOLANA_RPC_URL (hosted: https://rpc-devnet.solana.vanna.finance). Server routes may use a loopback FORK_RPC_URL when the app and Surfpool share a machine. Despite the devnet hostname, this is a Surfpool mainnet fork, not the public Solana Devnet cluster.
Boundaries
- Earn vTokens are not margin collateral.
- Perps run on Phoenix through
margin_execute. There is no perps engine inside Vanna. - Fork cheatcodes (faucet, price keeper, pool healing) are demo infrastructure, not mainnet behaviour.
- Source support is not the same as a verified public-mainnet deployment.

