Deposit & Redeem Flow
Deposit CNPY → Mint cCNPY
Users deposit CNPY into the canoLiq pool and receive cCNPY at the current exchange rate.
canoliqctl deposit <address> <amount_uCNPY>
Effect:
- CNPY is debited from the user's Canopy
Account - cCNPY is minted to the user's canoLiq balance:
ccnpyMinted = depositAmount × totalCCNPYSupply / totalPooledCNPY CanoliqGlobals.totalPooledCNPYandCanoliqGlobals.totalCCNPYSupplyare updated- A protocol fee is charged and split
Redeem cCNPY → Queue CNPY
Users burn cCNPY and queue a CNPY redemption that matures after the validator unstaking window.
canoliqctl redeem <address> <amount_uCCNPY>
Effect:
- cCNPY is burned from the user's balance
- A
Redemptionrecord is created with:cnpy_amount: CNPY owed at maturityunbond_complete_height: Current height +UnstakingBlocks
CanoliqGlobals.pendingRedemptionCNPYis incrementedCanoliqGlobals.nextRedemptionIdis incremented
Claim Matured Redemption
After the unbond period, users claim their CNPY.
canoliqctl claim <address> <redemption_id>
Effect:
- Validates the redemption exists and has matured (
current_height >= unbond_complete_height) - CNPY is credited to the user's Canopy
Account CanoliqGlobals.pendingRedemptionCNPYis decremented- The redemption record is deleted
Worked Example
export CANOLIQCTL_PASSWORD=hunter2
# Deposit 1 CNPY (1,000,000 uCNPY)
./canoliqctl deposit alice 1000000
# Redeem 0.25 cCNPY (250,000 uCCNPY)
./canoliqctl redeem alice 250000
# After unstaking window (~UnstakingBlocks blocks)
./canoliqctl claim alice 0