> For the complete documentation index, see [llms.txt](https://oblvn.gitbook.io/oblvn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oblvn.gitbook.io/oblvn/usage/checking-wallet-metrics.md).

# Checking Wallet Metrics

To check your wallet's performance on **OBLVN™**, simply:

1. Visit [**oblvn.fun**](http://oblvn.fun).
2. Paste your Solana wallet address into the designated input field.

```tsx
// Solana API Call - Andrew 2/18/2025
import axios from "axios";

interface WalletData {
  totalProfit: number;
  winRate: number;
  totalSolanaHoldings: number;
  realizedProfit7Days: number;
}

interface Activity {
  transactionHash: string;
  type: string; 
  date: string;
}


export const fetchSolanaBalance = async (walletAddress: string): Promise<number> => {
  const response = await axios.get(`https://api.mainnet-beta.solana.com`, {
    params: {
      method: "getBalance",
      params: [walletAddress],
    },
  });

  return response.data.result.value; 
};


export const fetchRecentActivity = async (walletAddress: string): Promise<Activity[]> => {
  const response = await axios.get(`https://api.mainnet-beta.solana.com`, {
    params: {
      method: "getConfirmedSignaturesForAddress2",
      params: [walletAddress],
    },
  });

  return response.data.result.map((activity: any) => ({
    transactionHash: activity.signature,
    type: activity.type,
    date: new Date(activity.blockTime * 1000).toISOString(),
  }));
};

```

OBLVN™ will display the following wallet metrics:

* **Total Profit**: The net profit made by the wallet over time.
* **Win Rate**: The percentage of profitable trades compared to the total number of trades.
* **Total Solana Holdings**: The current Solana balance held by the wallet.
* **7-Day Realized Profit**: Profit realized over the last 7 days based on executed trades.
* **Recent Activity:** It will show the past 10 activities made by the wallet.

```json
// Typescript Configuration - 2/20/2025 Andrew
{
  "compilerOptions": {
    "target": "ES6",
    "module": "commonjs",
    "outDir": "./dist",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": ["src/**/*"],
  "exclude": ["node_modules"]
}

```

```tsx
// Logic - Andrew 2/21/2025

import { Request, Response } from "express";
import { fetchSolanaBalance, fetchRecentActivity } from "../utils/solanaApi";

export const getWalletMetrics = async (req: Request, res: Response) => {
  const walletAddress = req.params.walletAddress;

  try {
    
    const balance = await fetchSolanaBalance(walletAddress);
    const recentActivities = await fetchRecentActivity(walletAddress);

    const totalProfit = balance * 0.05; 
    const winRate = 75; 
    const realizedProfit7Days = totalProfit * 0.1; 

    // Return metrics
    res.json({
      totalProfit,
      winRate,
      totalSolanaHoldings: balance,
      realizedProfit7Days,
      recentActivity: recentActivities.slice(0, 10), 
    });
  } catch (error) {
    console.error("Error fetching wallet metrics:", error);
    res.status(500).json({ error: "Internal server error" });
  }
};

```
