Skip to main content
GET
/
dashboard
/
{wallet_address}
curl -X GET "https://api.strike.markets/dashboard/0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46"
{
  "withdrawable": 750.25,
  "active": [
    {
      "id": 12345,
      "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
      "symbol": "BTC-USD",
      "szi": "0.006667",
      "margin": "300.0",
      "entry_price": "45000.00",
      "liquidation_price": "41234.15",
      "status": "open",
      "created_at": "2024-01-15T14:30:00Z",
      "leverage": 10.0,
      "position_value": "3000.0",
      "unrealized_pnl": "100.00",
      "return_on_equity": "33.33"
    }
  ],
  "pending_payout": [
    {
      "id": 12346,
      "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
      "symbol": "ETH-USD",
      "szi": "-0.4",
      "margin": "200.0",
      "entry_price": "2500.00",
      "exit_price": "2450.00",
      "realized_pnl": "20.00",
      "status": "closed",
      "created_at": "2024-01-16T10:15:00Z",
      "closed_at": "2024-01-16T15:30:00Z",
      "queue_position_usd": 1250.75
    }
  ],
  "history": [
    {
      "id": 12340,
      "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
      "symbol": "BTC-USD",
      "szi": "0.018182",
      "margin": "100.0",
      "entry_price": "44000.00",
      "exit_price": "45500.00",
      "realized_pnl": "127.85",
      "total_fee": "8.75",
      "status": "settled",
      "created_at": "2024-01-10T09:00:00Z",
      "closed_at": "2024-01-12T15:30:00Z",
      "settled_at": "2024-01-12T15:35:00Z"
    }
  ],
  "points": 1250
}
curl -X GET "https://api.strike.markets/dashboard/0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46"
{
  "withdrawable": 750.25,
  "active": [
    {
      "id": 12345,
      "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
      "symbol": "BTC-USD",
      "szi": "0.006667",
      "margin": "300.0",
      "entry_price": "45000.00",
      "liquidation_price": "41234.15",
      "status": "open",
      "created_at": "2024-01-15T14:30:00Z",
      "leverage": 10.0,
      "position_value": "3000.0",
      "unrealized_pnl": "100.00",
      "return_on_equity": "33.33"
    }
  ],
  "pending_payout": [
    {
      "id": 12346,
      "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
      "symbol": "ETH-USD",
      "szi": "-0.4",
      "margin": "200.0",
      "entry_price": "2500.00",
      "exit_price": "2450.00",
      "realized_pnl": "20.00",
      "status": "closed",
      "created_at": "2024-01-16T10:15:00Z",
      "closed_at": "2024-01-16T15:30:00Z",
      "queue_position_usd": 1250.75
    }
  ],
  "history": [
    {
      "id": 12340,
      "wallet_address": "0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46",
      "symbol": "BTC-USD",
      "szi": "0.018182",
      "margin": "100.0",
      "entry_price": "44000.00",
      "exit_price": "45500.00",
      "realized_pnl": "127.85",
      "total_fee": "8.75",
      "status": "settled",
      "created_at": "2024-01-10T09:00:00Z",
      "closed_at": "2024-01-12T15:30:00Z",
      "settled_at": "2024-01-12T15:35:00Z"
    }
  ],
  "points": 1250
}

Overview

Get comprehensive dashboard data for a wallet address, combining account information, position data, performance analytics, and points balance in a single response. This endpoint provides everything needed to build a complete user dashboard.
This endpoint does NOT require authentication and provides a consolidated view of all account-related data.

Path Parameters

wallet_address
string
required
Ethereum wallet address to retrieve dashboard data for.Format: 42-character hex string starting with “0x”
Example: “0x742d35cc6C6C7532B1140Da4C8A2f6C8ECfC9B46”

Response Fields

withdrawable
number
Amount available for immediate withdrawal (in USD)
active
array
Array of currently open positions with real-time calculations
pending_payout
array
Array of closed positions waiting in payout queue
history
array
Array of fully settled positions (completed or liquidated)
points
integer
Current reward points balance for the wallet address

Dashboard Metrics

Trading Performance

Total Volume

Total Volume = Sum of all position sizes (entry value)
Cumulative USD value of all positions opened, regardless of outcome.

Total PnL

Total PnL = Sum of all realized profits and losses
Net profit/loss from all closed and settled positions. Does not include unrealized PnL from open positions.

