Fujicracy / fuji-v1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🗻Fuji Finance

Borrowing Aggregator

Fuji is a protocol that aims to optimize loan expenses for DeFi users. It achieves this by monitoring the borrowing markets and whenever there is a better rate, it automatically refinances the whole debt of its users.


This project was bootstraped with scaffold-eth. The repository makes use of yarn workspaces. Workspaces can be found in /packages.

QuickStart

1. Install dependancies and run a mainnet fork

IMPORTANT! Please set ALCHEMY_ID or INFURA_ID in "./packages/hardhat/.env"

cd fuji
yarn install
yarn fork

2. Get contracts

There are 2 options to do this:

2.1. Deploy new contracts to your local fork (from step 1) and initialize them.

# in another terminal window
cd fuji
yarn deploy

This command:

  • will create packages/hardhat/artifacts and will populate it with new contracts data: abis, bytecode and addresses
  • will copy this data to other workspaces: in packages/react-app/src/contracts and in packages/bots/contracts

This could be useful if you want to test on completely new contracts.

2.2. Sync abis, bytecode and addresses of already deployed on mainnet contracts.

# in another terminal window
cd fuji
yarn sync

This command:

  • will sync abis, bytecode and addresses of contracts already deployed on mainnet to packages/react-app/src/contracts and to packages/bots/contracts

Doing this way, you'll have the contracts with all the historical data and events, till the moment of the fork (from step 1).

3. Front-end

3.1. Create .env in packages/react-app and set the following variables:

REACT_APP_INFURA_ID=<YOUR-KEY>
REACT_APP_CHAIN_ID=31337

3.2. Configure new network on your metamask:

3.3. Send some local ETH to your metamask address so that you can make transactions

cd fuji
yarn send --from 0 --to YOUR_ADDRESS --amount 10

3.4. Run a development server

# in another terminal window
cd fuji
yarn start

ATTENTION! Please, keep in mind that if you have already done some transactions on your local fork and you restart it, you will have to reset your Metamask account (to reset the nonce and the current block number).

4. Run service bots

check packages/bots/README.md for more details

About


Languages

Language:JavaScript 55.1%Language:Solidity 44.5%Language:CSS 0.3%Language:HTML 0.1%Language:Procfile 0.0%Language:Shell 0.0%