everything you need to build on Balancer! ๐
๐งช Quickly experiment with custom AMMs using a frontend that allows you to interact with your custom pool contract(s).
๐งช Fork mainnet ethereum and test your custom pools within the context of all available liquidity.
๐ Build and test your Smart Order Router (SOR) extension, getting you one step closer to being integrated into the Balancer ecosystem.
This project is a fork of scaffold-eth-typescript with a focus on providing tools to enable fast development of custom AMMs built on balancer. Write your contract, deploy it locally, and immediately have an interface to start to interact with the pool (swap/join/exit) both in isolation and in the context of all available balancer vault liquidity.
- Pool Contracts UI - This helper UI allows you to interact directly with any (custom or existing) pool contract in real time.
- Smart order router (SOR) playground - See how your custom pool stacks up against available balancer liquidity via the SOR playground.
- Batch Swap - A UI for building arbitrarily complex batch swaps.
Prerequisites: Node (v16) plus Yarn (v1.x) and Git
1๏ธโฃ clone/fork ๐ scaffold-balancer:
git clone https://github.com/balancer/scaffold-balancer.git
2๏ธโฃ Install all necessary dependencies
yarn install
3๏ธโฃ Create scaffold config
yarn create-config
4๏ธโฃ Create Mnemonics for contract deployments
yarn generate && yarn account
5๏ธโฃ start your ๐ทโ Hardhat fork of mainnet ethereum:
yarn fork
6๏ธโฃ in a second terminal window, ๐ฐ deploy your contract:
yarn fork
sometimes causes gas price issues. So, deployments are disabled and should be done separately.
yarn deploy
7๏ธโฃ generate frontend files for deployed contracts:
yarn contracts:build
8๏ธโฃ in a third terminal window, start your ๐ฑ frontend:
yarn dev
๐ Edit your smart contract YourCustomPool.sol
in packages/solidity-ts/contracts
๐ผ Edit your contract deployment scripts in packages/solidity-ts/deploy
๐ Edit your frontend in packages/nextjs-app-ts/src
๐ป Open http://localhost:3000 to see the app