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:
getCurveSlot
Decode a specific curve slot by type and index.Result<CurveSide, HadronSdkError>
.png?fit=max&auto=format&n=pH37fL0GL14scVCH&q=85&s=5749b485c8c5b2386a4cca404e97d6be)