An open-source, multi-tenant concentrated liquidity market maker for EVM chains. Deploys and manages Uniswap V3 / Aerodrome LP positions on behalf of one or more clients, with per-client Gnosis Safe custody and a web dashboard for operations.
Active development
This is a working system that has been end to end tested on Base Sepolia testnet, but it has not been formally audited, has not been battle tested at scale, and should not be used with funds you are not prepared to lose. The author provides this software AS-IS with no warranty. See LICENSE.
- Provisions WETH/USDC (and other pair) liquidity positions on Uniswap V3-style DEXes
- Monitors positions and rebalances when price drifts out of range
- Collects accumulated LP fees on rebalance
- Runs a 7-layer risk management system (NAV limits, drawdown, gas budget, IL, price divergence, balance reconciliation, staleness)
- Supports multiple concurrent clients with isolated per-client Safes, positions, and fee accounting
- Exposes a REST API and a companion Next.js dashboard for operations
- Multi-tenant by design: per-client Gnosis Safe custody, per-client API keys, per-client tick loop, zero cross-contamination
- Chain-agnostic: ChainConfig abstraction, adapter registry keyed by (chainId, venueId), supports Base, Arbitrum, Optimism out of the box
- Deterministic math: optimal-split calculations use pure bigint throughout (no float conversions), porting Uniswap's TickMath.sol logic
- Strategy pattern: pluggable strategies (Passive, ConcentratedLP, MultiVenueLP) with a clean IStrategy interface
- Persistence: SQLite via better-sqlite3, currently at SCHEMA_VERSION 15
TypeScript, viem, better-sqlite3, Express, pino, tsup, biome, vitest, pnpm.
Dashboard: base-market-maker-dashboard — Next.js + Tailwind + wagmi.
- Node 20+
- pnpm
- A Base Sepolia RPC URL
- A funded EOA (bot wallet) on Base Sepolia
pnpm install
cp .env.example .env.testnet
# Edit .env.testnet with your RPC URL and bot private key
pnpm buildpnpm key:create --admin --label=initial-adminSave the printed key. It won't be shown again.
# Safe custody (default — deploys a Gnosis Safe):
pnpm onboard --name="Acme Corp" --plan=starter --chain=84532
# Operator custody (bot EOA as approved operator — no Safe):
pnpm onboard --name="Acme Corp" --plan=starter --chain=84532 \
--custody=operator --client-wallet=0x...bash scripts/run-testnet.sh- REST API on
http://localhost:3847 - Dashboard on a separate port (see dashboard repo)
- Admin:
mm_admin_<32hex> - Client:
mm_<clientId>_<32hex>
# Create admin key
pnpm key:create --admin --label="admin"
# Create client-scoped key
pnpm key:create --client=<clientId> --label="description"
# Revoke a key
pnpm key:revoke --hash=<key_hash>pnpm test # unit + non-fork integration (~620 tests)
MM_INTEGRATION=true pnpm test tests/integration/ # integration tests (requires testnet setup)
pnpm test:fork # forked-chain tests (requires anvil)This is an early-stage public build. Issues and PRs welcome but response time is not guaranteed. Before opening a large PR, please open an issue to discuss the direction.
MIT — see LICENSE file. You can use this code for any purpose including commercial. You assume all risk.
This software executes real transactions on real blockchains with real funds if run on mainnet. Even on testnet, bugs can destroy positions, miscalculate balances, or cause unintended behavior. Specifically:
- Not audited. No formal security review has been performed on the smart contract integrations, the fee calculations, the custody logic, or the bigint math. Bugs may cause fund loss.
- Not production-grade. This is active development code. Breaking changes happen. Schema migrations run automatically. Behavior may change between versions without notice.
- Market making has inherent risks. Impermanent loss, price divergence, MEV, flash loan attacks, oracle manipulation — all apply. Positions can lose value even when the code works perfectly.
- Operational risks. Running a bot 24/7 with private keys requires operational security that this README does not cover. If your server is compromised, your keys are compromised.
- Legal risks. Market making, LP operations, and automated trading may be regulated in your jurisdiction. Consult a lawyer if you plan to run this with real capital.
By running this software you accept all of the above risks. The author is not liable for any losses, regulatory issues, or other consequences arising from use of this software.
- GitHub: @kingl0w