Deposit & Redeem Flow
Deposit CNLQ → Mint cCNPY
Users deposit CNLQ into the canoLiq pool and receive cCNPY at the current exchange rate.
canoliqctl deposit <address> <amount_uCNPY>
Effect:
- CNLQ 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 CNLQ
Users burn cCNPY and queue a CNLQ 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: CNLQ owed at maturityunbond_complete_height: Current height +UnstakingBlocks
CanoliqGlobals.pendingRedemptionCNPYis incrementedCanoliqGlobals.nextRedemptionIdis incremented
Claim Matured Redemption
After the unbond period, users claim their CNLQ.
canoliqctl claim <address> <redemption_id>
Effect:
- Validates the redemption exists and has matured (
current_height >= unbond_complete_height) - CNLQ 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