CallDocumentation Index
Fetch the complete documentation index at: https://docs.hadron.fi/llms.txt
Use this file to discover all available pages before exploring further.
refetch_states first to ensure all decoded values on the instance reflect the latest on-chain data before reading or building instructions.
refetch_states (rpc feature)
Re-fetches all on-chain accounts (config, oracle, curve metadata, prefabs) and updates the instance in-place.Hadron::from_accounts using the latest data instead.
getMidprice
Current midprice decoded from the on-chain Q32 oracle value.f64
getSpreadFactor / getSpreadBps
Current base spread decoded from the on-chain Q32 oracle value. A factor of0.9995 means 5 bps of spread.
f64
getActiveCurveSlots
Returns the slot index for each currently active curve.ActiveCurveSlots
getActiveCurves
Decodes and returns all four active curves from the appropriate prefab data.Result<ActiveCurves, HadronSdkError>
Each CurveSide contains:
| Field | Type | Description |
|---|---|---|
num_points | u8 | Number of curve points |
default_interpolation | Interpolation | Default interpolation mode |
x_mode | CurveXMode | Native (token atoms) or Alternate |
risk_mode | RiskMode | Virtual or Integrated |
points | Vec<DecodedCurvePoint> | The decoded curve point array |
getCurveSlot
Decode a specific curve slot by type and index.Result<CurveSide, HadronSdkError>
| Param | Type | Description |
|---|---|---|
curve_type | CurveType | One of PriceBid, PriceAsk, RiskBid, RiskAsk |
slot | u8 | Slot index |
.png?fit=max&auto=format&n=pH37fL0GL14scVCH&q=85&s=5749b485c8c5b2386a4cca404e97d6be)