delegatorSummary
Get comprehensive delegation summary for a delegator, including staking positions, rewards, and validator relationships.
When to Use This Endpoint#
The delegatorSummary endpoint is essential for:
- Staking Portfolio — View all delegations for a delegator
- Rewards Tracking — Monitor staking rewards across validators
- Delegation Analysis — Analyze delegation strategy and distribution
- Validator Selection — Evaluate current validator relationships
Request#
Endpoint#
POST https://api-hyperliquid-mainnet-info.n.dwellir.com/info
Headers#
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
X-Api-Key | Your API key | Yes |
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Must be "delegatorSummary" |
user | string | Yes | User's Ethereum wallet address |
Example Request#
{
"type": "delegatorSummary",
"user": "0x420a4ed7b6bb361da586868adec2f2bb9ab75e66"
}
Response#
Success Response#
{
"delegated": "12505.32462249",
"undelegated": "10689.31366593",
"totalPendingWithdrawal": "0.0",
"nPendingWithdrawals": 0
}
Response Fields#
| Field | Type | Description |
|---|---|---|
delegated | string | Total amount of tokens currently delegated |
undelegated | string | Total amount of tokens not delegated |
totalPendingWithdrawal | string | Total amount pending withdrawal |
nPendingWithdrawals | integer | Number of pending withdrawal requests |
Code Examples#
- cURL
- JavaScript
- Python
- Go
curl -X POST 'https://api-hyperliquid-mainnet-info.n.dwellir.com/info' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"type": "delegatorSummary",
"user": "0x420a4ed7b6bb361da586868adec2f2bb9ab75e66"
}'
const ENDPOINT = 'https://api-hyperliquid-mainnet-info.n.dwellir.com/info';
const API_KEY = 'your-api-key-here';
async function getDelegatorSummary(userAddress) {
const response = await fetch(ENDPOINT, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': API_KEY
},
body: JSON.stringify({
type: 'delegatorSummary',
user: userAddress
})
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
}
return await response.json();
}
// Usage
const summary = await getDelegatorSummary('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66');
console.log(`Delegated: ${summary.delegated}`);
console.log(`Undelegated: ${summary.undelegated}`);
console.log(`Pending withdrawals: ${summary.nPendingWithdrawals}`);
import requests
from typing import Dict
ENDPOINT = 'https://api-hyperliquid-mainnet-info.n.dwellir.com/info'
API_KEY = 'your-api-key-here'
def get_delegator_summary(user_address: str) -> Dict:
"""Get delegator summary information"""
response = requests.post(
ENDPOINT,
json={
'type': 'delegatorSummary',
'user': user_address
},
headers={
'Content-Type': 'application/json',
'X-Api-Key': API_KEY
},
timeout=10
)
response.raise_for_status()
return response.json()
# Usage
summary = get_delegator_summary('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66')
print(f"Total delegations: {len(summary['delegations'])}")
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
const (
Endpoint = "https://api-hyperliquid-mainnet-info.n.dwellir.com/info"
APIKey = "your-api-key-here"
)
type DelegatorSummaryRequest struct {
Type string `json:"type"`
User string `json:"user"`
}
type DelegatorSummaryResponse struct {
Delegations []interface{} `json:"delegations"`
}
func getDelegatorSummary(userAddress string) (*DelegatorSummaryResponse, error) {
reqBody, _ := json.Marshal(DelegatorSummaryRequest{
Type: "delegatorSummary",
User: userAddress,
})
req, _ := http.NewRequest("POST", Endpoint, bytes.NewBuffer(reqBody))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", APIKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
var result DelegatorSummaryResponse
if err := json.Unmarshal(body, &result); err != nil {
return nil, err
}
return &result, nil
}
func main() {
summary, err := getDelegatorSummary("0x420a4ed7b6bb361da586868adec2f2bb9ab75e66")
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}
fmt.Printf("Total delegations: %d\n", len(summary.Delegations))
}
Common Use Cases#
1. View Staking Portfolio#
Display all delegations for a user:
async function viewStakingPortfolio(userAddress) {
const summary = await getDelegatorSummary(userAddress);
console.log('=== Staking Portfolio ===\n');
console.log(`Total delegations: ${summary.delegations.length}`);
if (summary.delegations.length === 0) {
console.log('No active delegations');
}
}
// Usage
await viewStakingPortfolio('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66');
2. Track Delegation Changes#
Monitor changes in delegation status:
async function trackDelegations(userAddress) {
const summary = await getDelegatorSummary(userAddress);
return {
delegationCount: summary.delegations.length,
hasActiveDelegations: summary.delegations.length > 0,
timestamp: new Date().toISOString()
};
}
// Usage
const status = await trackDelegations('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66');
console.log('Delegation status:', status);
3. Build Staking Dashboard#
Create a comprehensive staking dashboard:
async function getStakingDashboard(userAddress) {
try {
const summary = await getDelegatorSummary(userAddress);
return {
status: 'success',
delegations: summary.delegations,
totalDelegations: summary.delegations.length,
lastUpdated: new Date().toISOString()
};
} catch (error) {
return {
status: 'error',
error: error.message
};
}
}
4. Compare Delegation Strategies#
Analyze delegation distribution:
async function analyzeDelegationStrategy(userAddress) {
const summary = await getDelegatorSummary(userAddress);
const analysis = {
totalDelegations: summary.delegations.length,
isDiversified: summary.delegations.length > 1,
delegationStatus: summary.delegations.length > 0 ? 'active' : 'inactive'
};
console.log('Delegation Analysis:', analysis);
return analysis;
}
Error Handling#
Common Errors#
| Error | Cause | Solution |
|---|---|---|
401 Unauthorized | Invalid API key | Verify your API key is correct |
400 Bad Request | Missing or invalid user address | Ensure valid Ethereum address format |
429 Too Many Requests | Rate limit exceeded | Implement request throttling |
500 Internal Server Error | Server issue | Retry with exponential backoff |
Error Response Example#
{
"error": "Missing required parameter: user",
"code": "MISSING_PARAMETER"
}
Robust Error Handling#
async function safeGetDelegatorSummary(userAddress, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await getDelegatorSummary(userAddress);
} catch (error) {
if (error.response?.status === 429) {
await new Promise(r => setTimeout(r, Math.pow(2, i) * 1000));
} else if (error.response?.status === 400) {
throw new Error('Invalid user address');
} else if (i === maxRetries - 1) {
throw error;
}
}
}
}
Best Practices#
- Validate addresses — Ensure user addresses are valid Ethereum addresses
- Cache data — Cache delegation data for several minutes to reduce API calls
- Handle empty states — Account for users with no delegations
- Monitor regularly — Track delegation changes for portfolio management
- Implement pagination — For users with many delegations, display in batches
Related Endpoints#
- delegations — Get detailed staking delegation information
- validatorL1Votes — Get validator voting information
- clearinghouseState — Get account trading state
- userFees — Get user fee information
Access real-time Hyperliquid delegation data with Dwellir's HyperCore Info Endpoint. Get your API key →