Skip to content

limitbreakinc/lbamm-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Limit Break AMM Examples

Example projects demonstrating the Limit Break AMM on a local Anvil devnet.

Prerequisites

  • Foundry (forge, cast, anvil)
  • screen (pre-installed on macOS)
  • Python 3.9+ with pipenv (for simulator and indexer)
  • Node.js 18+ (for frontends)

Quick Start

1. Deploy contracts to local Anvil

cd environment/lbamm-deploy
./script/start.sh

This will:

  • Start an Anvil instance on localhost:8545 (chain-id 1776411) in a background screen session
  • Compile and deploy all AMM contracts via forge script
  • Write deployed contract addresses to the root .env file
  • Create .env.local symlinks in each frontend project

To view Anvil logs: screen -r anvil

To stop Anvil:

cd environment/lbamm-deploy
bash script/stop.sh

2. Configuration

The deploy script auto-generates a root .env with all deployed addresses and default settings. See .env.example for the full list of configuration options.

All example projects read from this single root .env -- no per-project env files needed.

Examples

Deploys an ERC20C token configured for LBAMM-exclusive trading with a 10% paired token tax. Demonstrates Transfer Validator V5 setup (whitelist-only, OTC disabled), hook-based fee configuration, and single-sided liquidity seeding on a dynamic price pool.

Deploys an ERC20C token with a custom LBAMM token hook that requires traders, pool creators, and liquidity providers to hold an NFT from a specific ERC-721 collection. Demonstrates how to implement ILimitBreakAMMTokenHook for access control without using the standard hook.

A full-stack order book built utilizing LBAMM with the CLOB Transfer Handler. A Python simulator deploys test tokens, initializes the CLOB, and runs automated trading with multiple accounts. A Python indexer polls on-chain events and serves order book state via a REST API. A Next.js frontend displays the order book in real time and submits transactions to the local chain.

Project Structure

.env.example                          # Configuration template
.env                                  # Auto-generated by deploy (gitignored)
common/contracts/abis/                # Shared contract ABIs
environment/lbamm-deploy/             # Forge deploy scripts
  script/start.sh                     # Start Anvil + deploy
  script/stop.sh                      # Stop Anvil
examples/
  clob/                               # CLOB example
  nft-gated-trading/                  # Custom token hook with NFT gate
  trading-tax-token/                  # ERC20C token with trading tax

About

Local environment with examples for the Limit Break AMM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors