
DeFi Bots Series — Building an multi-strategy bot on Solana (Intro: Goals & Plan)
I’m reviving defi_server — an infra I maintained in my previous work with the Singapore startup behind taigo.ai. The old stack runs on Taigo MCP services and already knows how to talk to Solana. The goal now is to bolt on a new
bot/module and ship an autonomous scheduler that can put capital to work.
What I'm building
A multi-strategy bot that schedules and allocates across a few Solana venues using the existing defi_server plumbing:
- Meteora pools (DLMM) — Phase 1 focus
- Memecoins (Jupiter & pump.fun)
- xStocks (Solflare stocks)
- Perps (Vooi or a similar venue) — later, for risk hedging
Everything will initially live under bot/ and talk to the rest of the services (RPC, logging, state, alerting) that are already in the repo.
Phase 1: Meteora LP copy-trade
A simple first strategy: mirror a leader I follow on LP Agent.
- Leader portfolio:
https://app.lpagent.io/portfolio?address=7KHx2Uc5qsqz652eXbu8Qtabi5KLxWJLgxFzcaBzP32i - Bot behavior (v0):
- Scan the leader’s recent transactions.
- Detect a new DLMM position init.
- Open the same pool on my side if it passes my guardrails (for now: assume yes).
- Important: I will not mirror their ongoing management. I’ll add my own rebalance, take-profit, and stop-loss logic. All trades/positions get recorded to Supabase, where I compute PnL.
Why copy first?
He’s had some profitable months. I’ll borrow his pool selection as a shortcut while I stand up the execution + risk framework. Once I’m tracking my own outcomes, I can layer on discovery signals and wean off copy inputs.
Series roadmap
- (This post) Goals & plan; what “success” looks like.
- Scanner: from raw tx history → “position intent” events (pool + position PDA).
- Scheduler: cron-like loop, stateless vs. stateful triggers, backoff, idempotency.
- LP executor: parse pool params, size the order, submit add-liquidity, record state.
- Risk & lifecycle: TP/SL, rebalances, health checks, alerts.
- PnL & reporting: Supabase schema, nightly marks, weekly digest.
Success criteria for Phase 1
- ✅ Bot detects the leader’s new DLMM position inits within my scan window.
- ✅ Bot opens the same pool with my own sizing.
- ✅ Every trade & state transition is stored in Supabase and can be replayed.
- ✅ I can publish transparent PnL as this series progresses.
Up next: the scanner — a lean pass over recent txs that identifies (pool, position PDA) without diving into complex bin-array reads. That’s Part 2.
Stay Updated
Get notified when I publish new articles about Web3 development, hackathon experiences, and cryptography insights.
You might also like

DeFi Bots Series — Part 3: Telegram Bot Lite, Portfolio RPC, and a Lean Path to the Scheduler
I stripped our Telegram surface down to a fast, durable “Lite” mode: no Kafka, no AI agent in the middle—just clean wallet UX, on-chain balances via RPC, token prices from Jupiter, PnL wired to Supabase, and buttons that actually do something. This sets the table for the trading scheduler.

DeFi Bots Series — Part 2: Orchestrator, LP-Copy Warm-Up & Safe Monitor (Dry-Run)
We wire a minimal orchestrator with a primed LP-copy scanner and a policy-driven monitor that runs in dry-run, notifies via Telegram, reads positions from Supabase, and calls execution logic via imports (no gRPC).

DeFi Bots Series — Part 7: The Monitor Test Saga (One-Sided Bids, Skew Rebalances, and Real PnL)
I stress-tested a one-sided, USDC-anchored LP strategy overnight: ~15 rebalances, lots of fee accrual, a few bugs, and a clearer picture of what to fix next. We tightened pool orientation, made SOL/WSOL funding sane, added skew gates (TVL/fees), and wrote proper lineage + flows. The monitor is quieter—until it needs not to be.