https://github.com/balancer/scaffold-balancer
https://github.com/balancer/scaffold-balancer
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/balancer/scaffold-balancer
- Owner: balancer
- License: mit
- Created: 2023-03-10T14:21:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-01T03:04:35.000Z (about 3 years ago)
- Last Synced: 2025-03-28T02:38:53.147Z (about 1 year ago)
- Language: TypeScript
- Size: 15.2 MB
- Stars: 5
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π Scaffold-Balancer
> 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.
## Features
This project is a fork of [scaffold-eth-typescript](https://github.com/scaffold-eth/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.
# πββοΈ Quick Start
Prerequisites: [Node (v16)](https://nodejs.org/en/download/) plus [Yarn (v1.x)](https://classic.yarnpkg.com/en/docs/install/) and [Git](https://git-scm.com/downloads)
> 1οΈβ£ clone/fork π scaffold-balancer:
```bash
git clone https://github.com/balancer/scaffold-balancer.git
```
> 2οΈβ£ Install all necessary dependencies
```bash
yarn install
```
> 3οΈβ£ Create scaffold config
```bash
yarn create-config
```
> 4οΈβ£ Create Mnemonics for contract deployments
```bash
yarn generate && yarn account
```
> 5οΈβ£ start your π·β Hardhat fork of mainnet ethereum:
```bash
yarn fork
```
> 6οΈβ£ in a second terminal window, π° deploy your contract:
β οΈIncluding deploys on `yarn fork` sometimes causes gas price issues. So, deployments are disabled and should be done separately.
```bash
yarn deploy
```
> 7οΈβ£ generate frontend files for deployed contracts:
```bash
yarn contracts:build
```
> 8οΈβ£ in a third terminal window, start your π± frontend:
```bash
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