Feature/singleton dex flash accounting#225
Open
maurievm wants to merge 3 commits intobnb-chain:mainfrom
Open
Conversation
- Add Singleton DEX project in typescript folder - Include README with project description - Set up package.json with basic metadata - Add .gitignore for build artifacts
…s, a frontend application, and a bot.
indragunawan98
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BNBSwap - Smart DeFi Hub 🚀
Singleton DEX on BNB Chain with Flash Accounting and Native Limit Orders
BNBSwap combines Uniswap V2's simplicity with Uniswap V4's efficiency, adding unique features that make it the most gas-efficient and user-friendly DEX on BNB Chain.
🌟 Key Features
⚡ Flash Accounting
Save 33-44% gas on multi-hop swaps
Unlike traditional DEXes that transfer tokens on every hop, BNBSwap uses internal balance tracking (similar to Uniswap V4). Tokens only move at the end of the transaction, drastically reducing gas costs.
Example: A 3-hop swap (BNB → USDT → BTCB) uses ~56% less gas than traditional routing.
📊 Native Limit Orders
CEX-style limit orders on BNB Chain
Set "buy at X price" orders directly on-chain. Orders are automatically executed by keeper bots when the AMM price crosses your target.
🏗️ Singleton Architecture
One contract to rule them all
All liquidity pools share a single contract, enabling:
💰 Standard AMM
📦 Project Structure
🚀 Quick Start
1. Contracts
Deployment:
.env.exampleto.envand addPRIVATE_KEYandBNB_TESTNET_RPC.forge script script/Deploy.s.sol --rpc-url $BNB_TESTNET_RPC --broadcast2. Frontend
3. Order Execution Bot
🧪 Test Results
37/37 tests passing ✅
We maintain strict 100% test coverage for critical paths:
Run tests with trace:
forge test -vv🔗 Deployed Addresses (BNB Testnet)
0xBdae0CF292881D00520263f35E4450E72a8187830x323...0x948...🎯 Why BNBSwap?
📚 Documentation
🔧 Tech Stack
📄 License
MIT
Built for BNB Chain Hackathon