Skip to content

amadeobrands/YieldDog

Repository files navigation


Logo

Yield Dog - ETH Singapore 2023

Fetch the highest yields fully decentralized
See Yield Dog in action!
Logo
Contact us
. Amadeo Brands . Shawn
. William
See Yield Dog in action!
See the Yield Dog pitchdeck!

Yield Dog

Yield Dog operates as a "pool of pools" LP aggregator, akin to 1inch but with a decentralized edge. Starting with LSDs for our hackathon prototype, we target a complete MVP within 3-4 months. Our design employs a unique trailing AMM curve to manage pools and encourage arbitrage. Future work will refine the UI and include audits, alongside developing more complex pools like one shifting between 3Pool and sDAI.

Technical high-level concept

We want to hold multiple LSD tokens.

The naive way to do that would be using a multi-asset vault (ERC4626). Issues with vault are many, lots of on-chain complexity (many smart contracts) and attack vectors. Namely when swapping between LSD assets (MEV sandwich attacks, oracles price feed...).

Using a Pool instead of a vault removes to need for Oracle and external asset swapping. Also, remove smart contract complexity as both pricing and asset allocation are decided by the AMM formula. The more complex arbitrage calculation is pushed off-chain.

Currently there exist 2 pools of LSDs on ETH mainnet (one on Curve and one on Balancer). We will build a "Master Pool" that will hold those LSD pool tokens, a pool of pools.

Smart contract: MasterPool

The MasterPool is a smart contract that functions as a liquidity pool. Here's a detailed breakdown:

AddLiquidity(): Enables users to add assets to the liquidity pool, which can then be used for trading or earning rewards. This process usually involves depositing a pair of tokens to maintain the balance in the pool.

RemoveLiquidity(): This lets users remove their assets from the liquidity pool, often in the form of tokens and their respective trading pairs. This action might be subject to fees or penalties, depending on the pool's design.

Swap: Allows users to trade tokens by leveraging the liquidity provided in the pool. For instance, a user can swap Token A for Token B, subject to available liquidity and potential price slippage.

Foundry test files here

Smart contract: Gateway

The Gateway is a smart contract that offers a suite of financial functionalities to users. Here's a breakdown:

Deposit(): Enables users to deposit ETH into the contract in return for the master pool LP tokens

Redeem(): Allows users to withdraw their ETH from the contract.

TotalAssets(): Provides the total assets under management (AUM) of the contract, denominated in Wrapped Ether (weth).

sharesToAssets(): Computes the value of a user's assets within the contract, priced in Wrapped Ether (weth).

sharesToUnderlyingAssets(): Gives the value of a user's assets but priced in various Ethereum-based assets such as wsteth, reth, and sfrxeth. This function helps users understand their holdings' composition and value in different underlying assets.

Foundry test files here

Deployments

ETH Sepolia LSD

Deployer Account

MasterPool Contract

Gateway Contract

ETH Sepolia USD stables

Similar concept, pool of pools on top of sDAI (yield-bearing usd stable token) and curve 3pool

Deployer Account

Gateway contract

MasterPool contract

Taiko Alpha

Deployer Account

MasterPool contract (code Verified)

Gateway contract

Mantle testnet

Deployer Contract

MasterPool contract

Gateway contract

Linea goerli testnet

Deployer Contract

MasterPool contract

Gateway Contract

Polygon zkevm testnet

Deployer Contract

MasterPool contract

Gateway Contract

Technical documentation

Getting Started

Local ETH node

Copy .env.example to .env and modify to set value

cp .env.example .env

install forge dependencies

forge install

Run a local node on a forked eth mainnet state

pnpm run anvil-mainnet

In another terminal, run the deploy script

pnpm run deploy:local

The addresses for the masterpool and gateway contracts will be displayed

Front end development server:

install node dependencies

pnpm install

Run dev server

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 with your browser to see the result.

Smart Contract walkthrough

Screenshots

1 2 3 4 5 6 7

About

Fetch the highest LSD yield

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors