The zen-bot project aims to implement a zero-allocation, high-frequency Multi-Asset Triangular Arbitrage engine on the Polygon PoS network. The system will utilize a flat memory model, advanced pathfinding algorithms, and exact analytical size optimization. It will also feature a full-stack real-time dashboard, ensuring zero runtime garbage collection interference and strict typing integrity.
The zen-bot system will operate on the Polygon network, interfacing with multiple DEXes such as Uniswap v2 clones, including SushiSwap and QuickSwap. It will focus on constructing a directed graph of available liquidity pools, implementing pathfinding algorithms to detect arbitrage opportunities, and optimizing trade sizes for maximum profitability. The system will be designed to handle extreme throughput conditions and ensure efficient execution with minimal latency.
bigint for all internal reserve calculations.The zen-bot's landing page will feature an interactive 3D network graph visualization using @react-three/fiber and @react-three/drei. Users can rotate and zoom into the graph to explore different liquidity pools and arbitrage paths. Each node represents a token, and edges represent pools, dynamically updating in real-time to reflect current market conditions. Hovering over a node or edge will display detailed metrics such as liquidity, price impact, and potential ROI. This immersive experience will make the complex data accessible and engaging.
The landing page will utilize a "parallax" interaction model, with layered depth via scroll. The 3D network graph will translate at different speeds, creating a sense of depth and immersion. Real content will stay in normal flow and scroll naturally, providing a visually rich first impression. Internal pages will adopt a "static" model for clarity and speed, focusing on data-heavy content.

zen-bot builds a directed graph of every liquidity pool above $10k, prunes dead ends with Tarjan's SCC, runs Bellman-Ford and Floyd-Warshall to surface profitable triangular arbitrage, then solves the exact optimal trade size with calculus — no over-sizing into price impact.
The same flow a Quantitative DeFi Developer follows — graph, filter, detect, optimize — wired into fast, static, data-heavy internal tools.
A modular TypeScript module maps tokens to nodes and liquidity pools to directed edges, with edge weights encoding effective exchange cost.
Open GraphBuilder →Every pool below the $10,000 USD threshold is pruned, then Tarjan's SCC isolates only subgraphs that can route back to WMATIC, WETH, WBTC, USDC and USDT.
Open GraphBuilder →Bellman-Ford (sparse-optimized with early termination) returns the negative cycle path; Floyd-Warshall runs all-pairs as a benchmark comparison.
Open Algorithms →A calculus-based optimizer solves for the exact maximum-profit input in the origin token, then the execution filter checks gross profit against live maxFeePerGas before firing.
Open Optimizer →Detect profitable cycles with a sparse-optimized Bellman-Ford, then validate against a Floyd-Warshall all-pairs benchmark — with trading fees priced into every edge and phantom-liquidity pools discarded before either engine runs.
Every hop's constant-product pool is compounded into one virtual pool, then the optimizer differentiates the composite profit function and solves for the exact input in the origin token where marginal profit hits zero — no loops, no binary search, no over-sizing into price impact.
Construct the pool graph, run the algorithms side by side, and let the optimizer size every trade to the exact profit peak — streamed live over WebSocket to one dashboard.
No comments yet. Be the first!