Skip to content

An ERC 4626 vault-implementation of a yield farm earning yield through compound on their deposits.

Notifications You must be signed in to change notification settings

literallymarvellous/yield-farm

Repository files navigation

Yield Farm

Project: Yield Farm

Author: Marvellous Ahiara

Still in progress but core functionality working on testnet

Overview:

A Flexible, minimalist, and gas-optimized yield farm protocol for earning interest on ERC20 tokens through Compound Finace. Users deposit token into protol vaults and earn yield through compound on their deposits. Withdrawals include profit minus protocol fees set at 5% and withdrawals are allowed at anytime.

Deliverables

  1. Web App: A user-friendly application to interact with vaults.

    Functionality:

    1. Deposits into selected vault(s).
    2. Withdrawals from selected vault(s).
    3. View APY for various vault(s).

Architecture:

Smart Contracts: Actions performed by Protocol are done onchain and controlled by these smart contracts. . Vault.sol: ERC4626 standard smart contract for earning interest on any ERC20 token through the compund protocol. . Vaultfactory.sol: Factory for vault deployments and management. . interface: Interfaces of external contracts Vaults and modules interact with. . CErcInterface.sol: Interface for Compound ctoken.

Setup

This is a monorepo setup built built with turbo-repo. The frontend is built with Nextjs and smart contracts with foundry. Ensure forge is installed for foundry.

Directory

yield-farm |** apps | |** web |
|** packages | |** contracts | |__ package.json

The frontend is contained in web and smart contracts in contracts

Clone repo

git clone repo
cd yield-farm

Working with Smart Contracts

install dependecies and packages

cd packages/contracts
forge install

Build smart contracts

forge build

Test smart contracts

forge test

deployment

Create .env and add to file GOERLI_RPC_URL=.... ETHERSCAN_KEY=.... PRIVATE_KEY=....

forge script script/AIMVaultFactory.s.sol:MyScript --rpc-url $GOERLI_RPC_URL --broadcast --verify -vvvv

Addresses

Goerli Testnet

Vault Factory: 0x7D7B81aeB0aF69d9F9612b1BEfa73ce600f21284 Deployed USDC Vault: 0x7Be4DE03B336BD384de692A5C348806f649D4Bb7

About

An ERC 4626 vault-implementation of a yield farm earning yield through compound on their deposits.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published