Mero Finance
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: strategy-spec --- # Strategy Specification: TRI-HOP-CVX **Disclaimer:** *Strategies rely on external protocols and come with their own risks. Users should carefully evaulate the strategy design and the risks associated with any protocol that a strategy interacts with. While strategies are designed to be robust and secure, users may still be exposed to the risks of external protocols.* **General info:** * **Name:** TRI-HOP-CVX * **Underlying (asset to farm):** [USDC, USDT or DAI] * **Reward tokens:** CVX, CRV * **Support other reward tokens:** True * **Description:** This strategy provides single sided liquidity to [Curve's 3pool](https://curve.fi/3pool). Then uses the LP Token 3CRV to provide single sided liquidity to a [Curve Meta Pool](https://resources.curve.fi/faq/base-and-metapools), for example [MIM](https://curve.fi/mim) or [FRAX](https://curve.fi/frax). It then stakes the Meta Pool LP Tokens in Convex, periodically harvesting CVX and CRV rewards to sell for the Underlying. ## Contracts Here is an overview of which contracts this strategy interacts with and how each contract is used (on a high level). ERC20 tokens used: - **CVX**: 0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B - Native token of Convex - **CRV**: 0xD533a949740bb3306d119CC777fa900bA034cd52 - Governance token of Curve - **WETH**: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 - Wrapped ETH (ERC20 compatible) - **Underlying**: *[set per strategy]* - Deposited into Curve 3pool as single sided liquidity - **3CRV**: - Minted by depositing into Curve 3pool - Deposited into Curve MetaPool as single sided liquidity - Burned to redeem underlying - **Curve LP Token**: *[set per strategy]* - Minted by depositing 3CRV into Curve MetaPool - Deposited in Convex Booster contract - Burned to redeem 3CRV AMMs used: - **Uniswap**: 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D - Swap coin X for Y if AMM is set as default - **SushiSwap**: 0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F - Swap coin X for Y if AMM is set as default - **Curve CVX/ETH Pool**: 0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4 - Swap CVX rewards for WETH Curve contracts used: - **Curve 3pool**: 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7 - Deposit underlying to mint 3CRV - Burn 3CRV to redeem underlying - **Curve MetaPool**: *[set per strategy]* - Deposit 3CRV to mint LP Token - Burn LP Token to redeem 3CRV Convex contracts used: - **Booster**: 0xF403C135812408BFbE8713b5A23a04b3D48AAE31 - Deposit and Withdraw Curve LP Token - **Rewards**: *[set per strategy]* - Stake Convex LP Token to earn CRV, CVX and other rewards ## Convex Background [Convex Finance](https://www.convexfinance.com/) is a protocol built around Curve, which essentially allows Curve LPs to receive a higher boost on CRV rewards by staking Curve LP tokens on Convex and not directly on Curve. Furthermore, CRV holders can lock their CRV on Convex for veCRV and in exchange receive cvxCRV, which is essentially tokenized veCRV. Note that once CRV is deposited on Convex, it cannot be withdrawn. However, Convex incentivizes LPs of Sushiswap pools for CRV-cvxCRV pools, by rewarding these LPs with CVX tokens. Additionally, [CVX](https://github.com/convex-eth/platform/blob/main/contracts/contracts/Cvx.sol) rewards get minted on a per rata basis as CRV rewards are received by Convex LPs. A platform fee is charged by Convex on CRV rewards, which goes in part to users that lock CRV for cvxCRV (and stake cvxCRV), as well as CVX stakers. Stakers of cvxCRV also receive 3CRV rewards, which are the governance fees paid by Curve on a weekly basis. Overall there are three roles a user can have on Convex to earn rewards: **1. Liquidity provider (stake Curve LP tokens):** - Claim CRV rewards from Convex - Claim CVX rewards from Convex **2. CRV depositor (lock CRV for cvxCRV; stake cvxCRV):** - Receive 3CRV (Curve trading fees) - Receive CVX - Receive CRV (Convex platform fees) **3. CVX staker:** - Receive cvxCRV (platform fees) ## Strategy Details The TRI-HOP-CVX strategy has the following core components. ### Deposits By calling `strategy.deposit()`, all available underlying held by the strategy will be provided as single sided liquidity into the Curve 3pool. The Curve 3CRV LP Token will then be provided as single sided liquidity into a Curve MetaPool. The Curve MetaPool LP Token will then be deposited into the Convex `Booster` contract (details [here](https://github.com/convex-eth/platform/blob/main/contracts/contracts/Booster.sol)). Finally the Convex LP Token is staked for CRV and CVX rewards in the Convex `Rewards` contract. ### Reward Claiming The Convex reward pools all implement the `IRewardStaking` interface. You can find the implementation of these reward pools [here](https://github.com/convex-eth/platform/blob/main/contracts/contracts/BaseRewardPool.sol). Rewards are claimed by calling the `getReward()` method on the `Rewards` contract. There may be a situation whereby a Curve pool is incentivized, i.e. LPs of the pools receive additional reward tokens for depositing funds. These extra rewards would be also be claimed through Convex on `getReward()`. In order to be able to process these on the strategy side, the strategy contains a list of all the possible`rewardTokens` in which it may hold funds. New tokens can be added to this list by the admin. When funds are liquidated, the reward tokens are liquidated for the underlying. ### Harvesting When `strategy.harvest()` is called (by the vault), CRV and CVX rewards will be claimed. All CVX and CRV rewards earned by the strategy are first taxed, where the taxed amount goes to the [Mero CVX reserve](https://hackmd.io/FQAk8n1YQkO_EGk45Zts8Q) and gets vote locked on Convex. The net CVX and CRV rewards earned are all sold off for the underlying. Note that `harvest()` does not automatically redeposit underlying into Convex (reduce gas costs). ### Balance The balance of the strategy includes idle underlying, idle 3CRV, idle Curve LP Tokens and staked Curve LP Tokens. Any unclaimed rewards are not included in the balance. The balance function uses `get_virtual_price` which is a view of the Curve Pools. This function returns the price of the LP Token relative to the assets of the pool. This may differ from the actual amount that can be withdrawn from the pool at any point in time, as if the pool is imblanaced, then the withdrawable amount may be less than or greater than the virtual price. This is in place as a security measure to protect against attacks that intentionally cause imbalance in curve pools to manipulate the balance of a strategy. ### Imbalance Tolerance Providing single sided liquidity into Curve pools can be undesirable if the pool is significantly imbalanced. If a malicious actor frontran deposit and withdrawal transactions and caused an imbalance in the pool, the strategy could receive very little LP tokens when depositing, or receive very little of the underlying when withdrawing. To protect against this, the strategy uses imbalance tolerance thresholds to ensure that the pool is balanced within a range when withdrawing and depositing. When depositing into the pool using the `add_liquidity` function, the `min_mint_amount` is set to specify the minimum amount of LP tokens to accept for the deposit. This value is set by using the `get_virtual_price` function to get the expected LP received for a perfectly balanced pool. Then this value is reduced by a percent `imbalanceToleranceIn` to get the minimum that we are willing to accept considering that the pool may have slight imbalances. Similarly with withdrawing using `remove_liquidity_imbalance` or `remove_liquidity_one_coin` the maximum LP burned is set with `max_burn_amount` and the minimum underlying received is set with `min_amount` respectively. Both of these use the percent multiplier `imbalanceToleranceOut` to add a buffer on what is an acceptable amount.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully