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.

All Hadron Pools have price and risk curves which help maker encode their trading strategy into the on-chain PDA for the operator’s propAMM. A operator deploys a pool by describing a quoting function:
Screenshot 2026 05 08 At 10 14 28 AM
The operator picks the midprice, picks how price changes with trade size, picks how price shifts with their inventory. Hadron is the engine that runs that function on chain.

Hadron Quoting Pipeline

Image

updateBaseSpread

Add a flat pool level fee to all swaps. This is added to any additional spread initialised later in the curve setup by default.
pool.updateBaseSpread(authority, { spreadFactorQ32: newSpreadQ32 });
ParamTypeDescription
params.spreadFactorQ32bigintSpread discount factor in Q32 (e.g. toQ32(0.9995) = 5 bps)
params.sequence?bigintOptional sequence number

Creating Price Curves

Write a price curve to a prefab slot.
  • Curves comprise of three key ideas
    • AmountIn: Stored in atoms(lowest unit of the token based on the token decimal) of the amount inputed by the taker. Stored internally as Bigint
    • PriceFactor : Distance from the midprice in BPS
const ix = pool.setCurve(authority, { 
side: Side.Bid, 
defaultInterpolation: Interpolation.Linear, 
points: [ 
//Midprice is initialized as 1. AmountIn is based on the decimals for the input amount 
{ amountIn: 100_000n, priceFactor: 0.99 }, // For an input of 
{ amountIn: 500_000n, priceFactor: 0.95 }, 
], slot: 0, 
}); 
ParamTypeDescription
authorityPublicKeyPool authority
params.sideSideBid or Ask
params.defaultInterpolationInterpolationStep, Linear, MarginalStep, Hyperbolic, Quadratic, Cubic
params.pointsSetCurvePointInput[]Array of { amountIn, priceFactor, interpolation?, params? }
params.slot?numberTarget prefab slot (default: 0)
params.xMode?CurveXModeX-axis mode

switchPriceCurve

Switch between different price curves in a single instruction. Upto 10 per curve side, set at pool initialization.
pool.switchPriceCurve(authority, { side: Side.Bid, slot: 1 });

//slot number set presets 
ParamTypeDescription
authorityPublicKeyPool authority
params.sideSideBid or Ask
params.slotnumberSlot to activate
Hadron protocol fees are added at the pool level to all pools and need to be factored into pools to remain competitive. For the latest fee rates go to https://docs.hadron.fi/fees

setRiskCurve

Write a risk curve using percent-of-vault x-axis.
pool.setRiskCurve(authority, {
  side: Side.Bid,
  defaultInterpolation: Interpolation.Linear,
  points: [
    { pctBase: 0.25, priceFactor: 0.995 },
    { pctBase: 0.75, priceFactor: 1.005 },
  ],
});
ParamTypeDescription
authorityPublicKeyPool authority
params.sideSideBid or Ask
params.defaultInterpolationInterpolationInterpolation mode
params.pointsSetRiskCurvePointInput[]{ pctBase: 0.0–1.0, priceFactor, ... }
params.slot?numberTarget prefab slot
params.riskMode?RiskModeVirtual or Integrated

setRiskCurveAbsolute

Write a risk curve using absolute token amounts on the x-axis.
pool.setRiskCurveAbsolute(authority, {
  side: Side.Ask,
  defaultInterpolation: Interpolation.Step,
  points: [
    { vaultBalance: 1_000_000_000n, priceFactor: 1.002 },
    { vaultBalance: 2_000_000_000n, priceFactor: 1.006 },
  ],
});
ParamTypeDescription
authorityPublicKeyPool authority
params.sideSideBid or Ask
params.defaultInterpolationInterpolationInterpolation mode
params.pointsSetRiskCurveAbsolutePointInput[]{ vaultBalance, priceFactor, ... }
params.slot?numberTarget prefab slot
params.riskMode?RiskModeVirtual or Integrated

switchRiskCurve

Switch between different risk curves in a single instruction. Upto 10 per curve side, set at pool initialization.
pool.switchRiskCurve(authority, { side: Side.Ask, slot: 2 });

//slot number set presets 
ParamTypeDescription
authorityPublicKeyPool authority
params.sideSideBid or Ask
params.slotnumberSlot to activate
For a visual helper please visit https://dashboard.hadron.fi/curves