Aggregator Bot (Node.js)
This covers the multi-user aggregator-based bot code found typically in index.js
(or bot/index.js
). It's responsible for:
- Connecting to InsideX to fetch pools & OHLC data
- Using Aftermath Finance aggregator for route creation
- Executing time-based or indicator-based buys & sells
- Consolidating gas + tokens on Sui
Key Features
- Indicators: RSI, Stochastic RSI, or ML signals
- DCA Logic: Merge repeated buys into a weighted cost basis
- Sui Gas & Token Consolidation
- InsideX pool lookups & aggregator routes via Aftermath
- Multi-user with saved JSON state
Architecture Overview
- Positions stored in-memory & in
bot_state.json
. - Nginx or Node-based server sees API requests, which call bot logic.
- InsideX fetch for newly created tokens & OHLC.
- Aftermath aggregator for best route & swap execution.