Expand description
Mock swap route support for validation environments.
Devnet builds of the program (--features devnet) hardcode the mock swap
aggregator as their SWAP_PROGRAM in place of Jupiter. These helpers build
the mock’s route data and account list, shared by the LiteSVM test-suite and
the CLI when cranking devnet rounds. Not for mainnet use.
Constants§
- MOCK_
POOL_ AUTHORITY_ SEED - Seed for the mock swap program’s pool authority PDA.
- MOCK_
SWAP_ PROGRAM_ ID - Mock swap aggregator program (must match the program’s
declare_id!and thedevnetSWAP_PROGRAMconstant).
Functions§
- get_
mock_ pool_ authority - The mock swap program’s pool authority PDA (owner of its liquidity ATAs).
- get_
mock_ swap_ data - Instruction data for the mock swap program: it moves exactly
amount_inUSD into the pool and pays exactlyamount_outBTC from it. - get_
mock_ swap_ route_ accounts - The mock swap program’s account list (order matches its
MockSwapstruct) for a USD -> BTC swap out ofsource_authority’s ATAs.source_authorityis passed as a non-signer at the transaction level (it is a PDA) — the relaying satrush instruction marks it a signer for the CPI and signs viainvoke_signed.