Delta-Neutral LP Bot
Volatility-based LP positioning on Orca Whirlpools with Fisher Transform-derived range pricing, process-isolated Drift hedging via child-process IPC, and PostgreSQL analytics for session-based P&L tracking.
The Delta-Neutral LP Bot provides concentrated liquidity on Orca Whirlpools using Fisher Transform-derived volatility analysis to set ranges that adapt to actual market conditions. Unlike the Lazy Rebalancer, which uses Meteora DLMM with market regime detection, this bot focuses on statistical range optimization through volatility cones and continuous delta hedging via Drift Protocol. I wrote a detailed blog post on the Fisher Transform approach covering the full math, from realized volatility computation through cone construction to tick mapping.
The core insight is that raw price data is not normally distributed. Fat tails and skewed returns mean that standard deviation-based range calculations systematically underestimate the probability of large moves. The Fisher Transform normalizes this distribution, making confidence interval calculations valid. In practice, the Fisher-adjusted cone captures 93-96% of realized moves, versus 87-89% for a raw standard deviation approach.
Volatility-Based Positioning
The range calculation pipeline starts by computing rolling realized volatility from 1-minute OHLCV data, then applies the Fisher Transform to normalize the distribution. From the normalized data, a volatility cone is constructed at a 95% confidence interval, and the cone boundaries are mapped to Whirlpool tick ranges with adaptive buffers. Entry timing uses Rate of Change analysis -- when price ROC is low (consolidation) and volatility ROC is stable, the bot opens a position. When momentum is high, it waits.
Process-Isolated Hedging
The hedge component runs as a separate child process communicating with the main bot via IPC messages. This was not the original design -- I started with everything in one process and discovered that the Drift SDK's global state management conflicted with the Orca SDK in subtle ways. The isolation provides crash independence: if the Drift worker crashes due to an RPC issue, the LP positions continue operating normally. The main process detects the crash, restarts the worker, and reconstructs hedge state from on-chain data.
Session Analytics
Every LP position lifecycle constitutes a "session" in the PostgreSQL database, tracked from open to close with all intermediate events. Each session records entry conditions (volatility, price ROC, Fisher values), position parameters (tick range, liquidity amount), accrued fees, hedge performance, and net result. This enables answering questions with data rather than assumptions: do positions opened during low ROC conditions perform better? (Yes, roughly 30% more net yield.) The database runs on Supabase, which provides hosted PostgreSQL with zero operational overhead.