feat: Add automated profit withdrawal system
- UI page: /withdrawals with stats dashboard and config form - Settings API: GET/POST for .env configuration - Stats API: Real-time profit and withdrawal calculations - Execute API: Safe withdrawal with Drift SDK integration - Drift service: withdrawFromDrift() with USDC spot market (index 0) - Safety checks: Min withdrawal amount, min account balance, profit-only - Telegram notifications: Withdrawal alerts with Solscan links - Dashboard navigation: Added Withdrawals card (3-card grid) User goal: 10% of profits automatically withdrawn on schedule Current: Manual trigger ready, scheduled automation pending Files: 5 new (withdrawals page, 3 APIs, Drift service), 2 modified
This commit is contained in:
29
app/page.tsx
29
app/page.tsx
@@ -43,7 +43,7 @@ export default function HomePage() {
|
||||
</div>
|
||||
|
||||
{/* Navigation Cards */}
|
||||
<div className="grid md:grid-cols-2 gap-8 max-w-4xl mx-auto">
|
||||
<div className="grid md:grid-cols-3 gap-8 max-w-6xl mx-auto">
|
||||
{/* Analytics Card */}
|
||||
<a
|
||||
href="/analytics"
|
||||
@@ -71,6 +71,33 @@ export default function HomePage() {
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{/* Withdrawals Card */}
|
||||
<a
|
||||
href="/withdrawals"
|
||||
className="group relative bg-gradient-to-br from-emerald-900/50 to-teal-900/50 backdrop-blur-sm rounded-2xl p-8 border border-emerald-500/20 hover:border-emerald-500/40 transition-all duration-300 hover:scale-105"
|
||||
>
|
||||
<div className="absolute inset-0 bg-gradient-to-br from-emerald-500/10 to-teal-500/10 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity"></div>
|
||||
|
||||
<div className="relative">
|
||||
<div className="w-16 h-16 bg-gradient-to-br from-emerald-500 to-teal-600 rounded-xl flex items-center justify-center mb-6 group-hover:scale-110 transition-transform">
|
||||
<span className="text-4xl">💸</span>
|
||||
</div>
|
||||
|
||||
<h3 className="text-2xl font-bold text-white mb-3">Withdrawals</h3>
|
||||
|
||||
<p className="text-gray-300 mb-6">
|
||||
Configure automatic profit withdrawals to your wallet
|
||||
</p>
|
||||
|
||||
<div className="flex items-center text-emerald-400 group-hover:text-emerald-300">
|
||||
<span className="font-medium">Manage Withdrawals</span>
|
||||
<svg className="w-5 h-5 ml-2 group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
{/* Settings Card */}
|
||||
<a
|
||||
href="/settings"
|
||||
|
||||
Reference in New Issue
Block a user