Alluo Explained
  • Welcome
    • 🧭 The Basics
  • Getting Started
    • πŸ’» The DeFi Web App
      • ❓ Connecting to the app
      • 🚜 Depositing into the farms
      • πŸ™Œ Other basics
      • 🏦 Importing your Mobile app wallet to Metamask
      • 🧬 Add the polygon network manually in Metamask.
      • ⛓️ Bridging Stablecoins from another chain
    • πŸ“±The Mobile app
      • πŸ—οΈ Setting up your account
      • 🏦 Depositing money into the app
      • πŸ™Œ Other basics
      • πŸ” Exporting your private key
    • πŸ“–Tech deep dive: Contract Address Library
  • Understanding Alluo
    • πŸ’΅ How does Alluo get the yield?
      • 🐰 Going deeper into the Alluo protocol rabbit hole
    • 🧐 FAQ
  • Tokens & Tokenomics
    • πŸͺ™ The tokens
    • πŸ‘¨β€πŸ”¬Tech deep dive: Interest Bearing {asset} token
      • Depositing
      • Withdrawals
      • IbAlluo on different chains
      • StIbAlluo and Superfluid
        • A closer look at the integration between IbAlluo and StIbAlluo
      • Using the IbAlluo contract directly to create streams
      • Liquidity Handler and adapters
        • Deposit process with the Liquidity Handler
        • Withdraw process with the Liquidity Handler
    • πŸ“ˆ Tokenomics
    • πŸ‘¨β€πŸ”¬Tech deep dive: Boosting yield by compounding rewards
      • Deposit into the Vault
      • Withdraw from the Vault
      • Redeem rewards
      • Automatic boosting with Alluo
      • FraxConvex Vaults
      • Managing withdrawal requests in IERC4626
  • Decentralisation and Trust
    • πŸ—³οΈ Trustless governance and execution
    • πŸ‘¨β€πŸ”¬Tech deep dive: Vote Executor Architecture
      • Off chain votes to on chain data
      • Onchain data verifcation
      • Automated execution of votes
        • Tokenomics
        • Liquidity Direction
        • Setting APYs on farms
      • Cross chain execution of votes
      • Manually submitting vote results onchain
    • ↔️Alluo Exchange
      • Interacting with the Exchange
    • vlAlluo Architecture
    • Contracts upgrades
    • Investment strategies
      • πŸ“ˆFrax Convex Finance
        • Adding new pools into the strategy
        • Investing into a pool
  • More Advanced Features
    • πŸ” Repeat payments, streaming IbAlluo
  • Product Updates
    • πŸ‘Œ Product Roadmap: Building the right products
    • πŸ’» Web App releases
    • πŸ“± Mobile App releases
    • 🏎️ Alluo Boost
  • tutorial projects
    • Example: USDC to streaming 1 IbAlluo per second
    • Example: Using IbAlluoUSD and Ricochet to do capital efficient DCA into ETH
Powered by GitBook
On this page
  1. Tokens & Tokenomics
  2. Tech deep dive: Boosting yield by compounding rewards

Redeem rewards

Here we explore how rewards can be withdrawn in CVX-ETH LPs or any ERC20 supported by the Alluo Exchange

There are two ways you can withdraw your rewards accumulated through your principal:

1. Withdraw the actual CVX-ETH LP token that is generating yield in the Alluo Pool.

Alluo Vault
/// @notice Allows users to claim their rewards
/// @dev Withdraws all reward tokens from the alluo pool and sends it to the user.
/// @return Uint256 value of total reward tokens
function claimRewards() public returns (uint256) {
    _distributeReward(_msgSender());
    uint256 rewardTokens = rewards[_msgSender()];
    if (rewardTokens > 0) {
        rewards[_msgSender()] = 0;
        IAlluoPool(alluoPool).withdraw(rewardTokens);
        rewardToken.safeTransfer(_msgSender(), rewardTokens);
    }
    return rewardTokens;
}

Remember that CRV,CVX and any bonus reward tokens from staking LPs are being concurrently generated in both the Vault (through the principal LP token) and the Alluo Pool (through the staked CVX-ETH LP purchased with rewards generated by the principal)

2. Withdraw in non CVX-ETH LP tokens:

This function simply takes one extra step to exchange the CVX-ETH LP reward tokens into the ERC20 token of the user's choosing before sending it to them.

AlluoStEthEthVault.sol
/// @notice Allows users to claim their rewards in an ERC20 supported by the Alluo exchange
/// @dev Withdraws all reward tokens from the alluo pool and sends it to the user after exchanging it.
/// @return Uint256 value of total reward tokens in exitTokens
function claimRewardsInNonLp(address exitToken) public returns (uint256) {
    _distributeReward(_msgSender());
    uint256 rewardTokens = rewards[_msgSender()];
    if (rewardTokens > 0) {
        rewards[_msgSender()] = 0;
        IAlluoPool(alluoPool).withdraw(rewardTokens);
        rewardToken.safeIncreaseAllowance(address(exchange),rewardTokens);
        rewardTokens = exchange.exchange(address(rewardToken), exitToken, rewardTokens,0);
        IERC20MetadataUpgradeable(exitToken).safeTransfer(_msgSender(), rewardTokens);
    }
    return rewardTokens;
}
PreviousWithdraw from the VaultNextAutomatic boosting with Alluo

Last updated 2 years ago

πŸ‘¨β€πŸ”¬