Skip to content
/ Erebor Public

๐Ÿ”๏ธ A multi-protocol automated vault built on the Contract.dev Stagenet. Chaining Chainlink Automation, Uniswap V2 Swaps, and Aave V3 Yield in a single transaction.

Notifications You must be signed in to change notification settings

0xunLin/Erebor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”๏ธ Erebor: The Smart Profit Taker Vault

Automated ETH Accumulation & Volatility Protection

๐Ÿ† Built for the Contract.dev Early Builder Hackathon (November-December 2025)

License Solidity

๐Ÿ“– Overview

Erebor is a DeFi vault designed to protect and grow your treasury automatically. Like the vast wealth of the Lonely Mountain, this vault manages your assets with precision.

Instead of keeping funds idle, Erebor keeps assets fully deployed in Aave V3 to earn lending interest. It utilizes Chainlink Automation and Chainlink Price Feeds to execute a "Buy Low, Sell High" strategy 24/7 without manual intervention.

  • Take Profit: When ETH rises, it swaps to USDC to lock in gains.
  • Buy the Dip: When ETH falls, it swaps back to ETH to accumulate more tokens.

๐Ÿงฉ Architecture

The system relies on a central interaction between three protocols:

  1. Aave V3: Used for holding funds (ETH or USDC) to generate continuous yield.
  2. Uniswap V3/V2: Used for atomic swapping of assets during rebalancing.
  3. Chainlink:
    • Price Feeds: Provides accurate, tamper-proof ETH/USD data.
    • Automation: Triggers the performUpkeep function to execute swaps automatically.

Rebalancing Logic

  • ETH Mode (Accumulation): Funds are in Aave as WETH.
    • Trigger: Price > High Threshold.
    • Action: Withdraw WETH โ†’ Swap to USDC โ†’ Supply USDC to Aave.
  • USDC Mode (Safety): Funds are in Aave as USDC.
    • Trigger: Price < Low Threshold.
    • Action: Withdraw USDC โ†’ Swap to WETH โ†’ Supply WETH to Aave.

๐Ÿ› ๏ธ Tech Stack

  • Smart Contracts: Solidity (v0.8.20)
  • Framework: Foundry (Forge, Cast)
  • Integrations:
    • Chainlink Automation & Data Feeds
    • Uniswap V3/V2 SwapRouter
    • Aave V3 Pool
  • Frontend: Next.js, Wagmi, RainbowKit

๐Ÿš€ Getting Started

Prerequisites

Installation

  1. Clone the repo:

    git clone [https://github.com/0xunLin/Erebor.git](https://github.com/0xunLin/Erebor.git)
    cd Erebor
  2. Install dependencies:

    forge install
    npm install
  3. Set up environment: Create a .env file in the root directory:

    PRIVATE_KEY=your_private_key
    STAGENET_RPC_URL=your_stagenet_rpc_url

๐Ÿงช Testing

We use Stagenets on contract.dev to test interactions with simulated Aave and Uniswap contracts.

About

๐Ÿ”๏ธ A multi-protocol automated vault built on the Contract.dev Stagenet. Chaining Chainlink Automation, Uniswap V2 Swaps, and Aave V3 Yield in a single transaction.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published