Hyperliquid API SDK: check which active traders stake HYPE with getStakingSummary

Staking on Hyperliquid is public data, and it is tied to the same addresses that trade. The @siebly/hyperliquid-api SDK offers getStakingSummary() on its RestClient. Given a public address it returns the HYPE that is delegated, undelegated and pending withdrawal. No API key is needed.

Install

npm install @siebly/hyperliquid-api

The script

To get a realistic set of addresses, the script reads the most recent BTC and ETH trades, which list the buyer and seller of each fill, and removes duplicates. It then asks for the staking summary of the first 20, with a short pause between calls to keep the request rate gentle, and prints a small report.

import { RestClient } from '@siebly/hyperliquid-api';

const client = new RestClient();
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

// Addresses that traded BTC or ETH very recently
const users = new Set();
for (const coin of ['BTC', 'ETH']) {
  const trades = await client.getRecentTrades({ coin });
  trades.forEach((trade) => trade.users.forEach((user) => users.add(user)));
  await sleep(2500);
}

const rows = [];
for (const user of [...users].slice(0, 20)) {
  const summary = await client.getStakingSummary({ user });
  rows.push({
    user,
    delegated: Number(summary.delegated),
    undelegated: Number(summary.undelegated),
    pending: summary.nPendingWithdrawals,
  });
  await sleep(2500);
}

const stakers = rows.filter((row) => row.delegated > 0);
const total = stakers.reduce((sum, row) => sum + row.delegated, 0);
const short = (user) => user.slice(0, 6) + '...' + user.slice(-4);

console.log('addresses checked', rows.length, 'with HYPE delegated', stakers.length);
console.log('total delegated HYPE', total.toFixed(2));
console.log('addresses with pending withdrawals', rows.filter((row) => row.pending > 0).length);
for (const row of [...stakers].sort((a, b) => b.delegated - a.delegated).slice(0, 3)) {
  console.log(short(row.user), 'delegated', row.delegated.toFixed(2), 'undelegated', row.undelegated.toFixed(2));
}

Example output

addresses checked 20 with HYPE delegated 1
total delegated HYPE 11304.32
addresses with pending withdrawals 0
0xbe3f...a55b delegated 11304.32 undelegated 0.00

Only one of the 20 addresses held any delegated HYPE in this run, and that address delegated about 11,304 HYPE. None of the 20 had a withdrawal pending. The sample is small and the addresses are different on every run, so treat the result as a worked example of combining two public calls rather than as a survey of the market.

Reading the response

  • delegated is the HYPE currently staked with validators, as a decimal string.
  • undelegated is staked balance that is not assigned to a validator.
  • totalPendingWithdrawal and nPendingWithdrawals describe unstaking that has not finished yet.
  • Every value is a string, so convert with Number() before adding amounts together.

Frequently raised questions

Does getStakingSummary need an API key?

No. It is a public info call, so new RestClient() is enough for research scripts and dashboards on the Hyperliquid API.

How do I see which validators an address uses?

Call getStakingDelegations() for the same address. Each row names a validator, and getValidatorSummaries() turns validator addresses into readable names.

Does it work on testnet, and does TypeScript work?

Create the client with { testnet: true } to use testnet. The Hyperliquid SDK ships TypeScript types, so the summary fields are typed in your editor.

Built with LogoFlowershow