Skip to main content

Overview

GweAI’s Portfolio page provides a comprehensive view of your crypto holdings, real-time values, and performance metrics. All data is fetched directly from your connected wallet.

Real-Time Prices

Live price updates every 30 seconds from CoinGecko

Multi-Token Support

Track 11 major cryptocurrencies and stablecoins

Performance Charts

Visual representation of portfolio value over time

Wallet-Specific

Each wallet address has separate tracking

Accessing Your Portfolio

1

Connect Wallet

Click Connect Wallet in the top navigationSelect your wallet provider (MetaMask, WalletConnect, etc.)
2

Navigate to Portfolio

Click Portfolio in the main menu
3

View Your Holdings

Your balances load automatically from your wallet
Privacy: Portfolio data is read-only. No signatures or approvals are required to view your holdings.

Portfolio Dashboard

Overview Stats

Three key metrics are displayed prominently:
Portfolio overview statistics

Total Value

// Calculation from PortfolioPage.tsx
const totalValue = useMemo(() => {
  const ethValue = parseFloat(ethBalance) * ETH_PRICE;
  const usdcValue = parseFloat(usdcBalance) * USDC_PRICE;
  const btcValue = parseFloat(btcBalance) * BTC_PRICE;
  const solValue = parseFloat(solBalance) * SOL_PRICE;
  // ... other tokens
  return ethValue + usdcValue + btcValue + solValue + ...;
}, [balances, prices]);
Shows:
  • Combined USD value of all holdings
  • Real-time price calculations
  • Auto-updates when prices change

Total Holdings

Shows:
  • Number of different tokens you own
  • Only counts tokens with balance > 0
  • Example: If you have BTC, ETH, and USDC, shows “3 Active tokens”

Holdings List

Detailed breakdown of each token:
ColumnDescriptionExample
TokenName and logoBitcoin (BTC)
BalanceAmount owned0.05 BTC
PriceCurrent USD price$45,000
ValueBalance × Price$2,250
// Token holdings array from PortfolioPage.tsx
const tokenHoldings = useMemo(() => [
  { 
    symbol: 'BTC', 
    name: 'Bitcoin', 
    balance: btcBalance, 
    price: BTC_PRICE, 
    logo: TOKENS.BTC.logo 
  },
  { 
    symbol: 'ETH', 
    name: 'Ethereum', 
    balance: ethBalance, 
    price: ETH_PRICE, 
    logo: TOKENS.ETH.logo 
  },
  // ... filtered to only show tokens with balance > 0
].filter(token => parseFloat(token.balance) > 0), [balances, prices]);

Supported Tokens

Your portfolio tracks these assets:
Decimals: 8Display: Shows up to 6 decimal placesExample: 0.123456 BTC
Decimals: 18Display: Shows 4 decimal placesExample: 1.2345 ETHNote: Currently display-only, not tradeable
Decimals: 9Display: Shows 4 decimal placesExample: 25.5000 SOL
Decimals: 18Display: Shows 8 decimal placesExample: 0.12345678 BNB
Decimals: 6Display: Shows 2 decimal placesExample: 1,234.56 USDCPrice: Always $1.00
  • XRP (Ripple) - 6 decimals
  • TON (Toncoin) - 9 decimals
  • AVAX (Avalanche) - 18 decimals
  • TRX (TRON) - 6 decimals
  • ADA (Cardano) - 6 decimals
  • DOGE (Dogecoin) - 8 decimals

Performance Chart

Real-Time Value Tracking

The performance chart shows your portfolio’s value over time:
// From PerformanceChart component
<PerformanceChart 
  currentValue={totalValue}
  isConnected={connected}
  walletAddress={address}
/>
Features:
  • Live Updates: Refreshes as prices change
  • Historical Data: Shows past performance
  • Timeframe Selection: 24h, 7d, 30d, 90d, 1y, All
  • Interactive Tooltips: Hover to see exact values

How It Works

1

Initial Snapshot

When you first connect, the chart records your current portfolio value
2

Continuous Tracking

Every price update creates a new data point
3

Storage

Data is stored in browser localStorage per wallet address
4

Visualization

Chart renders using your historical snapshots
Privacy: Chart data is stored locally in your browser only. It’s never sent to servers.

Price Updates

Global Price Context

All prices come from a centralized context:
// From PriceContext.tsx
const { prices, priceChanges } = useGlobalPrices();

// Fetches every 30 seconds
const fetchPrices = async () => {
  const response = await fetch(
    'https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum,solana,...&vs_currencies=usd&include_24hr_change=true'
  );
  const data = await response.json();
  setPrices({
    btc: data.bitcoin.usd,
    eth: data.ethereum.usd,
    sol: data.solana.usd,
    // ...
  });
};

