docs: Add technical note about Alchemy RPC for future investigation

Research findings:
- Alchemy Growth DOES support WebSocket subscriptions (up to 2,000 connections)
- All standard Solana RPC methods supported
- No documented Drift-Alchemy incompatibilities
- Rate limits enforced via CUPS (Compute Units Per Second)

Hypothesis for our failures:
- accountSubscribe 'errors' might be 429 rate limits, not 'method not found'
- Drift SDK may not handle Alchemy's rate limit pattern during init
- First trade works (subscriptions established) → subsequent fail (bad state)

Pragmatic decision:
- Helius works reliably NOW for production trading
- Theoretical investigation can wait until needed
- Future optimization possible with WebSocket-specific retry logic

This note preserves the research for future reference without changing
the current production recommendation (Helius only).
This commit is contained in:
mindesbunister
2025-11-14 21:11:28 +01:00
parent 47d0969e51
commit c1464834d2

View File

@@ -1023,6 +1023,19 @@ ORDER BY MIN(adx) DESC;
- **Critical:** NEVER use RPC provider without WebSocket subscription support for Drift Protocol trading - **Critical:** NEVER use RPC provider without WebSocket subscription support for Drift Protocol trading
- **This is definitive:** Helius only, no alternatives work reliably - **This is definitive:** Helius only, no alternatives work reliably
- **TECHNICAL NOTE (for future investigation):**
* Alchemy Growth plan (10,000 CU/s) DOES support WebSocket subscriptions according to official docs
* Supports up to 2,000 concurrent WebSocket connections
* All standard Solana RPC methods supported (getProgramAccounts, getMultipleAccounts, sendTransaction, etc.)
* No known Drift-Alchemy incompatibilities documented by Drift Labs
* Research source: Alchemy Solana docs + Drift Protocol documentation
* **Hypothesis:** accountSubscribe errors might be rate limit 429s (CUPS enforcement), not "method not found"
* **Potential issue:** Drift SDK may not handle Alchemy's rate limit pattern during initialization
* **Why it matters:** First trade works (subscriptions established) → subsequent trades fail (SDK in bad state from rate limit errors)
* **Pragmatic decision:** Helius works reliably NOW, theoretical investigation can wait
* **Future optimization:** Could implement WebSocket-specific retry logic, subscription batching, init delays
* **For now:** Helius free tier + 5s exponential backoff = production-ready solution
2. **Prisma not generated in Docker:** Must run `npx prisma generate` in Dockerfile BEFORE `npm run build` 2. **Prisma not generated in Docker:** Must run `npx prisma generate` in Dockerfile BEFORE `npm run build`
3. **Wrong DATABASE_URL:** Container runtime needs `trading-bot-postgres`, Prisma CLI from host needs `localhost:5432` 3. **Wrong DATABASE_URL:** Container runtime needs `trading-bot-postgres`, Prisma CLI from host needs `localhost:5432`