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.