Files
trading_bot_v4/package.json
mindesbunister c37a9a37d3 fix: Implement Associated Token Account for USDC withdrawals
- Fixed PublicKey undefined error (derive from DRIFT_WALLET_PRIVATE_KEY)
- Implemented ATA resolution using @solana/spl-token
- Added comprehensive debug logging for withdrawal flow
- Fixed AccountOwnedByWrongProgram error (need ATA not wallet address)
- Successfully tested .58 withdrawal with on-chain confirmation
- Updated .env with TOTAL_WITHDRAWN and LAST_WITHDRAWAL_TIME tracking

Key changes:
- lib/drift/withdraw.ts: Added getAssociatedTokenAddress() for USDC ATA
- tsconfig.json: Excluded archive folders from compilation
- package.json: Added bn.js as direct dependency

Transaction: 4drNfMR1xBosGCQtfJ2a4r6oEawUByrT6L7Thyqu6QQWz555hX3QshFuJqiLZreL7KrheSgTdCEqMcXP26fi54JF
Wallet: 3dG7wayp7b9NBMo92D2qL2sy1curSC4TTmskFpaGDrtA
USDC ATA: 8ZEMwErnwxPNNNHJigUcMfrkBG14LCREDdKbqKm49YY7
2025-11-19 20:35:32 +01:00

40 lines
990 B
JSON

{
"name": "trading-bot-v4",
"version": "4.0.0",
"description": "Autonomous Trading Bot v4 with Drift Protocol and Pyth Network integration",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@drift-labs/sdk": "^2.75.0",
"@prisma/client": "^6.18.0",
"@pythnetwork/hermes-client": "^1.0.0",
"@pythnetwork/price-service-client": "^1.3.0",
"@solana/web3.js": "^1.91.1",
"autoprefixer": "^10.4.21",
"bn.js": "^5.2.2",
"bs58": "^5.0.0",
"next": "^15.0.0",
"postcss": "^8.5.6",
"prisma": "^6.18.0",
"react": "^18.3.0",
"react-dom": "^18.3.0",
"tailwindcss": "^3.4.1"
},
"devDependencies": {
"@types/bn.js": "^5.2.0",
"@types/node": "^20.11.0",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"ts-node": "^10.9.2",
"typescript": "^5.3.0"
},
"engines": {
"node": ">=20.0.0"
}
}