Implement pure Drift Protocol automation system

- Remove Jupiter DEX completely from automation system
- Implement exclusive Drift Protocol integration with up to 100x leverage
- Update executeLiveTrade method to use only Drift API endpoints
- Change default DEX provider from Jupiter to Drift
- Create minimal professional UI without promotional banners
- Add comprehensive leverage options (1x-100x) with risk indicators
- Update automation service to route all trades through /api/automation/trade
- Fix type definitions to support Drift-only configuration
- Add multiple trading pairs support (SOL, BTC, ETH, APT, AVAX, DOGE)
- Implement clean configuration interface with essential controls
- Remove excessive marketing text and promotional elements
- Maintain full automation functionality while simplifying UX
This commit is contained in:
mindesbunister
2025-07-22 16:05:29 +02:00
parent fb194f1b12
commit 4f553dcfb6
34 changed files with 7133 additions and 2221 deletions

View File

@@ -1,91 +0,0 @@
const { PrismaClient } = require('@prisma/client')
const prisma = new PrismaClient()
async function checkTradeCounts() {
try {
console.log('🔍 Checking trade counts in database...')
// Total trades
const totalTrades = await prisma.trade.count({
where: {
userId: 'default-user',
symbol: 'SOLUSD'
}
})
// Completed trades
const completedTrades = await prisma.trade.count({
where: {
userId: 'default-user',
symbol: 'SOLUSD',
status: 'COMPLETED'
}
})
// Open/Active trades
const activeTrades = await prisma.trade.count({
where: {
userId: 'default-user',
symbol: 'SOLUSD',
status: 'OPEN'
}
})
// Pending trades
const pendingTrades = await prisma.trade.count({
where: {
userId: 'default-user',
symbol: 'SOLUSD',
status: 'PENDING'
}
})
console.log('\n📊 TRADE COUNTS:')
console.log(`Total Trades: ${totalTrades}`)
console.log(`Completed Trades: ${completedTrades}`)
console.log(`Active Trades: ${activeTrades}`)
console.log(`Pending Trades: ${pendingTrades}`)
// Get all trades with details
const allTrades = await prisma.trade.findMany({
where: {
userId: 'default-user',
symbol: 'SOLUSD'
},
orderBy: { createdAt: 'desc' },
select: {
id: true,
side: true,
amount: true,
price: true,
status: true,
createdAt: true,
leverage: true,
profit: true
}
})
console.log('\n📋 ALL TRADES:')
allTrades.forEach((trade, index) => {
console.log(`${index + 1}. ${trade.side} ${trade.amount} tokens @ $${trade.price} - ${trade.status} (${new Date(trade.createdAt).toLocaleString()})`)
})
// Check automation sessions
const sessions = await prisma.automationSession.count({
where: {
userId: 'default-user',
symbol: 'SOLUSD'
}
})
console.log(`\n🤖 Automation Sessions: ${sessions}`)
} catch (error) {
console.error('Error checking trade counts:', error)
} finally {
await prisma.$disconnect()
}
}
checkTradeCounts()