Update Frequency

  • Auto-Refresh: Every 30 seconds
  • Manual Refresh: Click the refresh icon
  • On Page Load: Immediate fetch when visiting portfolio

Balance Fetching

Direct Wallet Integration

Balances are read directly from your wallet:
// From useAgwWallet.ts
const { 
  btcBalance,    // "0.05"
  ethBalance,    // "1.2345"
  solBalance,    // "25.5"
  usdcBalance,   // "1234.56"
  // ... other tokens
  connected,     // true/false
  address        // "0x123..."
} = useAgwWallet();

Refresh Mechanism

Balances refresh automatically after:
  • Completing a trade
  • Executing a swap
  • Staking/unstaking tokens
  • Depositing/withdrawing
Use the refresh button to force an update:
const { refreshBalance } = useAgwWallet();
await refreshBalance();
Switching wallets triggers immediate refresh:
useEffect(() => {
  if (connected && address) {
    refreshBalance();
  }
}, [address, connected]);

Portfolio Features

Empty State

If you haven’t connected a wallet:
Portfolio empty state
Shows:
  • Connect wallet prompt
  • Feature preview
  • Benefits of connecting

No Holdings State

If wallet is connected but has no assets:
🪙 No assets in your wallet

Deposit tokens to get started
Actions:

Using Portfolio Data

With AI Chat

The AI Chat can query your portfolio:
User: "Show my portfolio"

AI: 📊 Your Portfolio

Total Value: $12,345.67

| Token | Balance | Value |
|-------|---------|-------|
| BTC   | 0.05    | $2,250|
| ETH   | 1.2345  | $4,100|
| SOL   | 25.5    | $3,570|
| USDC  | 2,425.67| $2,426|

Token-Specific Queries

User: "How much BTC do I have?"

AI: 🪙 Bitcoin Holdings

Balance: 0.05 BTC
Value: $2,250.00
Price: $45,000 per BTC

Portfolio Analysis

// From portfolioService.ts
export async function getUserPortfolio(address: string) {
  const balances = await getWalletBalances(address);
  const prices = await getCurrentPrices();
  
  return {
    tokens: balances.map(b => ({
      symbol: b.symbol,
      amount: b.balance,
      usdValue: b.balance * prices[b.symbol]
    })),
    totalValue: calculateTotalValue(balances, prices)
  };
}

Tax and Record Keeping

Transaction History

While the Portfolio page shows current holdings, transaction history is available in:
  • Trading Page: Trade history for buys/sells
  • Swap Page: Token swap transactions
  • Vault Page: Staking/unstaking records

Export Functionality

For transaction records and tax reporting:
  1. View transaction hashes in history tables
  2. Use BaseScan blockchain explorer for full records
  3. Export data from the transaction history page

Performance Metrics

Calculating Returns

Unrealized Gain/Loss:
Current Value - Total Invested = Unrealized P&L
Percentage Return:
((Current Value / Total Invested) - 1) × 100 = Return %
Average Cost Basis:
Total USD Invested ÷ Total Tokens Owned = Avg Cost
Note: GweAI currently shows snapshot values only. Full P&L tracking requires manual calculation or third-party tools.

Mobile Experience

The portfolio page is fully responsive:
  • Tablet: 2-column holdings grid
  • Mobile: Single-column stacked layout
  • Touch-Friendly: Large tap targets
  • Optimized Charts: Simplified on small screens

Security & Privacy

Read-Only Access

No signatures required to view portfolio

Local Storage

Chart data stored in browser only

No Server Tracking

Portfolio queries don’t leave your device

Wallet-Specific

Each address has isolated data

Troubleshooting

Balances Not Showing

Cause: Wallet not properly connected Solution:
  1. Disconnect and reconnect wallet
  2. Refresh the page
  3. Check network (should be Base Sepolia)

Prices Not Updating

Cause: API rate limiting or network issue Solution:
  1. Wait 30 seconds for auto-refresh
  2. Click manual refresh button
  3. Check internet connection

Wrong Total Value

Cause: Stale price data Solution:
  1. Force refresh prices
  2. Check CoinGecko status
  3. Verify token balances are correct

Best Practices

Check portfolio weekly, not dailyReduces emotional trading decisions
Save transaction hashes for tax purposesExport data before clearing browser cache
Monitor allocation across tokensAvoid over-concentration in one asset
Use chart to assess long-term trendsIgnore short-term volatility

Next Steps

Trading

Buy or sell tokens to adjust holdings

Swap

Rebalance your portfolio

Vault Staking

Earn yield on idle assets

AI Chat

Query portfolio using natural language

Build docs developers (and LLMs) love