> ## 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.

# Reading Pool State

Call `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.

```rust theme={null}
// Requires the `rpc` feature
pool.refetch_states(&rpc_client)?;
```

If you are managing account data yourself (Geyser, websocket), reconstruct the pool with `Hadron::from_accounts` using the latest data instead.

***

## getMidprice

Current midprice decoded from the on-chain Q32 oracle value.

```rust theme={null}
let mid = pool.get_midprice(); // e.g. 1.0023
```

**Returns** `f64`

***

## getSpreadFactor / getSpreadBps

Current base spread decoded from the on-chain Q32 oracle value. A factor of `0.9995` means 5 bps of spread.

```rust theme={null}
let factor = pool.get_spread_factor(); // e.g. 0.9995
let bps    = pool.get_spread_bps();    // e.g. 5.0
```

**Returns** `f64`

***

## getActiveCurveSlots

Returns the slot index for each currently active curve.

```rust theme={null}
let slots = pool.get_active_curve_slots();
// ActiveCurveSlots { price_bid: 0, price_ask: 0, risk_bid: 0, risk_ask: 0 }
```

**Returns** `ActiveCurveSlots`

***

## getActiveCurves

Decodes and returns all four active curves from the appropriate prefab data.

```rust theme={null}
let curves = pool.get_active_curves()?;
// curves.price_bid.points, curves.price_ask.points, etc.
```

**Returns** `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.

```rust theme={null}
use hadron_sdk_v2::types::CurveType;

let curve = pool.get_curve_slot(CurveType::PriceBid, 1)?;
```

**Returns** `Result<CurveSide, HadronSdkError>`

| **Param**    | **Type**    | **Description**                                     |
| ------------ | ----------- | --------------------------------------------------- |
| `curve_type` | `CurveType` | One of `PriceBid`, `PriceAsk`, `RiskBid`, `RiskAsk` |
| `slot`       | `u8`        | Slot index                                          |
