Trade Pipeline
Complete Flow
┌─────────────────────────────────────────────────────────────────┐
│ 1. DETECTION — like-poller.js │
│ Syncs every 30s, polls each user's X likes │
│ Extracts contract addresses (EVM 0x... or Solana base58) │
│ Detects chain from address format │
└──────────────────────────┬──────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ 2. QUEUING — trade-queue.js │
│ Priority queue (max 3 concurrent) │
│ Deduplication by userId + contract address │
│ Priority: MANUAL > AUTO_SELL > LIKE │
└──────────────────────────┬──────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ 3. VALIDATION — trade-orchestrator.js │
│ ├─ Check daily trade limit (5/day free, unlimited premium) │
│ ├─ Token safety check (risk score, honeypot, liquidity) │
│ ├─ Min buy amount validation ($2 USD) │
│ ├─ Wallet balance check │
│ └─ Slippage override enforcement │
└──────────────────────────┬──────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ 4. QUOTE — quote-service.js + aggregators/ │
│ Race multiple aggregators → return best price │
│ Solana: Jupiter │
│ Base: 0x vs Odos vs KyberSwap (parallel race) │
│ 15-second quote cache │
└──────────────────────────┬──────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ 5. EXECUTION │
│ Solana: Jupiter API → sign with Privy wallet → confirm │
│ Base: Best aggregator → ethers tx → confirm │
│ USDC mode: 0x Gasless (gas-sponsored, no ETH needed) │
│ Platform fee deducted from input amount before swap │
└──────────────────────────┬──────────────────────────────────────┘
▼
┌─────────────────────────────────────────────────────────────────┐
│ 6. POST-TRADE │
│ ├─ Save trade record (CONFIRMED/FAILED) │
│ ├─ Transfer platform fee to treasury │
│ ├─ WebSocket: real-time notification to user │
│ ├─ Telegram: alert (premium + enabled) │
│ ├─ X: auto-post trade card (3-min cooldown) │
│ └─ Low balance check → alert if below threshold │
└─────────────────────────────────────────────────────────────────┘Step 1: Detection
Step 2: Queuing
Step 3: Validation
Check
Rule
On Failure
Step 4: Quote
Step 5: Execution
Step 6: Post-Trade
Stuck Trade Resolution
Trade Statuses
Status
Meaning
Last updated
Was this helpful?