Global liquidity tracking hub for decentralized finance on AO
Aggregate AMM data, subscribe to real-time market feeds, and power autonomous trading agents
Features β’ Architecture β’ Data Feeds β’ Getting Started β’ License
β οΈ ARCHIVED PROJECTThis project is archived and no longer maintained. It is provided as-is for educational and reference purposes. No support, updates, or bug fixes will be provided.
|
OHLCV candlestick data with configurable intervals. Track volume, price history, and trading activity across all registered AMMs. |
Price discovery across token pairs via intelligent routing. Find optimal swap paths through multiple liquidity pools. |
|
Subscribe to real-time feeds across all AMMs. Power autonomous agents that react to sophisticated market signals and execute strategies. |
TVL tracking, locked liquidity metrics, historical volume analysis, and LP PnL calculations for every pool. |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AMM POOLS β
β Swaps β’ Liquidity Events β’ Fee Changes β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β Raw market data
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DEXI CORE β
β β’ Aggregates & processes β’ Manages subscriptions β
β β’ Stores in SQLite β’ Computes analytics β
β β’ Multi-hop routing β’ Tracks locked liquidity β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
β Processed feeds
βββββββββββββββββΌββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β MICRODEXI β β SUBSCRIBERS β β INDEXERS β
β ββββββββββ β β ββββββββββ β β ββββββββββ β
β Per-AMM β β β’ Agents β β β’ dApps β
β child procs β β β’ Bots β β β’ Analytics β
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
- AMM Registration β Pool creators register their AMMs with Dexi via payment
- Dexi Subscribes β Dexi subscribes to registered AMMs for swap & liquidity events
- Data Aggregation β Swaps, reserves, and fee changes are ingested into SQLite
- Feed Distribution β Subscribers receive real-time updates on their topics of interest
| Topic | Description | Parameters |
|---|---|---|
| Swap Notifications | Real-time swap events for agent triggers | AMM-Process-Id |
| Reserve Changes | Liquidity additions/removals | AMM-Process-Id |
| Locked Liquidity | LP token lock/unlock events | AMM-Process-Id |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Get-Candles β OHLCV data for any interval (1m β 1d) β
β Get-Overview β All AMMs with 24h stats β
β Get-Stats β Volume, traders, price changes β
β Get-Global-Liquidity β Cross-AMM liquidity metrics β
β Get-Price-For-Token β Multi-hop price discovery β
β Get-Oracle-Price β USD price from RedStone oracle β
β Get-Locked-Share β Locked liquidity percentage β
β Get-Pool-Pnl-History β LP profit/loss over time β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
AMM Pools External Sources
β β
βββββββββββββββββΌββββββββββββββββ β
βΌ βΌ βΌ βΌ
βββββββββ βββββββββ βββββββββ ββββββββββββ
β Swaps β β Liq. β β Fees β β RedStone β
β β β Eventsβ βChangesβ β Oracle β
βββββ¬ββββ βββββ¬ββββ βββββ¬ββββ ββββββ¬ββββββ
β β β β
βββββββββββββββββ΄ββββββββ¬ββββββββ΄ββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββ
β INGEST LAYER β
β Validate & Normalize β
βββββββββββββ¬ββββββββββββββ
βΌ
βββββββββββββββββββββββββββ
β SQLite Database β
β βββββββββββββββββββ β
β β’ amm_transactions β
β β’ amm_registry β
β β’ token_registry β
β β’ swap_params_changes β
βββββββββββββ¬ββββββββββββββ
βΌ
βββββββββββββββββββββββββββ
β DISPATCH TO β
β SUBSCRIBERS β
βββββββββββββββββββββββββββ
ao.send({
Target = DEXI,
Action = "Get-Candles",
AMM = "<pool-process-id>",
Days = "7",
Interval = "1h"
})ao.send({
Target = DEXI,
Action = "Get-Overview",
["Order-By"] = "volume" -- volume | transactions | date
})ao.send({
Target = DEXI,
Action = "Subscribe-Swaps",
["AMM-Process-Id"] = "<pool-process-id>"
})ao.send({
Target = PAYMENT_TOKEN,
Action = "Transfer",
Recipient = DEXI,
Quantity = "5",
["X-Action"] = "Register-AMM",
["X-AMM-Process"] = "<amm-process-id>"
})dexi/
βββ π dexi-core/ # Core aggregator logic
β βββ candles.lua # OHLCV calculations
β βββ stats.lua # Trading statistics
β βββ overview.lua # Market overview
β βββ liquidity.lua # TVL & liquidity tracking
β βββ lookups.lua # Price lookups
βββ π subscriptions/ # Subscription management
βββ π ingest/ # Data ingestion handlers
βββ π factory/ # Microdexi spawning
βββ π microdexi/ # Per-AMM child processes
βββ π global-liquidity/ # Cross-AMM liquidity
βββ π amm-analytics/ # Pool analytics & PnL
βββ π integrate-amm/ # AMM registration flow
βββ π integrate-auction/ # Dutch auction tracking
βββ π hopper/ # Multi-hop price routing
βββ π liquidity-router/ # Swap route optimization
βββ π oracle/ # RedStone price feeds
βββ π db/ # SQLite schema & utils
βββ π ops/ # Operations & config
βββ π utils/ # Shared utilities
βββ π test/ # Unit tests
βββ process.lua # Main entry point
- Lua 5.4+
- Node.js 18+
- amalg.lua (Lua bundler)
- aoform (AO deployment tool)
# Clone the repository
git clone https://github.com/Autonomous-Finance/dexi.git
cd dexi
# Install Node dependencies
npm install
# Build the project
npm run build
# Deploy to AO
npx aoform applyThe build process produces:
build/output.luaβ Bundled Dexi process code ready for deployment
Dexi uses process tags and global variables for configuration:
| Variable | Description |
|---|---|
PAYMENT_TOKEN_PROCESS |
Token process for subscription payments |
OPERATOR |
Authorized operator address |
TOKEN_LOCKER_PROCESS |
Token lock tracking process |
REDSTONE_PROXY_PROCESS |
Oracle price feed proxy |
DISPATCH_ACTIVE |
Enable/disable feed dispatch |
PAYMENT_PRICES = {
["Update-Token-Metadata"] = 1, -- USD
["Subscribe-Pool"] = 5 -- USD
}| Technology | Purpose |
|---|---|
| Lua | Core process logic |
| AO | Decentralized compute on Arweave |
| SQLite | Embedded database for aggregation |
| aoform | Deployment management |
| amalg | Lua module bundling |
This software is provided "as is" without warranty of any kind. Use at your own risk. The authors are not responsible for any financial losses incurred through the use of this software.
This is experimental DeFi infrastructure. Always:
- Test integrations thoroughly before production use
- Understand the data latency characteristics
- Review the code before relying on it for trading decisions
This project is licensed under the MIT License - see the LICENSE.md file for details.