Skip to main content
You're reading the V1 docs. They cover the first generation of Intuition: the intuition-ts packages and the intuition-rs services. New development happens in V2. Open the V2 docs
Version: V1

Leaderboard Queries

The Intuition GraphQL API provides leaderboard queries for ranking accounts and vaults by PnL performance. These are exposed as Hasura SQL functions that return pnl_leaderboard_entry rows.

Available Leaderboard Operations​

PnL Leaderboard​

OperationDescription
get_pnl_leaderboardFull PnL leaderboard with filtering and sorting
get_pnl_leaderboard_periodPeriod-scoped PnL leaderboard with date range

Vault Leaderboard​

OperationDescription
get_vault_leaderboardVault-level leaderboard filtered by term and curve
get_pnl_leaderboard_periodPeriod-scoped leaderboard with date range (use p_term_id/p_curve_id for vault scoping)

Account Rank & Stats​

OperationDescription
get_account_pnl_rankSingle account rank and percentile
get_pnl_leaderboard_statsAggregate protocol-level leaderboard statistics

Direct Table Queries​

These queries access the underlying tables directly with standard Hasura filtering (where, order_by, limit, offset):

QueryDescription
pnl_leaderboard_entryDirect access to leaderboard entries (34 fields)
pnl_leaderboard_statsDirect access to aggregate stats
account_pnl_rankDirect access to account rank data

Common Arguments Pattern​

The leaderboard SQL functions use p_ prefixed arguments passed via an args object:

query {
get_pnl_leaderboard(
args: {
p_limit: 10
p_offset: 0
p_sort_by: "total_pnl"
p_sort_order: "desc"
}
) {
account_id
account_label
rank
total_pnl_formatted
pnl_pct
win_rate
}
}