Docs

delegations - HyperCore Info Endpoint

Get detailed staking delegation information for a user on Hyperliquid. Track validators, amounts, rewards, and delegation history.

Get detailed staking delegation information for a user, including validator assignments, amounts, and delegation history.

The live response is an array of delegation records, not an object wrapper.

Authenticate HyperCore Info requests by sending your Dwellir API key in the x-api-key header to https://api-hyperliquid-mainnet-info.n.dwellir.com/info.

When to Use This Endpoint

The delegations endpoint is essential for:

  • Staking Management — View detailed delegation information
  • Validator Tracking — Monitor which validators you're delegating to
  • Rewards Analysis — Track delegation performance and returns
  • Portfolio Optimization — Analyze and rebalance delegation strategy

Common Use Cases

1. View Delegation Portfolio

Display all active delegations:

JavaScript
async function viewDelegationPortfolio(userAddress) {
  const delegations = await getDelegations(userAddress);

  console.log('=== Delegation Portfolio ===\n');
  console.log(`Total delegations: ${delegations.length}`);

  if (delegations.length === 0) {
    console.log('No active delegations');
  } else {
    console.log('Delegation details available');
  }
}

// Usage
await viewDelegationPortfolio('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66');

2. Monitor Delegation Status

Track delegation changes over time:

JavaScript
async function monitorDelegationStatus(userAddress) {
  const delegations = await getDelegations(userAddress);

  return {
    delegationCount: delegations.length,
    hasActiveDelegations: delegations.length > 0,
    timestamp: new Date().toISOString()
  };
}

// Usage
const status = await monitorDelegationStatus('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66');
console.log('Delegation status:', status);

3. Build Staking Dashboard

Create a comprehensive staking dashboard:

JavaScript
async function getStakingDashboard(userAddress) {
  try {
    const delegations = await getDelegations(userAddress);

    return {
      status: 'success',
      delegations: delegations,
      totalDelegations: delegations.length,
      isStaking: delegations.length > 0,
      lastUpdated: new Date().toISOString()
    };
  } catch (error) {
    return {
      status: 'error',
      error: error.message
    };
  }
}

// Usage
const dashboard = await getStakingDashboard('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66');
console.log('Staking Dashboard:', dashboard);

4. Check Delegation Diversity

Analyze delegation distribution:

JavaScript
async function analyzeDelegationDiversity(userAddress) {
  const delegations = await getDelegations(userAddress);

  const analysis = {
    totalDelegations: delegations.length,
    isDiversified: delegations.length > 1,
    delegationStatus: delegations.length > 0 ? 'active' : 'none'
  };

  if (analysis.isDiversified) {
    console.log('Portfolio is diversified across multiple validators');
  } else if (analysis.totalDelegations === 1) {
    console.log('Portfolio concentrated in single validator');
  } else {
    console.log('No active delegations');
  }

  return analysis;
}

5. Track Delegation History

Monitor delegation changes:

JavaScript
class DelegationTracker {
  constructor(userAddress) {
    this.userAddress = userAddress;
    this.history = [];
  }

  async recordSnapshot() {
    const delegations = await getDelegations(this.userAddress);

    const snapshot = {
      timestamp: Date.now(),
      delegationCount: delegations.length,
      delegations: delegations
    };

    this.history.push(snapshot);
    return snapshot;
  }

  getHistory() {
    return this.history;
  }

  detectChanges() {
    if (this.history.length < 2) return null;

    const latest = this.history[this.history.length - 1];
    const previous = this.history[this.history.length - 2];

    return {
      countChange: latest.delegationCount - previous.delegationCount,
      timestamp: latest.timestamp
    };
  }
}

// Usage
const tracker = new DelegationTracker('0x420a4ed7b6bb361da586868adec2f2bb9ab75e66');
await tracker.recordSnapshot();

Best Practices

  1. Validate addresses — Ensure user addresses are valid Ethereum addresses
  2. Cache strategically — Cache delegation data for several minutes
  3. Handle empty states — Account for users with no delegations
  4. Monitor regularly — Track changes for portfolio management
  5. Compare snapshots — Store historical data to detect changes

Access real-time Hyperliquid delegation data with Dwellir's HyperCore Info Endpoint. Get your API key →