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
| Param | Description |
|---|
params.Initialized | Pool is live and will be indexed by aggregators |
params.Paused | All operations are paused in the pool |
params.RejectSwaps | Swaps 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 → To | Pool Authority | Quoting Authority | Pauser Authority |
|---|
Initialized → Paused | ✅ | ❌ | ✅ |
Initialized → RejectSwaps | ✅ | ✅ | ❌ |
Paused → Initialized | ✅ | ❌ | ❌ |
Paused → RejectSwaps | ✅ | ❌ | ❌ |
RejectSwaps → Initialized | ✅ | ❌ | ❌ |
RejectSwaps → Paused | ✅ | ❌ | ✅ |
What each state blocks:
| State | Swaps | Deposits | Withdrawals |
|---|
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:
| Property | Type | Description |
|---|
pool.poolAddress | PublicKey | The pool’s on-chain address |
pool.programId | PublicKey | Program ID |
pool.addresses | PoolAddresses | All derived PDA addresses for this pool |
pool.config | DecodedConfig | Decoded config account data |
pool.oracle | DecodedMidpriceOracle | Decoded oracle data |
pool.curveMeta | DecodedCurveMeta | Decoded curve metadata |