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. Decentralisation and Trust
  2. Investment strategies

Frax Convex Finance

Frax Convex pools: https://frax.convexfinance.com/

PreviousInvestment strategiesNextAdding new pools into the strategy

Last updated 2 years ago

How to invest into a pool on FraxConvex Finance?

To enter most pools in Frax Convex Finance, one should first get LP tokens from a corresponding Curve Pool. The address of the underlying Curve Pool for each Frax Pool is shown under β€˜Info’. Once tokens are staked in the Curve Pool, one gets LP tokens, and usually the address of that LP token is shown as Curve LP token address.

Next, those Curve LP tokens should be deposited in LP token address, which gives wrapped LP tokens in return in 1:1 ratio. Finally, wrapped LP tokens can be locked in the staking contract of the pool, shown as Staking address.

The funds are locked in Frax Pool for at least 7 days. For locking one gets rewards, and all the reward tokens can be seen if you click β€œ?” as shown on Image 1. Usually, there are 3 reward tokens: FXS (Frax shares), CRV (Curve token) and CVX (Convex token).

One can also check the rewards in the Staking contract by calling getAllRewardsTokens(), which usually returns only FXS. CRV and CVX come from Curve pool.

Example of investing into FRAX/USDC pool:

How do funds get allocated into a particular strategy?

We call VoteExecutor.sol contract which orchestrates the investment process. First, it fetches all the data needed to enter the pool from the StrategyHandler.sol and then calls invest() of CurveFraxConvexStrategy.sol.

When we call invest(), CurveFraxConvexStrategy.sol. first stakes pool token into Curve pool and receives crvLptokens. Next, crvLptokens are wrapped through the LP wrapper (the contract referred to as LP token address on Convex Frax), which is finally locked in the staking contract for at least 7 days.

Each lock is associated with a kek_id, so to avoid opening multiple positions, we first check if we already have a position in the pool. If yes, we call lockAdditional(), otherwise stakeLocked().

```solidity
        // Deposit these crvLptokens into the convex wrapper to get staked fraxLP tokens
        IConvexWrapper(address(stakeToken)).deposit(crvLpAmount, address(this));
        uint256 fraxLpAmount = IERC20(stakeToken).balanceOf(address(this));
        IERC20(stakeToken).safeIncreaseAllowance(fraxPool, fraxLpAmount);

        // Now stake and lock these LP tokens into the frax farm.
        //check if we have a position there already
        IFraxFarmERC20.LockedStake[] memory lockedstakes = IFraxFarmERC20(
            fraxPool
        ).lockedStakesOf(address(this));

        if (lockedstakes.length == 1) {
            bytes32 kek_id = lockedstakes[0].kek_id;
            IFraxFarmERC20(fraxPool).lockAdditional(kek_id, fraxLpAmount);
        } else {
            bytes32 kek_id;
            kek_id = IFraxFarmERC20(fraxPool).stakeLocked(
                fraxLpAmount,
                duration
            );
            kek_ids[fraxPool] = kek_id;
        }
```

​​1) Deposit poolToken (e.g. USDC) into Curve, get

2) Stake Curve LP tokens to, get LP Tokens (same address)

3) Stake LP tokens to

The logic behind the execution of investment strategy.
πŸ“ˆ
FRAX/USDC pool
Curve LP tokens
LP token address
Staking address