> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ✨ January 11, 2026 - Batch Wallet Positions

> New batch endpoint for fetching multiple wallet positions in a single request with optimized RPC calls

**TL;DR**: New POST `/wallet/position` batch endpoint - fetch up to 100 positions in one request with optimized Solana `getMultipleAccounts`.

***

## Batch Wallet Positions Endpoint

New batch mode for the wallet/position endpoint, allowing you to fetch multiple positions across different wallets and assets in a single API call.

### Why Batch?

| Use Case               | Before                               | After                           |
| ---------------------- | ------------------------------------ | ------------------------------- |
| Fetch 50 positions     | 50 API calls                         | 1 API call                      |
| Solana RPC overhead    | N calls to `getTokenAccountsByOwner` | 1 call to `getMultipleAccounts` |
| Rate limit consumption | 50 credits                           | 1 credit                        |

### New POST Endpoint

```bash theme={null}
POST /api/2/wallet/position
Content-Type: application/json

{
  "items": [
    { "wallet": "F9cT...a4F2", "blockchain": "Solana", "asset": "HHvQ...pump" },
    { "wallet": "Fw6h...Q6SjW", "blockchain": "Solana", "asset": "6sBB...pump" },
    // ... up to 100 items
  ]
}
```

### Response Format

Each item in the response now includes a `wallet` field for easy identification:

```json theme={null}
{
  "payload": [
    {
      "wallet": "F9cT...a4F2",
      "token": { /* token details */ },
      "balance": 1234.56,
      "rawBalance": "1234560000",
      "amountUSD": 45.67,
      "buys": 5,
      "sells": 2,
      "realizedPnlUSD": 12.34,
      "unrealizedPnlUSD": 5.67,
      "totalPnlUSD": 18.01
      // ... other fields
    },
    // ... other positions
  ]
}
```

### SDK Support

Both TypeScript SDK methods are now available:

```typescript theme={null}
import { Mobula } from '@mobula/sdk';

const mobula = new Mobula({ apiKey: 'your-key' });

// Single position (GET)
const single = await mobula.fetchWalletPosition({
  wallet: 'F9cT...a4F2',
  blockchain: 'Solana',
  asset: 'HHvQ...pump'
});

// Batch positions (POST)
const batch = await mobula.fetchWalletPositionBatch({
  items: [
    { wallet: 'F9cT...a4F2', blockchain: 'Solana', asset: 'HHvQ...pump' },
    { wallet: 'Fw6h...Q6SjW', blockchain: 'Solana', asset: '6sBB...pump' },
  ]
});
```

### Performance Optimizations

* **Single SQL query** using `UNION ALL` instead of N individual queries
* **Batched token data** fetched in one database call
* **Solana**: Uses `getMultipleAccounts` for all SPL tokens (100 accounts per RPC call)
* **Parallel execution** of native SOL and SPL token balance fetches

<Note>
  The batch endpoint is optimized for Solana tokens. EVM chain balance fetching will be added in a future update.
</Note>

***

## SDK Updates

### @mobula\_labs/types v0.1.2

New schemas for batch wallet positions:

* `SinglePositionBatchParamsSchema` - Batch request validation
* `SinglePositionBatchResponseSchema` - Batch response validation
* `batchPositionItemSchema` - Position item with `wallet` field
* Type aliases: `WalletPositionParams`, `WalletPositionResponse`, `WalletPositionBatchParams`, `WalletPositionBatchResponse`

### @mobula/sdk v0.1.2

New methods:

* `fetchWalletPosition(params)` - GET single position
* `fetchWalletPositionBatch(params)` - POST batch positions
