From 3f98e2c5ebff13b86f4b4654b55d8f0361697c2d Mon Sep 17 00:00:00 2001 From: Crypto Gnome <33667144+CryptoGnome@users.noreply.github.com> Date: Sun, 12 Oct 2025 17:50:57 -0400 Subject: [PATCH 01/41] chore: remove unused imports and fix JSX character escaping - Remove unused imports (getTrancheManager, TrendingUp, TrendingDown) from multiple components - Fix apostrophe character escaping in JSX text (won't -> won't) - Prefix intentionally unused destructured variables with underscore to follow linting conventions (_vwapLookback, _thresholdTimeWindow, _thresholdCooldown) These changes improve code quality by eliminating dead code and properly handling unused variables according to ESLint best practices. --- src/app/tranches/page.tsx | 2 +- src/bot/index.ts | 2 +- src/components/PerformanceCardInline.tsx | 2 +- src/components/SessionPerformanceCard.tsx | 2 +- src/components/SymbolConfigForm.tsx | 6 +++--- src/components/TrancheBreakdownCard.tsx | 3 ++- src/components/TrancheSettingsSection.tsx | 3 +-- src/components/TrancheTimeline.tsx | 2 +- src/lib/bot/hunter.ts | 2 +- src/lib/services/trancheManager.ts | 4 +--- 10 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/app/tranches/page.tsx b/src/app/tranches/page.tsx index eee5ce1..7ff7d2d 100644 --- a/src/app/tranches/page.tsx +++ b/src/app/tranches/page.tsx @@ -145,7 +145,7 @@ export default function TranchesPage() {
If a tranche goes >5% underwater (configurable), it gets automatically isolated. This means new trades - won't add to this position - you can continue trading while waiting for recovery. + won't add to this position - you can continue trading while waiting for recovery.
diff --git a/src/bot/index.ts b/src/bot/index.ts index c71cb7d..065597b 100644 --- a/src/bot/index.ts +++ b/src/bot/index.ts @@ -394,7 +394,7 @@ logErrorWithTimestamp('â ī¸ Position Manager failed to start:', error.message if (trancheEnabledSymbols.length > 0) { try { - const { initializeTrancheManager, getTrancheManager } = await import('../lib/services/trancheManager'); + const { initializeTrancheManager } = await import('../lib/services/trancheManager'); const trancheManager = initializeTrancheManager(this.config); await trancheManager.initialize(); diff --git a/src/components/PerformanceCardInline.tsx b/src/components/PerformanceCardInline.tsx index 24aacaf..9574ded 100644 --- a/src/components/PerformanceCardInline.tsx +++ b/src/components/PerformanceCardInline.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react'; import { Badge } from '@/components/ui/badge'; import { Skeleton } from '@/components/ui/skeleton'; -import { Clock, TrendingUp, TrendingDown } from 'lucide-react'; +import { Clock } from 'lucide-react'; import websocketService from '@/lib/services/websocketService'; import dataStore from '@/lib/services/dataStore'; diff --git a/src/components/SessionPerformanceCard.tsx b/src/components/SessionPerformanceCard.tsx index 694eb6b..cb6cd77 100644 --- a/src/components/SessionPerformanceCard.tsx +++ b/src/components/SessionPerformanceCard.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react'; import { Badge } from '@/components/ui/badge'; import { Skeleton } from '@/components/ui/skeleton'; -import { TrendingUp, TrendingDown, Activity } from 'lucide-react'; +import { Activity } from 'lucide-react'; import websocketService from '@/lib/services/websocketService'; interface SessionPnL { diff --git a/src/components/SymbolConfigForm.tsx b/src/components/SymbolConfigForm.tsx index 9728d2a..1a355de 100644 --- a/src/components/SymbolConfigForm.tsx +++ b/src/components/SymbolConfigForm.tsx @@ -1248,7 +1248,7 @@ export default function SymbolConfigForm({ onSave, currentConfig }: SymbolConfig const value = parseInt(e.target.value); if (e.target.value === '' || isNaN(value)) { // Remove the field if empty - will use default from config.default.json - const { vwapLookback, ...rest } = config.symbols[selectedSymbol]; + const { vwapLookback: _vwapLookback, ...rest } = config.symbols[selectedSymbol]; setConfig({ ...config, symbols: { @@ -1318,7 +1318,7 @@ export default function SymbolConfigForm({ onSave, currentConfig }: SymbolConfig const seconds = parseFloat(e.target.value); if (e.target.value === '' || isNaN(seconds)) { // Remove the field if empty - will use default from config.default.json - const { thresholdTimeWindow, ...rest } = config.symbols[selectedSymbol]; + const { thresholdTimeWindow: _thresholdTimeWindow, ...rest } = config.symbols[selectedSymbol]; setConfig({ ...config, symbols: { @@ -1349,7 +1349,7 @@ export default function SymbolConfigForm({ onSave, currentConfig }: SymbolConfig const seconds = parseFloat(e.target.value); if (e.target.value === '' || isNaN(seconds)) { // Remove the field if empty - will use default from config.default.json - const { thresholdCooldown, ...rest } = config.symbols[selectedSymbol]; + const { thresholdCooldown: _thresholdCooldown, ...rest } = config.symbols[selectedSymbol]; setConfig({ ...config, symbols: { diff --git a/src/components/TrancheBreakdownCard.tsx b/src/components/TrancheBreakdownCard.tsx index e190e65..00b0918 100644 --- a/src/components/TrancheBreakdownCard.tsx +++ b/src/components/TrancheBreakdownCard.tsx @@ -4,7 +4,7 @@ import { useState, useEffect } from 'react'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Separator } from '@/components/ui/separator'; -import { TrendingUp, TrendingDown, AlertTriangle, Clock, DollarSign } from 'lucide-react'; +import { TrendingUp, AlertTriangle, Clock, DollarSign } from 'lucide-react'; import { Tranche } from '@/lib/types'; interface TrancheBreakdownCardProps { @@ -35,6 +35,7 @@ export function TrancheBreakdownCard({ symbol, side }: TrancheBreakdownCardProps // Refresh every 5 seconds const interval = setInterval(fetchTranches, 5000); return () => clearInterval(interval); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [symbol, side]); const fetchTranches = async () => { diff --git a/src/components/TrancheSettingsSection.tsx b/src/components/TrancheSettingsSection.tsx index 8e6e094..2056542 100644 --- a/src/components/TrancheSettingsSection.tsx +++ b/src/components/TrancheSettingsSection.tsx @@ -4,7 +4,6 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com import { Label } from '@/components/ui/label'; import { Input } from '@/components/ui/input'; import { Switch } from '@/components/ui/switch'; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import { Separator } from '@/components/ui/separator'; import { Info } from 'lucide-react'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; @@ -60,7 +59,7 @@ export function TrancheSettingsSection({ symbol, config, onChange }: TrancheSettTranches with unrealized loss exceeding this percentage will be isolated. - New trades won't add to isolated tranches. + New trades won't add to isolated tranches.
+ More data means better chart analysis but uses more disk space. + Set to 0 to keep all liquidation data permanently. +
+Select a symbol to view chart
+Loading chart data...
+{error}
+ +% loss to isolate tranche
+- Track multiple position entries for better margin utilization -
-+ Place LIMIT orders to trim position size at breakeven or profit levels +
++ Automatically trim position when price returns near entry +
++ 0 = exact breakeven, 1 = 1% profit, -1 = 1% loss from entry +
++ Default: 0% (exact breakeven) +
++ % of position to close (1-100%) +
++ Set multiple profit/loss levels for position trimming +
+po_ prefix.
+ They won't interfere with your main TP/SL orders. These are complementary safety measures that
+ execute before your main exit targets.
+
+ {JSON.stringify(log.data, null, 2)}
+
+