diff --git a/src/Managing.Web3Proxy/src/plugins/custom/gmx.ts b/src/Managing.Web3Proxy/src/plugins/custom/gmx.ts index ac199eb6..4a7474d5 100644 --- a/src/Managing.Web3Proxy/src/plugins/custom/gmx.ts +++ b/src/Managing.Web3Proxy/src/plugins/custom/gmx.ts @@ -1168,12 +1168,21 @@ function getMarketInfoFromTicker(ticker: string, marketsInfoData: MarketsInfoDat export function getTokenDataFromTicker(ticker: string, tokensData: TokensData): TokenData { console.log(`🔍 Looking up token for ticker: ${ticker}`); - const token = getTokenBySymbol(arbitrum.id, ticker, { version: "v2", isSynthetic: false }); + // Try to find the token without synthetic filter to support both synthetic and non-synthetic tokens + // First try v2 tokens (preferred) + let token; + try { + token = getTokenBySymbol(arbitrum.id, ticker, { version: "v2" }); + } catch (error) { + // If not found in v2, try without version constraint + token = getTokenBySymbol(arbitrum.id, ticker); + } console.log(`📋 Token found:`, { symbol: token.symbol, address: token.address, decimals: token.decimals, - isNative: token.isNative + isNative: token.isNative, + isSynthetic: token.isSynthetic }); const tokenData = getByKey(tokensData, token.address); console.log(`📊 Token data:`, { diff --git a/src/Managing.WebApp/src/pages/botsPage/botList.tsx b/src/Managing.WebApp/src/pages/botsPage/botList.tsx index 436ca60f..0a05f847 100644 --- a/src/Managing.WebApp/src/pages/botsPage/botList.tsx +++ b/src/Managing.WebApp/src/pages/botsPage/botList.tsx @@ -23,6 +23,7 @@ import { BotSortableColumn, BotStatus, MoneyManagement, + SortDirection, StartCopyTradingRequest, TradingBotConfig, TradingBotResponse @@ -72,8 +73,10 @@ const BotList: React.FC = ({ list }) => { const [pageSize, setPageSize] = useState(20) const [statusFilter, setStatusFilter] = useState(undefined) const [agentFilter, setAgentFilter] = useState(undefined) + const [minBalance, setMinBalance] = useState(undefined) + const [maxBalance, setMaxBalance] = useState(undefined) const [sortBy, setSortBy] = useState(BotSortableColumn.Roi) - const [sortDirection, setSortDirection] = useState<'Asc' | 'Desc'>('Desc') + const [sortDirection, setSortDirection] = useState(SortDirection.Desc) // Use the user data for bot ownership checking const checkIsBotOwner = (botAgentName: string) => { @@ -82,8 +85,8 @@ const BotList: React.FC = ({ list }) => { // Fetch paginated bot data const { data: paginatedBots, isLoading } = useQuery({ - queryFn: () => client.bot_GetBotsPaginated(pageNumber, pageSize, statusFilter, undefined, undefined, agentFilter, sortBy, sortDirection), - queryKey: ['bots', pageNumber, pageSize, statusFilter, agentFilter, sortBy, sortDirection], + queryFn: () => client.bot_GetBotsPaginated(pageNumber, pageSize, statusFilter, undefined, undefined, agentFilter, minBalance ?? null, maxBalance ?? null, sortBy, sortDirection), + queryKey: ['bots', pageNumber, pageSize, statusFilter, agentFilter, minBalance, maxBalance, sortBy, sortDirection], }) const [showMoneyManagementModal, setShowMoneyManagementModal] = @@ -355,6 +358,11 @@ const BotList: React.FC = ({ list }) => { accessor: 'profitAndLoss', Cell: ({ value }: any) => value?.toFixed(2) || '0.00', }, + { + Header: 'Trading Balance $', + accessor: 'botTradingBalance', + Cell: ({ value }: any) => value?.toFixed(2) || '0.00', + }, { Header: 'Actions', accessor: 'actions', @@ -410,6 +418,36 @@ const BotList: React.FC = ({ list }) => { /> +
+ + setMinBalance(e.target.value ? Number(e.target.value) : undefined)} + min="0" + step="0.01" + /> +
+ +
+ + setMaxBalance(e.target.value ? Number(e.target.value) : undefined)} + min="0" + step="0.01" + /> +
+