
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!