Win Rate

Win Rate = (Profitable Trades / Total Closed Trades) × 100
Percentage of trades that resulted in a profit. Only includes completely closed positions.

Account Health

Margin Utilization

Margin Utilization = (Reserved Balance / Total Balance) × 100
Percentage of account balance used as margin for open positions.

Available Capital

Available Capital = Withdrawable Balance
Funds available for new positions or withdrawal.

Use Cases

Comprehensive Account Overview

  • Single API call: Get all account data at once
  • Dashboard building: Perfect for user dashboard interfaces
  • Performance tracking: Monitor trading performance over time
  • Risk management: Assess overall account health

Portfolio Management

  • Position monitoring: Track all open positions and their performance
  • Balance management: Monitor available vs. reserved funds
  • Historical performance: Review past trading results
  • Points tracking: Monitor loyalty program status

Analytics and Reporting

  • Performance metrics: Calculate key trading statistics
  • Risk assessment: Evaluate account risk exposure
  • Progress tracking: Monitor improvement over time
  • Goal setting: Set targets based on current performance

Error Responses

400 Bad Request
object
Invalid wallet address format
{
  "error": 400,
  "message": "Invalid wallet address format"
}
404 Not Found
object
Wallet address not found in system (no activity)
{
  "error": 404,
  "message": "Account not found"
}

Usage Examples

Basic Dashboard Data

async function getDashboardSummary(walletAddress) {
  const response = await fetch(`https://api.strike.markets/dashboard/${walletAddress}`);
  const data = await response.json();
  
  return {
    totalBalance: parseFloat(data.balances.total),
    availableBalance: parseFloat(data.balances.withdrawable),
    openPositions: data.positions.openPositions.length,
    totalVolume: parseFloat(data.analytics.totalVolume),
    totalPnl: parseFloat(data.analytics.totalPnl),
    winRate: parseFloat(data.analytics.winRate),
    points: parseInt(data.points)
  };
}

Current Position Summary

async function getCurrentPositions(walletAddress) {
  const response = await fetch(`https://api.strike.markets/dashboard/${walletAddress}`);
  const data = await response.json();
  
  const openPositions = data.positions.openPositions;
  const totalUnrealizedPnl = openPositions.reduce((sum, pos) => 
    sum + parseFloat(pos.unrealizedPnl), 0
  );
  
  const totalMarginUsed = openPositions.reduce((sum, pos) => 
    sum + parseFloat(pos.margin), 0
  );
  
  return {
    positionCount: openPositions.length,
    totalUnrealizedPnl,
    totalMarginUsed,
    positions: openPositions.map(pos => ({
      symbol: pos.symbol,
      side: pos.side,
      pnl: parseFloat(pos.unrealizedPnl),
      margin: parseFloat(pos.margin)
    }))
  };
}

Performance Analytics

async function getPerformanceMetrics(walletAddress) {
  const response = await fetch(`https://api.strike.markets/dashboard/${walletAddress}`);
  const data = await response.json();
  
  const totalPositions = data.positions.closedPositions.length + 
                         data.positions.settledPositions.length;
                         
  const avgPositionSize = totalPositions > 0 ? 
    parseFloat(data.analytics.totalVolume) / totalPositions : 0;
  
  const profitFactor = calculateProfitFactor(data.positions.closedPositions);
  
  return {
    totalTrades: totalPositions,
    winRate: parseFloat(data.analytics.winRate),
    totalPnl: parseFloat(data.analytics.totalPnl),
    avgPositionSize,
    profitFactor,
    totalVolume: parseFloat(data.analytics.totalVolume)
  };
}

function calculateProfitFactor(closedPositions) {
  let totalWins = 0;
  let totalLosses = 0;
  
  closedPositions.forEach(pos => {
    // This would need to be calculated based on actual position data
    // For now, we'll estimate based on the position details
  });
  
  return totalLosses > 0 ? totalWins / totalLosses : 0;
}

Risk Assessment

async function assessAccountRisk(walletAddress) {
  const response = await fetch(`https://api.strike.markets/dashboard/${walletAddress}`);
  const data = await response.json();
  
  const marginUtilization = parseFloat(data.balances.reserved) / 
                           parseFloat(data.balances.total) * 100;
                           
  const openPositions = data.positions.openPositions;
  const avgLeverage = openPositions.length > 0 ? 
    openPositions.reduce((sum, pos) => sum + pos.leverage, 0) / openPositions.length : 0;
  
  const totalExposure = openPositions.reduce((sum, pos) => 
    sum + parseFloat(pos.size), 0
  );
  
  return {
    marginUtilization,
    avgLeverage,
    totalExposure,
    openPositionCount: openPositions.length,
    riskLevel: assessRiskLevel(marginUtilization, avgLeverage)
  };
}

