Build a swap instruction.Documentation Index
Fetch the complete documentation index at: https://docs.hadron.fi/llms.txt
Use this file to discover all available pages before exploring further.
| Param | Type | Description |
|---|---|---|
user | &Pubkey | The user’s wallet |
params.is_x | bool | Direction: true = X→Y, false = Y→X |
params.amount_in | u64 | Input amount in token atoms |
params.min_out | u64 | Minimum output amount. The transaction fails with SlippageExceeded (error 8) if the pool cannot fill at this level or better. Set to 0 only in tests. |
params.fee_recipient | Pubkey | Address that receives the operator’s fee portion of the spread |
params.expiration | Option<i64> | Optional slot deadline — transaction fails with Expired (error 38) after this slot |
Multi-pool routing Hadron does not currently support native matching across multiple propAMMs for the same asset. For multi-pool routing, use one of the supported aggregators or contact the Hadron team.
.png?fit=max&auto=format&n=pH37fL0GL14scVCH&q=85&s=5749b485c8c5b2386a4cca404e97d6be)