Documentation Index
Fetch the complete documentation index at: https://docs.geode.ag/llms.txt
Use this file to discover all available pages before exploring further.
What is a Settler?
A settler is an off-chain service that collects signed trade intents from users, batches them by pool, and callsgeodeSettleBatch() on the GeodeHook contract. In return, the settler earns settlement fees and gas reimbursement from the protocol.
Settlement is permissionless — anyone can run a settler. The first valid batch submitted for a given settlement window wins the fees. This creates competitive dynamics that ensure intents are settled promptly.
Architecture
- Syncs with the Indexer to auto-discover all launched token pools
- Receives signed Permit2 intents from the frontend or any client
- Validates intent fields (addresses, amounts, deadlines)
- Queues intents as buys or sells per pool
- Settles by calling
geodeSettleBatch()on-chain every settlement cycle - Earns settlement fees + gas reimbursement
Quick Start
Configure environment
.env and set:SETTLER_PRIVATE_KEY— your settler wallet’s private keyHOOK_ADDRESS— the deployed GeodeHook contract addressRPC_URL— your Ethereum JSON-RPC endpoint
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
SETTLER_PRIVATE_KEY | ✅ | — | Private key for the settler wallet. Must have ETH for gas. |
HOOK_ADDRESS | ⚠️ | — | Deployed GeodeHook address. Without this, auto-settlement is disabled. |
RPC_URL | No | http://localhost:8545 | JSON-RPC endpoint |
SETTLE_INTERVAL_MS | No | 2000 | How often to check for pending intents (ms) |
PORT | No | 3003 | HTTP API port |
INDEXER_URL | No | https://indexer.geode.ag | Indexer API for auto pool discovery |
INDEXER_SYNC_INTERVAL_MS | No | 30000 | How often to re-sync pools from the indexer (ms) |
Automatic Pool Discovery
The settler automatically discovers all launched tokens by syncing with the Geode Indexer:- On startup — fetches all tokens from
INDEXER_URL/tokensand registers their pools - Every 30 seconds — re-syncs to discover newly launched tokens
- No manual registration needed — any coin launched via the Launchpad is automatically available for settlement
The settler reconstructs pool keys from token data (sorting WETH and the token address to determine
currency0/currency1). If you’re running your own indexer, set INDEXER_URL to point to it.API Reference
Submit Intent
The
poolKey is required on the first intent for a new pool — the settler uses it to auto-register the pool. Subsequent intents for the same poolId can omit it.View Pending Intents
Force Settlement
Register Pool
List Pools
Health Check
Statistics
Economics
Settlers earn revenue from two sources:Settlement Fees
0.1% of each filled intent’s input amount. Deducted before routing — the settler takes the unrouted fee deposit directly from the PoolManager. For a batch with 10 ETH total buy volume, the settler earns ~0.01 ETH in fees.
Gas Reimbursement
Gas cost × 1.5, capped at 0.01 ETH per batch. Drawn from the pool’s accumulated direct-swap fee surplus. This ensures settlers are made whole on gas even for small batches.
Settler Profitability
A settler is profitable when:Wash Trade Resistance
Settlement fees are deducted from both sides of every trade. A wash trader pays 0.1% on the buy side AND 0.1% on the sell side, making wash trading strictly net-negative. The settler cannot inflate their revenue through self-trading.Permit2 Integration
The settler’spermit2.js module provides utilities for working with Geode’s Permit2 integration:
PermitWitnessTransferFrom:
Running Multiple Settlers
Multiple settlers can operate on the same network simultaneously:- Each settler maintains its own intent queue independently
- The first settler to submit a valid batch for a given block window earns the fees
- Settlers compete on latency and intent coverage — omitting valid intents leaves fees for competitors
- The protocol enforces one settlement per batch interval per pool
For integrators: You can build custom settlers with different strategies — e.g., settling only high-value batches, or running a private intent relay for specific pools. The
geodeSettleBatch() function is permissionless and accepts any valid set of signed intents.Source Code
The settler is open-source under the MIT license:- GitHub: geodeag/geode-settler
- Dependencies:
express,ethers v6,cors - Runtime: Node.js ≥ 18