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.

setPoolState

Pools are initialised by default as Reject Swaps. This is done to deposit funds to prevent indexing from aggregators
pool.setPoolState(authority, { newState: PoolState.Paused });

//// Send the instructions
ParamDescription
params.InitializedPool is live and will be indexed by aggregators
params.PausedAll operations are paused in the pool
params.RejectSwapsSwaps are rejected, but the user can perform all other actions

nominateAuthority / acceptAuthority

Hadron pools have multiple authorities that can each be delegated to different wallets to split the surface area of control.
pool.nominateAuthority(authority, { 
newAuthority: newPk, 
expirySlot: 300_000_000n }); 

// Expiry - optional parameter for the number of slots 
// newAuthority signs: pool.acceptAuthority(newPk);
The pool has three states that can be rotated as follows by various authorities:
From → ToPool AuthorityQuoting AuthorityPauser Authority
Initialized → Paused
Initialized → RejectSwaps
Paused → Initialized
Paused → RejectSwaps
RejectSwaps → Initialized
RejectSwaps → Paused
What each state blocks:
StateSwapsDepositsWithdrawals
Initialized
RejectSwaps
Paused

closePool

Closes the pool and reclaims rent. Requires authority and all vaults to be empty.
pool.closePool(authority);

Properties

These are available on anyHadroninstance after creation:
PropertyTypeDescription
pool.poolAddressPublicKeyThe pool’s on-chain address
pool.programIdPublicKeyProgram ID
pool.addressesPoolAddressesAll derived PDA addresses for this pool
pool.configDecodedConfigDecoded config account data
pool.oracleDecodedMidpriceOracleDecoded oracle data
pool.curveMetaDecodedCurveMetaDecoded curve metadata