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.

updateMidprice

Update your pools midprice. Midprice can be updated when pools are in the RejectSwaps mode.
pool.updateMidprice(authority, { midpriceQ32: newMidQ32 });
ParamTypeDescription
params.midpriceQ32bigintNew midprice in Q32 format
params.sequence?bigintOptional sequence number for ordering
Q32 (more precisely Q32.32) is a fixed-point number format where the value is stored as an integer scaled by 2^32.In short: stored = realValue * 2^32The SDK offers a .toQ32() helpers to convert numbers to fixed point numbers

updateMidpriceAndBaseSpread

Atomic update of both mid price and base spread values in a single instruction.
pool.updateMidpriceAndBaseSpread(authority, { 
midpriceQ32: newMidQ32, 
spreadFactorQ32: newSpreadQ32, 
});

updateDeltaStaleness

Delta staleness is a kill-switch. It allows the operator to set the threshold after which, if no oracle update exists, the pool stops quoting the asset.
pool.updateDeltaStaleness(authority, { deltaStaleness: 150 }); //measured in slots upto 225