Appearance
Keeper
The keeper is a Python service that automates the delta-neutral strategy.
What It Does
- Monitors funding rates on Extended DEX
- Opens positions when funding is attractive (buy wBTC + short perp)
- Collects funding payments hourly
- Rebalances delta when drift exceeds threshold
- Harvests profits by calling
report()on vault - Manages liquidity to ensure withdrawals work
- Closes positions when funding turns negative
Strategy State Machine
IDLE ──► ACTIVE ◄──► REBALANCING
▲ │
│ ▼
└──── CLOSING| State | Action |
|---|---|
| IDLE | Wait for positive funding above threshold |
| ACTIVE | Collect funding, harvest profits, check delta |
| REBALANCING | Adjust position to restore delta = 0 |
| CLOSING | Unwind position when funding negative |
Configuration
| Parameter | Default | Description |
|---|---|---|
STRATEGY_INTERVAL_SECONDS | 60 | Cycle frequency |
MIN_FUNDING_RATE_BPS | 5 | Min funding to open (0.05%) |
REBALANCE_THRESHOLD_BPS | 500 | Delta drift trigger (5%) |
HARVEST_INTERVAL_CYCLES | 60 | Profit report frequency |
MAX_LEVERAGE | 1 | No leverage |
Integrations
Extended DEX
- REST API for orders and positions
- SNIP-12 signed orders
- Hourly funding collection
AVNU
- Get optimal swap routes
- Execute multi-hop swaps
- Slippage protection
Starknet
- starknet-py for contract calls
- V3 transactions
- Custom gas limits for swaps
