Loading video player...
In this tutorial, we’ll build a runnable Uniswap V2-style AMM (constant product market maker) from scratch in HoloBit — and watch price and K evolve in real time. By the end, you’ll have a clean, forkable DEX + Trader model you can reuse for your own DeFi experiments. What you’ll build (and learn along the way) ✅ Constant product pricing (x*y=k) + fee-aware swap math ✅ DEX as a service Agent, Traders as requester Agents (quote → execute) ✅ Containers as wallets + liquidity pools (asset flows you can audit) ✅ Observability: Price + K charts to validate behavior ✅ Scale from single-pair → multi-pair (Population + Find) + exact-output swaps Background (quick reference) 1. Uniswap V2 overview: https://docs.uniswap.org/contracts/v2/concepts/protocol-overview/how-uniswap-works 2. AMM basics (Uniswap blog): https://blog.uniswap.org/what-is-an-automated-market-maker 3. Uniswap v2 whitepaper (PDF): https://docs.uniswap.org/whitepaper.pdf 4. Uniswap v2 core contracts (GitHub): https://github.com/Uniswap/v2-core 5. DeFi (Wikipedia): https://en.wikipedia.org/wiki/Decentralized_finance Chapters 0:00 Intro — build a live Uniswap v2 AMM sim 0:14 AMM core — constant product rule (x*y=k) 0:51 Modeling mindset — protocol (DEX) vs users (traders) 1:45 Build DEX skeleton — vars, pool container, processes 3:27 Add observables — K & Price + auto-charting 4:29 Build Trader skeleton — wallet + swap behavior 6:08 Configure DEX — pairName / liqPool / feeRate / initial Price & K 8:36 Implement getAmountOut — ports + compute logic 11:49 Implement swapIn — quote → transfers → bookkeeping → update Price/K 19:07 Configure Trader goSwapIn — timer trades + wire wallet into container port 21:39 Test & verify — asset conservation + fee impact on K 23:10 Make the curve bend — bigger trades & more traders 25:30 Multi-pair scaling — Population + per-pair config 29:36 Tag Sets — token registry for consistent modeling 31:40 Exact-output swaps — getAmountIn + swapOut + Find the correct pair 36:38 Free model release + what’s next (Part 2: Liquidity Providers) Watch the full HoloBit Tutorials Playlist: https://www.youtube.com/playlist?list=PLE8KkqZeu9DidKW-hqpEFsECotABdnIrN ➡️ Tutorial 2: https://youtu.be/wTRx-eunIpM ➡️ Tutorial 1: https://youtu.be/Htu4O1cRGQc Visit HoloBit and start building: https://holobit.xyz Disclaimer: This video is for educational purposes only and does not constitute financial or investment advice. #AMM #Tokenomics #UniswapV2 #DEX #DeFi #Simulation #ABM #NoCode #VisualModeling #SystemsThinking