fix: CRITICAL - Revert to Helius RPC (Alchemy breaks Drift SDK)
ISSUE CONFIRMED: - Alchemy RPC does NOT support WebSocket subscriptions (accountSubscribe method) - Drift SDK REQUIRES WebSocket support to function properly - When using Alchemy: * SDK initializes with 100+ accountSubscribe errors * Claims 'initialized successfully' but is actually broken * First API call (openPosition) sometimes works * Subsequent calls hang indefinitely OR * Positions open without TP/SL orders (NO RISK MANAGEMENT) * Position Manager doesn't track positions SOLUTION: - Use Helius as primary RPC (supports all Solana methods + WebSocket) - Helius free tier: 10 req/sec sustained, 100 burst - Rate limits manageable with retry logic (5s exponential backoff) - System fully operational with Helius ALCHEMY INCOMPATIBILITY: - Alchemy Growth (10,000 CU/s) excellent for raw transaction throughput - But completely incompatible with Drift SDK architecture - Cannot be used as primary RPC for Drift Protocol trading User confirmed: 'after changing back the settings it started to act up again' This is Common Pitfall #1 - NEVER use RPC without WebSocket support
This commit is contained in:
11
.env
11
.env
@@ -31,13 +31,12 @@ API_SECRET_KEY=2a344f0149442c857fb56c038c0c7d1b113883b830bec792c76f1e0efa15d6bb
|
|||||||
|
|
||||||
# Solana RPC URL (Required for blockchain access)
|
# Solana RPC URL (Required for blockchain access)
|
||||||
#
|
#
|
||||||
# PRIMARY: Alchemy Growth (10,000 CU/s, best for transactions)
|
# PRIMARY: Helius (supports all Solana RPC methods including WebSocket subscriptions)
|
||||||
# Used for: Transaction submission and confirmation
|
# Drift SDK REQUIRES WebSocket support for accountSubscribe - Alchemy doesn't support this
|
||||||
SOLANA_RPC_URL=https://solana-mainnet.g.alchemy.com/v2/5A0iA5UYpsmP9gkuezYeg
|
SOLANA_RPC_URL=https://mainnet.helius-rpc.com/?api-key=5e236449-f936-4af7-ae38-f15e2f1a3757
|
||||||
|
|
||||||
# FALLBACK: Helius (for WebSocket subscriptions if needed)
|
# Note: Alchemy doesn't support WebSocket subscriptions, causes Drift SDK to malfunction
|
||||||
# Used for: Account subscriptions (Drift SDK initialization)
|
# SOLANA_FALLBACK_RPC_URL=https://solana-mainnet.g.alchemy.com/v2/5A0iA5UYpsmP9gkuezYeg
|
||||||
SOLANA_FALLBACK_RPC_URL=https://mainnet.helius-rpc.com/?api-key=5e236449-f936-4af7-ae38-f15e2f1a3757
|
|
||||||
|
|
||||||
# Alternative RPC providers (reference):
|
# Alternative RPC providers (reference):
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user