MahaDAO / arth-strategies

Smart contracts for the various strategies
https://vaults.arth.loans/
0 stars 2 forks source link

Create a single asset farming contract for the various ARTH farms #14

Open senamakel opened 1 year ago

senamakel commented 1 year ago

Currently there are couple of farms where users can a yield in MAHA tokens for contributing to the protocol. These farms are accessible via our farming page made live over here.

https://arth.loans/#/loans/all-loans

There are three farms which we'd like to simplify.

We would like to create a contract which allows users to enter and exit into these farms using just one asset as an input.

So say if only have ETH. And I want to enter into the ARTH/ETH Uniswap V3 pool.

Then I should be able to deposit ETH into the contract, the contract automatically

I should be able to claim rewards normally like any other staker

if I want to exit, then the contract automatically does all the steps in reverse.

yato-sketch commented 2 months ago

To improve the process of entering and exiting these farming pools, I think about the below improvements

  1. Gas Optimization

Batch Transactions: Bundle all steps (minting ARTH, creating LP, and staking) into single atomic transaction. This will reduce gas costs compared to executing each step in separate transactions.

  1. Flexible Collateral Options

Instead of limiting collateral to ETH, allow people to provide different assets (USDC, DAI) as collateral, it enables them to enter ARTH pools based on their available assets. The contract can include a swap mechanism to convert non supported collateral into ARTH or ETH

  1. Dynamic Liquidity Provisioning

Allow users to specify how much of their single asset should be allocated to liquidity provisioning and staking. For instance, users can specify a percentage of their ETH to go towards ARTH minting or LP creation to accommodate different risk preferences

  1. Automated Rewards Management

Include auto compounding feature where rewards (MAHA tokens) can be automatically reinvested into the same or other farms. This maximizes user yield and encourages long-term liquidity

  1. Slippage Control and Front running Protection

Implement slippage controls to prevent users from losing a large portion of their collateral due to volatile market conditions when creating LP positions.

Consider implementing MEV-resistant mechanisms to protect users from front-running or sandwich attacks, especially during LP creation on Uniswap V3

  1. Integration with WalletConnect or Other Wallets

Can set this based on your decision