> For the complete documentation index, see [llms.txt](https://docs.stacks.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stacks.co/reference/stacks.js/stacks-bitcoin-staking/types/poxinfo.md).

# PoxInfo

The PoX parameters, current and next cycle, and sBTC contracts from the node's `/v2/pox` endpoint, as returned by [fetchPoxInfo](/reference/stacks.js/stacks-bitcoin-staking/fetch/fetchpoxinfo.md). The cycle helpers such as [bondPeriodToBurnHeight](/reference/stacks.js/stacks-bitcoin-staking/cycles/bondperiodtoburnheight.md) and [isInPreparePhase](/reference/stacks.js/stacks-bitcoin-staking/cycles/isinpreparephase.md) compute from it without another network call.

***

### Usage

```ts
import { bondPeriodToBurnHeight, fetchPoxInfo, isInPreparePhase } from '@stacks/bitcoin-staking';

const poxInfo = await fetchPoxInfo({ network: 'mainnet' });

const inPrepare = isInPreparePhase({ burnHeight: poxInfo.currentBurnchainBlockHeight, poxInfo });
const bondStart = bondPeriodToBurnHeight({ bondIndex: 0, poxInfo });
```

#### Notes

* The bond helpers take the first pox-5 reward cycle from the `contractVersions` entry whose `contractId` ends in `.pox-5`. If there is no such entry, for example because the node omits `contract_versions`, they throw an `Error` whose message starts with `pox-5 not activated yet`.

[**Reference Link**](https://github.com/stx-labs/stacks.js/blob/6101c99efe5a9616ce7e16cef68e28fd10676e7e/packages/bitcoin-staking/src/types.ts#L50-L83)

***

### Definition

```ts
export interface PoxInfo {
  /** Fully-qualified pox contract id. */
  contractId: string;
  /** Current burnchain block height. */
  currentBurnchainBlockHeight: number;
  /** Burnchain height at which PoX began. */
  firstBurnchainBlockHeight: number;
  /** Reward cycle currently in progress. */
  rewardCycleId: number;
  /** Reward cycle length in burnchain blocks. */
  rewardCycleLength: number;
  /** Prepare phase length in burnchain blocks. */
  prepareCycleLength: number;
  /** Reward slots per cycle. */
  rewardSlots: number;
  /** Current reward cycle summary. */
  currentCycle: CycleInfo;
  /** Next reward cycle summary. */
  nextCycle: NextCycleInfo;
  /** One entry per deployed pox contract version (pox through pox-5). */
  contractVersions: PoxContractVersion[];
  /**
   * sBTC token contract this node uses for pox-5 payments. Fixed on mainnet;
   * node-configured elsewhere, so read it rather than hardcoding it.
   */
  sbtcContract: string;
  /** sBTC registry contract the node reads the per-cycle waterfall recipient from. */
  sbtcRegistryContract: string;
}
```

***

### Properties

| Property                      | Type                                                                                              | From `/v2/pox`                   | Description                                                                                  |
| ----------------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------- | -------------------------------------------------------------------------------------------- |
| `contractId`                  | `string`                                                                                          | `contract_id`                    | Active PoX contract, `SP000000000000000000002Q6VF78.pox-5` on mainnet                        |
| `currentBurnchainBlockHeight` | `number`                                                                                          | `current_burnchain_block_height` | Bitcoin block height the node has reached                                                    |
| `firstBurnchainBlockHeight`   | `number`                                                                                          | `first_burnchain_block_height`   | Bitcoin block height at which PoX began                                                      |
| `rewardCycleId`               | `number`                                                                                          | `reward_cycle_id`                | Reward cycle in progress                                                                     |
| `rewardCycleLength`           | `number`                                                                                          | `reward_cycle_length`            | Cycle length in Bitcoin blocks, 2,100 on mainnet                                             |
| `prepareCycleLength`          | `number`                                                                                          | `prepare_cycle_length`           | Prepare phase length in Bitcoin blocks, 100 on mainnet                                       |
| `rewardSlots`                 | `number`                                                                                          | `reward_slots`                   | Reward slots per cycle                                                                       |
| `currentCycle`                | [CycleInfo](/reference/stacks.js/stacks-bitcoin-staking/types/cycleinfo.md)                       | `current_cycle`                  | Current cycle ID, micro-STX staked, and whether PoX is active                                |
| `nextCycle`                   | [NextCycleInfo](/reference/stacks.js/stacks-bitcoin-staking/types/nextcycleinfo.md)               | `next_cycle`                     | Next cycle ID and micro-STX staked for it so far                                             |
| `contractVersions`            | [PoxContractVersion](/reference/stacks.js/stacks-bitcoin-staking/types/poxcontractversion.md)`[]` | `contract_versions`              | One entry per PoX contract version, `pox` through `pox-5`. Empty if the node omits the field |
| `sbtcContract`                | `string`                                                                                          | `pox_5_sbtc_contract`            | sBTC token contract pox-5 pays through                                                       |
| `sbtcRegistryContract`        | `string`                                                                                          | `pox_5_sbtc_registry_contract`   | sBTC registry the node reads the reward recipient from                                       |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stacks.co/reference/stacks.js/stacks-bitcoin-staking/types/poxinfo.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
