Unwrapping APOW
Unwrapping converts APOW back into XPOW by burning APOW tokens and releasing a proportional share of the treasury's XPOW reserve — the reverse of the staking reward pipeline.
Prerequisites
- APOW tokens in your wallet (earned via claiming or transfer)
- AVAX for gas (~0.003–0.005 per unwrap)
- The treasury must have sufficient XPOW to back your unwrap
Step-by-Step
1. Check the Treasury Balance
The treasury's XPOW balance determines the conversion rate for unwrapping. The more XPOW the treasury holds relative to the total APOW supply, the better rate you receive:
XPower.balanceOf(moeTreasuryAddress)This returns the raw uint256 balance in atomic XPOW units (divide by
2. Calculate Your Expected XPOW
The amount of XPOW you receive when unwrapping
For example, if the treasury holds 100,000 XPOW and the total APOW supply is 10,000:
- Unwrapping 100 APOW →
XPOW - Rate: 10 XPOW per 1 APOW
You can estimate this off-chain before submitting:
const xpowOut = (apowAmount * treasuryBalance) / totalAPowSupply;3. Burn APOW
APower.burn(amount)Where amount is the atomic APOW quantity (e.g., 100 * 10^18 for 100 APOW).
The burn function:
- Destroys the specified APOW from your wallet
- Computes your proportional share of treasury XPOW
- Transfers that XPOW from the treasury to your wallet
Gas cost: ~60,000–80,000 — simpler than claiming because there's no rate computation, no banq processing, and no reward formula evaluation.
4. Verify the Unwrap
After the transaction confirms:
- Your APOW balance decreases by
amount - Your XPOW balance increases by the computed proportional share
- The total APOW supply decreases (check
APower.totalSupply()) - The treasury's XPOW balance decreases proportionally
The Burn event on the APower contract logs the exact amounts burned and released.
Conversion Rate
The unwrap rate is pro-rata by supply share, not a fixed exchange rate. This means:
- If treasury XPOW > total APOW supply: Each APOW is backed by more than 1 XPOW — unwrapping is favorable
- If treasury XPOW < total APOW supply: Each APOW is backed by less than 1 XPOW — unwrapping is unfavorable
- If treasury XPOW = total APOW supply: 1:1 backing
The rate changes continuously as:
| Event | Effect on Rate |
|---|---|
| Mining solutions submitted | Treasury XPOW increases → rate improves |
| Stakers claim APOW | Treasury XPOW decreases, APOW supply increases → rate may decline |
| Others unwrap APOW | Both treasury and supply decrease → rate may shift |
| APOW transferred (not burned) | No effect — the supply is unchanged |
You are not locked into a rate — unwrap whenever the conversion is favorable for you.
Supply Effect
Unwrapping reduces both the APOW supply and the treasury's XPOW balance:
- APOW supply decreases — the burned APOW is permanently removed
- Treasury XPOW decreases — the released XPOW leaves the treasury and returns to circulation
- Backing ratio changes — the ratio of treasury XPOW to APOW may increase or decrease depending on the exact amounts
Burning APOW is the only way APOW supply decreases (aside from the banq system's excess burn). New APOW enters only through staking claims.
No Rate-Limiting on Unwrap
Unlike APOW minting (which is rate-limited to ~1 token/minute), unwrapping has no rate limit. You can burn any amount of APOW in a single transaction without restriction. This asymmetry exists because:
- Minting creates new tokens from treasury reserves and must be throttled to prevent rapid treasury drain
- Burning destroys tokens and releases reserves — there's no risk of draining a nonexistent pool
The only constraint is the treasury's actual XPOW balance. If you try to unwrap APOW representing more XPOW than the treasury holds, the transfer from the treasury will fail (or underflow) — but in practice, the pro-rata formula ensures you never receive more than the treasury's total balance.
Treasury Minimum
The treasury maintains a buffer of XPOW at all times. This buffer comes from:
- The 50% mining split (continuous inflow)
- XPOW deposited by stakers (locked behind maturity)
- Any direct XPOW transfers to the treasury address
The treasury does not enforce a minimum balance for unwrapping. If the treasury balance is very low (e.g., early in the protocol's life when few mining solutions have been submitted), your proportional XPOW share may be small. Unwrapping is most valuable when the treasury has accumulated significant mining inflow.
When to Unwrap vs. When to Stake
| Goal | Action |
|---|---|
| Liquidate APOW to XPOW | Unwrap — converts APOW to spendable XPOW |
| Enter or exit staking | Use the NFT pipeline — unstake to get XPowerNfts, then redeem for XPOW after maturity |
| Short-term XPOW needs | Unwrap — instant, no maturity lock |
| Long-term XPOW holding | Redeem XPowerNfts after maturity — bypasses the APOW supply entirely |
Unwrapping is the fastest path from APOW to liquid XPOW. The alternative — redeeming XPowerNfts — requires unstaking first and then waiting for maturity if the NFTs haven't matured yet.
What Happens Internally
When you call APower.burn(amount), the following sequence executes:
1. Supply Check
The contract computes totalSupply = APower.totalSupply(). Your share of the treasury is amount * treasuryBalance / totalSupply. This follows standard ERC4626-style proportional redemption — you receive XPOW in proportion to the APOW supply you're retiring.
2. APOW Burn
_burn(msg.sender, amount) destroys the APOW tokens from your wallet. This reduces the total supply by amount. The burned tokens are permanently gone — they cannot be reminted through any mechanism.
3. XPOW Release
The contract calls XPower.transfer(msg.sender, xpowAmount). The XPOW comes from the APower contract's own XPOW balance (which was accumulated during APOW minting via transferFrom from the MoeTreasury). The XPOW flows from address(this) (the APower contract) to your wallet.
The amount transferred is:
uint256 xpowAmount = Math.mulDiv(amount, xpowBalance, totalSupply);Where xpowBalance is XPower.balanceOf(address(this)) — the APower contract's current XPOW holdings.
4. Proportionality Guarantee
Each unwrap receives a fair share of the treasury. If two users unwrap sequentially:
- User A burns 10% of the supply → receives 10% of treasury XPOW
- User B burns 20% of remaining supply → receives 20% of remaining treasury XPOW
Neither user is advantaged or disadvantaged by the order of operations. The pro-rata formula ensures every APOW token has equal claim on the treasury.
5. Event Emission
The Burn(msg.sender, amount) event is emitted from the ERC20 burn, and the Transfer event logs the XPOW movement. Both events together provide a complete audit trail of the unwrap: how much APOW was destroyed and how much XPOW was released.