Skip to main content
Install and use the Hadron Rust SDK in a few minutes.

Documentation Index

Fetch the complete documentation index at: https://docs.hadron.fi/llms.txt

Install

Or via cargo:
The SDK requires solana-sdk for Pubkey and Instruction types.

Initializing a Pool

Initialising a Hadron pool gives you your own propAMM instance.
Two transactions required
With default parameters the CurvePrefabs account is ~15 KB. Two allocate instructions are returned because Solana’s single-instruction realloc limit is 10 KB. Send the allocates first in one transaction, then send the initialize instruction.
Returns (Vec<Instruction>, Pubkey, u64) — instructions, pool address, seed

Loading an Existing Pool

The Rust SDK is sync-first — you provide raw account data and it decodes everything locally. No async required.
RPC convenience loader
Enable the rpc feature for a one-liner: cargo add hadron-sdk-v2 --features rpc
Then call Hadron::load(&rpc_client, &pool_address) which fetches all accounts automatically.

setPoolState

Pools are initialised by default as RejectSwaps. This lets you deposit funds before the pool is indexed by aggregators.

Depositing Funds

Build a deposit instruction.

Withdraw

Build a withdraw instruction.