function assessRiskLevel(marginUtil, avgLev) {
  if (marginUtil > 80 || avgLev > 50) return 'HIGH';
  if (marginUtil > 50 || avgLev > 20) return 'MEDIUM';
  return 'LOW';
}

Dashboard Widgets

Account Summary Widget

function AccountSummaryWidget({ dashboardData }) {
  return {
    totalBalance: dashboardData.balances.total,
    availableBalance: dashboardData.balances.withdrawable,
    totalPnl: dashboardData.analytics.totalPnl,
    winRate: dashboardData.analytics.winRate + '%',
    points: dashboardData.points
  };
}

Active Positions Widget

function ActivePositionsWidget({ dashboardData }) {
  const openPositions = dashboardData.positions.openPositions;
  
  return {
    count: openPositions.length,
    totalPnl: openPositions.reduce((sum, pos) => 
      sum + parseFloat(pos.unrealizedPnl), 0
    ),
    positions: openPositions.map(pos => ({
      id: pos.positionId,
      market: pos.symbol,
      side: pos.side,
      pnl: pos.unrealizedPnl
    }))
  };
}

Performance Chart Data

function getPerformanceChartData(dashboardData) {
  // Combine closed and settled positions for historical performance
  const allClosedPositions = [
    ...dashboardData.positions.closedPositions,
    ...dashboardData.positions.settledPositions
  ];
  
  // Sort by close date for chronological chart
  allClosedPositions.sort((a, b) => 
    new Date(a.closedAt || a.settledAt) - new Date(b.closedAt || b.settledAt)
  );
  
  let cumulativePnl = 0;
  return allClosedPositions.map(pos => {
    // Calculate individual position PnL (would need additional data)
    const positionPnl = calculatePositionPnl(pos);
    cumulativePnl += positionPnl;
    
    return {
      date: pos.closedAt || pos.settledAt,
      pnl: positionPnl,
      cumulativePnl: cumulativePnl
    };
  });
}

Best Practices

Data Refresh Strategy

  • Real-time updates: Refresh after trading operations
  • Polling frequency: Update every 30-60 seconds for active dashboards
  • Selective updates: Use specific endpoints for frequent updates
  • Error handling: Gracefully handle API failures

UI Implementation

  • Loading states: Show placeholders while data loads
  • Error states: Handle cases where data is unavailable
  • Performance: Cache data appropriately to reduce API calls
  • Responsive design: Adapt dashboard layout to screen size

Data Visualization

  • Balance charts: Show balance trends over time
  • PnL visualization: Display profit/loss patterns
  • Position status: Clear indicators for position health
  • Risk metrics: Visual risk level indicators

Performance Considerations

Caching Strategy

class DashboardCache {
  constructor(ttl = 30000) { // 30 second TTL
    this.cache = new Map();
    this.ttl = ttl;
  }
  
  async getDashboard(walletAddress) {
    const key = `dashboard_${walletAddress}`;
    const cached = this.cache.get(key);
    
    if (cached && Date.now() - cached.timestamp < this.ttl) {
      return cached.data;
    }
    
    const response = await fetch(`https://api.strike.markets/dashboard/${walletAddress}`);
    const data = await response.json();
    
    this.cache.set(key, {
      data,
      timestamp: Date.now()
    });
    
    return data;
  }
}

Optimized Updates

For frequently changing data (like unrealized PnL), consider:
  • Using WebSocket connections for real-time updates
  • Updating only specific sections instead of entire dashboard
  • Implementing incremental updates for large position lists
This endpoint combines data from:
Use this endpoint for initial dashboard loads, then use specific endpoints for frequent updates to reduce bandwidth and improve performance.
Dashboard data provides a snapshot at request time. For real-time trading applications, consider implementing WebSocket connections or frequent polling for critical metrics.

Path Parameters

wallet_address
string
required

Ethereum wallet address

Response

200 - application/json

Dashboard data retrieved successfully

balances
object
positions
object
analytics
object
points
string