<!-- source: https://www.secondlayer.tools/docs/pox5 -->

# PoX-5

Every print from the `pox-5` boot contract (SIP-045, live since Bitcoin block 960,230), decoded and filterable by staker, signer or bond, plus per-cycle totals.

```ts
for await (const event of sl.index.pox5.events.walk({ topic: "stake", signer: "SP…" })) {
  console.log(event.block_height, event.staker, event.amount_ustx);
}

const { events } = await sl.index.pox5.events.list({
  topic: "register-for-bond",
  fields: ["bond_index", "amount_sats"],
});
```

Current totals and every signer's stacked STX, free with no key: [PoX-5 staking data](/data/pox5).

## Reads

| Read | Route | SDK |
| --- | --- | --- |
| All 19 print topics | `/v1/index/pox5/events` | `pox5.events.list` / `walk` / `consume` |
| Reward cycles of the current PoX | `/v1/index/pox/cycles` · `/{reward_cycle}` | `pox.cycles.list` / `walk` / `get` |

`fields` narrows each row to the columns you ask for. `pox5.events.consume()` is the checkpointed sweep: [Checkpoints](https://www.secondlayer.tools/docs/checkpoints.md).

## Filters

| Filter | Narrows to |
| --- | --- |
| `topic` | One print topic |
| `staker` | One staker |
| `signer` | One signer; alone it returns a pool's full activity, claims and key grants included |
| `signerManager` | One signer manager |
| `bondIndex` | One bond |
| `rewardCycle` | One reward cycle |
| `fromHeight`, `toHeight` | A block-height range |
| `confirmed` | `true` holds a read to rows past the reorg margin |

`register-for-bond` rows add `bond_index`, `amount_sats`, `is_l1_lock` and `data.btc-lockup`.

## Tradeoff

This is the print log, not a position scoreboard: positions and payouts are a [subgraph](https://www.secondlayer.tools/docs/subgraphs.md) you deploy. Cycles are exact to the node and follow the chain again at the next PoX fork. PoX-4 cycle history is final and not served; read pox-4 calls from contract calls. To be pushed instead: [Webhooks](https://www.secondlayer.tools/docs/webhooks.md#protocol-triggers).

```bash
curl "$SECONDLAYER_API_URL/v1/index/contract-calls?contract_id=SP000000000000000000002Q6VF78.pox-4" \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

## Read next

- [Checkpoints](https://www.secondlayer.tools/docs/checkpoints.md)
- [Subgraphs](https://www.secondlayer.tools/docs/subgraphs.md)
- [Webhooks](https://www.secondlayer.tools/docs/webhooks.md)

## Notes for agents

- Events: GET /v1/index/pox5/events?topic=register-for-bond or sl.index.pox5.events.walk({ topic, signer }). Cycles: GET /v1/index/pox/cycles/{reward_cycle}.
- PoX-5 has no MCP tool; use REST or the SDK.

## Setup

Ensure setup once, skipping any step already done:
- CLI: `bun add -g @secondlayer/cli`
- Instance: `secondlayer init` writes `INSTANCE_TOKEN`. Loopback `/v1` reads need no key.
- Hosted reads: export `SECONDLAYER_API_KEY` (`sk-sl_*`) or buy credits with `secondlayer credits buy` (`balance`, `refill`), then `secondlayer whoami`
