TL;DR: Removed all heavy Solana DeFi SDKs (Drift, Solend, MarginFi, Meteora, Raydium) and replaced them with raw batched RPC calls, drastically reducing RPC costs. Added Kamino lending and Drift perpetuals support.
SDK Removal & RPC Optimization
The Wallet DeFi Positions endpoint (/api/2/wallet/defi-positions) has been completely refactored to eliminate heavy SDK dependencies:
Removed SDKs
| SDK | Before | After |
|---|
@drift-labs/sdk | Heavy bundle, many RPC calls | Raw RPC with batched account reads |
@solendprotocol/solend-sdk | Sequential RPC calls | Batched getMultipleAccounts |
@marginfi/marginfi-client-v2 | Complex initialization | Direct account deserialization |
@meteora-ag/dlmm | Multiple RPC roundtrips | Single batched request |
@raydium-io/raydium-sdk-v2 | Heavy dependencies | Pure CLMM math implementation |
- ~70% reduction in RPC calls per wallet query
- Faster response times due to batched account fetching
- Lower memory footprint without heavy SDK bundles
- No SDK initialization overhead per request
New Protocol Support
Kamino Lending
The endpoint now supports Kamino lending positions:
{
"protocol": {
"id": "kamino",
"name": "Kamino",
"category": "lending"
},
"positions": [
{
"type": "deposit",
"name": "USDC Supply",
"valueUSD": 5000.00,
"tokens": [...],
"metadata": {
"apy": "8.5",
"collateralEnabled": true
}
}
]
}
Drift Perpetuals
Full support for Drift perpetual positions is now available:
{
"protocol": {
"id": "drift",
"name": "Drift",
"category": "perps"
},
"positions": [
{
"id": "drift-perp-0-subaccount-0",
"type": "leverage",
"name": "drift-sol-usd LONG",
"valueUSD": 1250.50,
"metadata": {
"marketId": "drift-sol-usd",
"exchange": "drift",
"side": "BUY",
"entryPriceQuote": 180.5,
"currentPriceQuote": 185.2,
"currentLeverage": 5.2,
"liquidationPriceQuote": 145.8,
"amountUSD": 6500.0,
"unrealizedPnlUSD": 250.50,
"unrealizedPnlPercent": 20.04
}
}
]
}
Updated Supported Protocols
Solana
| Category | Protocols |
|---|
| Lending | Kamino (new), MarginFi, Solend |
| DEX (LP) | Orca, Raydium, Meteora |
| Liquid Staking | Jito, Marinade, BlazeStake, Sanctum |
| Perps | Drift (new) |
New metadata fields for perpetual positions:
| Field | Type | Description |
|---|
marketId | string | Market identifier (e.g., “drift-sol-usd”) |
exchange | string | Exchange: drift, gains, hyperliquid, gte, lighter |
side | string | BUY (Long) or SELL (Short) |
entryPriceQuote | number | Entry price |
currentPriceQuote | number | Current mark/oracle price |
currentLeverage | number | Current effective leverage |
liquidationPriceQuote | number | Estimated liquidation price |
unrealizedPnlUSD | number | Unrealized P&L in USD |
unrealizedPnlPercent | number | Unrealized P&L as percentage |
collateralAsset | string | Collateral token address |
Affected Endpoints
All existing integrations remain backwards compatible. The response format is unchanged - only the underlying implementation was optimized.
🦀 Shipped by Krabs