Skip to main content

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.

Build a swap instruction.
const ix = pool.swap(user, {
  isX: true,             // true = sell token X for Y, false = sell Y for X
  amountIn: 1_000_000n,
  minOut: 0n,
  feeRecipient: feePk,
});
ParamTypeDescription
userPublicKeyThe user’s wallet
params.isXbooleanDirection: true = X→Y, false = Y→X
params.amountInbigintInput amount in token atoms
params.minOutbigintMinimum output (slippage protection)
params.feeRecipientPublicKeyAddress to receive fees
params.expiration?numberOptional slot expiration
Hadron does not currently support custom matching across multiple propAMMs for the same asset natively. For multi-prop matching, please use one of our supported aggregators or reach out to us to discuss more.