andrebrener / alchemix_extender

Use Alchemix V2 to get a self repaying loan and then swap alETH for DAI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alchemix Extender

Contracts & Front end for the app

What the app does:

  1. Deposits DAI in Alchemix V2
  2. Mints alUSD from Alchemix V2
  3. Swaps alUSD for DAI in Curve
  4. Transfers DAI to a selected beneficiary.

How to use it

Alchemix V2 only allows whitelisted contracts (regular EOAs are obviously allowed) to interact with their contract. So, for now we must use this app with a local mainnet fork and whitelist ourselves in the Alchemix Whitelist contract.

  1. Install hardhat & dependencies
  2. Run local blockchain using mainnet forking
  3. Run scripts/deploy in localhost
  4. Create .env file and fill out their variables as .env.example
  5. Run scripts/setup-for-front in localhost to set the whitelist and other setup.
  6. Run the frontend with npm run dev
  7. Use the app & Enjoy :)

This is unadited code and for experimental purposes. Use it at your own risk.

About

Use Alchemix V2 to get a self repaying loan and then swap alETH for DAI


Languages

Language:Solidity 57.7%Language:TypeScript 24.5%Language:JavaScript 13.9%Language:SCSS 3.9%