Skip to content

The gateway for all Harvest strategies to execute swaps with multiple Dexes on mainnet.

Notifications You must be signed in to change notification settings

harvestfi/harvest-universal-liquidator-mainnet

Repository files navigation

Harvest Universal Liquidator Mainnet

This is the gateway for all Harvest strategies to execute swaps with multiple Dexes.

Get Started

  1. Fill in the environment variables.

    cp .env.example .env
  2. Set up dependencies.

    yarn

Prerequisites

Test locally

forge test -vvv

Deploy

While deploying locally, set up the local node with anvil. Make sure that the address from the private key has enough gas to deploy or use one of the ten addresses with the MNEMONIC set up with anvil.

source .env
anvil -m $MNEMONIC
or
anvil -m $MNEMONIC --fork-url <RPC_URL>

Create a corresponding network section inside deployed-addresses.json.

  "<template-for-new-network>": {
    "UniversalLiquidator": "",
    "UniversalLiquidatorRegistry": "",
    "UniV3Dex": "",
    "BalancerDex": "",
    "SushiswapDex": "",
    "CurveDex": "",
    "BancorV2Dex": "",
    "<new-address-item-to-store>": ""
  },

Deploy contracts with corresponding scripts.

./script/_scripts.sh script/<SCRIPTS.s.sol>

There are 5 scripts to deploy:

  • script/SystemBase.s.sol
  • script/Dex.s.sol
  • script/Path.s.sol
  • script/Pool.s.sol
  • script/Fee.s.sol

Executing each script will require a few configurations:

Determine the Network.

Which network do you want to deploy to?
Options: local, eth-mainnet, eth-sepolia, arb-mainnet, arb-goerli, polygon-mainnet, polygon-mumbai

Determine whether or not to broadcast, if the network is not local.

Broadcast? [y/n]...

Determine whether or not to verify, if the network is not local.

Verify contract? [y/n]...

Determine the profile to use.

Profile? [default/optimized]...

(With Dex.s.sol) Determine which Dex to deploy.

Which dex do you want to deploy? (Ex: UniV3Dex, the contract name)

(With Dex.s.sol) Determine the name for the Dex.

Which name do you want to represent the dex? (Ex: uniV3)

(With Path.s.sol, Pool.s.sol, or Fee.s.sol) Determine the config parameters file for setting up. There are three example files for reference: Paths.0000.json, Pools.0000.json, and Fees.0000.json.

Setup with which file? (Ex: Paths.0000.json)

About

The gateway for all Harvest strategies to execute swaps with multiple Dexes on mainnet.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published