> For the complete documentation index, see [llms.txt](https://docs.axiomprotocol.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.axiomprotocol.io/protocol-design/axiom-prime/staking-snapshots.md).

# Staking Snapshots

Every epoch (default: 24 hours), the system records each staker's USD-equivalent value:

```
stakeUSD = SUM(position_v * sharePrice_v * assetPriceUSD_v) for all GovernanceVaults
```

During the bootstrap phase, this simplifies to just the XRP vault position.

Snapshots are stored immutably and used for percentile calculations:

* Top 50% → eligible to create prediction markets, propose/challenge outcomes, and vote in initial resolutions.

Snapshots ensure deterministic eligibility and prevent stake-hopping manipulation.

#### Optimistic Snapshot Architecture

Axiom uses an optimistic off-chain computation model with on-chain fraud proofs to achieve major gas savings while maintaining decentralization.

{% stepper %}
{% step %}

### Normal Operation (99%+ of snapshots)

1. Off-chain indexer computes staker percentiles and builds a Merkle tree
2. Submitter posts Merkle root on-chain (\~251k gas) with economic bond (100-1000 XRP)
3. 24-hour challenge window allows anyone to dispute with fraud proof
4. If unchallenged, snapshot auto-finalizes
5. Users verify eligibility via cheap Merkle proofs (\~4k gas)
   {% endstep %}

{% step %}

### Fraud Proof (rare, economically deterred)

1. Challenger submits fraud proof with alternative Merkle root + bond
2. Contract computes percentiles on-chain (expensive! \~4M gas for 1000 stakers)
3. Compares roots: loser forfeits bond to winner (200 XRP total)
4. Economic deterrent: attacking costs $250-$2,500, defending is cheaper
   {% endstep %}

{% step %}

### Rollout Phases

1. Bootstrap (Months 0-12): Trusted signers post snapshots, no challenges (rapid iteration).
2. Challengeable (Months 12-18): Same signers, fraud proofs enabled.
3. Permissionless (Month 18+): Anyone can submit with 1000 XRP bond (full decentralization).
   {% endstep %}
   {% endstepper %}

Why this works:

* Cost efficiency: $3k-$15k/year vs $1.8M/year pure on-chain sorting.
* Decentralization: Anyone can submit/challenge with bonds ensuring honesty.
* Scalability: Off-chain computation supports millions of stakers.
* Security: Economic game theory makes attacks irrational.

#### Dual Epoch Locking: Creation vs Resolution

Axiom uses a two-epoch system to balance long-term market integrity with fresh voter participation:

* Creation Epoch: Locked when market is created, determines who can create markets.
* Resolution Epoch: Locked when the first proposal is submitted, determines who can submit proposals, vote, and receive penalties/rewards.

This prevents stake-hopping and ensures penalties/rewards apply to currently-staked participants.

Example Flow:

```
Day 1 (Epoch 100): Market created
- creationEpoch = 100
- resolutionEpoch = null

Day 90 (Epoch 190): First proposal submitted
- resolutionEpoch = 190 (LOCKED)
- Only Epoch 190 top 50% can submit proposals and vote
- Vaults enforce resolution lock on Epoch 190 participants

Day 91-93: Voting period
- Withdrawal blocked for all proposal submitters and voters
- Penalties/rewards apply to Epoch 190 stakes
```

Two snapshot mechanisms:

* Governance Snapshots (24-hour epochs): staker USD values for percentile-based eligibility.
* TVL Snapshots (hourly updates): track vault TVL for fee distribution.

Both operate independently.

#### Snapshot Automation

Snapshots are permissionless and trustless; any participant can trigger the snapshot function after an epoch duration has elapsed. Contracts fetch XRP/USD price from decentralized sources (BandChain oracle or XRP/USD-pegged stables DEX), calculate USD-equivalent positions, store data on-chain, and compute percentiles.

Epoch duration (default 24 hours) is governance-adjustable.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.axiomprotocol.io/protocol-design/axiom-prime/staking-snapshots.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
