Skip to content

MEV-Protocol/MevEthRouter

Repository files navigation

mevETH Router Foundry

Optimal route for mevETH Deposit / Swap / Withdraw

Pools

  • Curve
  • Balancer
  • Uniswap V3 0.30%
  • Uniswap V3 1.00%
  • Uniswap V3 0.05%
  • Sushiswap
  • Uniswap V2

MevEth routes:

  • deposit / mint
  • withdraw / redeem

Uniswap V3 virtual reserves calculation

Developer Setup

Copy .env-example to .env and fill in ETH_RPC_URL.

source .env

Build

forge build

Fuzz tests

Fuzz test all methods on MevEthRouter produce better results than Deposit / Redeem.

forge test -vvv

Slither audit

poetry install

poetry run slither .

Test deploy

Ethereum mainnet:

forge script script/Deploy.s.sol:DeployScript --rpc-url $ETH_RPC_URL

Deploy and verify on etherscan

Fill in PRIVATE_KEY and ETHERSCAN_KEY in .env.

./script/deploy-eth.sh

V1 ✓

  • Optimal depsoit / withdraw / swap route for ETH <> mevETH
  • Split swaps between Sushiswap, Uniswap V2 and Uniswap V3, Balancer, Curve, MevEth funcs
  • Testing
  • Deployment scripts
  • Redeem route with queue toggle and slippage tolerance
  • Slither self audit workflow
  • Documentation of derived math and code
  • Gas optimization
    • Abstract route finder for off-chain call
    • Balancer and Curve math instead of calls for amountsOut
    • Optimize storage
    • Optimize route finding
    • Remove unused code

V2

  • Include yETH
  • Include multi hop routes eg frxETH <> mevETH <> ETH
  • Backruns
  • Include stakerBPT / CPT routes and backruns

About

Optimal stake and redeem routes for mevETH

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages