/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
Response Format
Each item in the response now includes awallet field for easy identification:
SDK Support
Both TypeScript SDK methods are now available:Performance Optimizations
- Single SQL query using
UNION ALLinstead of N individual queries - Batched token data fetched in one database call
- Solana: Uses
getMultipleAccountsfor all SPL tokens (100 accounts per RPC call) - Parallel execution of native SOL and SPL token balance fetches
The batch endpoint is optimized for Solana tokens. EVM chain balance fetching will be added in a future update.
SDK Updates
@mobula_labs/types v0.1.2
New schemas for batch wallet positions:SinglePositionBatchParamsSchema- Batch request validationSinglePositionBatchResponseSchema- Batch response validationbatchPositionItemSchema- Position item withwalletfield- Type aliases:
WalletPositionParams,WalletPositionResponse,WalletPositionBatchParams,WalletPositionBatchResponse
@mobula/sdk v0.1.2
New methods:fetchWalletPosition(params)- GET single positionfetchWalletPositionBatch(params)- POST batch positions