SOLANA GRAVEYARD HACKATHON

Parrot TWAP

A time-weighted average price bot for Solana — revived from the dead. Execute recurring DCA orders on any token pair, powered by Jupiter.

The Revival

From Dead Protocol to Universal DCA Tool

Parrot Protocol built a TWAP bot for Solana DCA trading. It was tightly coupled to Raydium AMM v4 and Serum DEX — both now defunct.

Serum was sunset after the FTX collapse in 2022. The bot became completely non-functional. Dead code, dead protocol, dead infrastructure.

We replaced every dead dependency with Jupiter v1 API — the dominant Solana DEX aggregator. The bot now supports any token pair with optimal routing across all DEXes.

Timeline

2021
Parrot Protocol launches TWAP bot (Raydium + Serum)
Nov 2022
FTX collapses. Serum DEX is sunset. Bot breaks.
2023–2025
Bot sits dead on GitHub. Raydium v4 deprecated.
Feb 2026
Revived with Jupiter v1 API. Any token. Any DEX. Alive.

Live Demo

Jupiter Quote Simulator

Real quotes from the Jupiter API. This is the same engine powering the TWAP bot.

parrot-twap / jupiter v1 Mainnet
equivalent CLI command
go run cmd/cli.go --pair SOL:USDC --amount 0.1 --interval 5m --side buy

What Changed

Dead Infrastructure → Modern Stack

Jupiter v1 Integration

Replaced dead Raydium/Serum backend with Jupiter — optimal routing across every Solana DEX.

🌐

Any Token Pair

Not limited to PRT anymore. Trade SOL, USDC, BONK, JUP, WIF, or any mint address.

📚

Symbol Resolution

Built-in token symbol lookup. Use "SOL:USDC" instead of raw 44-character mint addresses.

Configurable Slippage

Set slippage tolerance in basis points. Default 2% (200 bps), adjustable per strategy.

🛠

Original Architecture

Preserved the scheduler, balance tracking, stop conditions, and auto-transfer system.

🚀

Production Ready

Go binary, Docker support, cross-compile to Linux. Same deployment story as original.

Why This Exists

Self-Custodied DCA on Solana

Dollar-cost averaging beats timing the market. Instead of buying $500 of SOL at one price, buy $8 every hour for 3 days. You get the average price, not the worst one. This bot automates that — on your own wallet, no exchange, no custody risk.

$0.008
Fee per swap
~95K lamports, fixed regardless of size
0.1%
Overhead at 0.1 SOL/swap
Fee becomes noise above ~$8/swap
0%
Platform fee
No middleman. Just you, Jupiter, and Solana.
30+
DEXes via Jupiter
Best price, every swap, automatically
Fee overhead by swap size
0.01 SOL (~$0.85) ~1%
0.1 SOL (~$8.50) ~0.1%
1 SOL (~$85) ~0.01%
10 SOL (~$850) ~0.001%

Proof

Live Mainnet Swap

Sent
0.01 SOL
Received
0.849 USDC
Fee
$0.008
Slot
400,858,601
View on Solscan →

Usage

Drop-in CLI for DCA strategies

DCA into USDC every 5 minutes
go run cmd/cli.go --pair SOL:USDC --amount 0.1 --interval 5m --side buy
sell BONK for SOL every hour
go run cmd/cli.go --pair BONK:SOL --amount 1000000 --interval 1h --side sell --fromDecimals 5
DCA with stop condition + auto-transfer
go run cmd/cli.go --pair SOL:JUP --amount 0.05 --interval 30m \
  --stopAmount 1000 --transferThreshold 500 --transferAddress YOUR_WALLET

Architecture

Clean Go module structure

cmd/cli.go
CLI entry point, arg parsing, cron scheduler
swap/swap.go
Core TWAP logic: balances, stops, transfers
swap/jupiter.go
Jupiter v1 API: quote + swap execution
config/jupiter.go
Token symbol resolution, pair parsing
swap/rpc.go
Solana RPC helpers, tx building
store/json.go
Swap log persistence