Class: Hyperliquid::Info
- Inherits:
-
Object
- Object
- Hyperliquid::Info
- Defined in:
- lib/hyperliquid/info.rb
Overview
Client for read-only Info API endpoints
Instance Method Summary collapse
-
#active_asset_data(user, coin) ⇒ Hash
Retrieve User’s Active Asset Data.
-
#aligned_quote_token_info(token) ⇒ Hash
Get supply, rate, and pending payment information for an aligned quote token.
-
#all_borrow_lend_reserve_states ⇒ Array<Array>
Retrieve borrow/lend reserve states for all tokens.
-
#all_mids(dex: nil) ⇒ Hash
Get all market mid prices.
-
#all_perp_metas ⇒ Array<Hash>
Get trading metadata for all perpetual dexs.
-
#approved_builders(user) ⇒ Array<String>
Query approved builders for a user.
-
#block_details(height) ⇒ Hash
Get block details by block height.
-
#borrow_lend_reserve_state(token) ⇒ Hash
Retrieve borrow/lend reserve state for a single token.
-
#borrow_lend_user_state(user) ⇒ Hash
Retrieve a user’s borrow/lend state across tokens.
-
#candles_snapshot(coin, interval, start_time, end_time) ⇒ Array
Get candlestick data.
-
#delegations(user) ⇒ Array
Query a user’s staking delegations.
-
#delegator_history(user) ⇒ Array
Query a user’s staking history.
-
#delegator_rewards(user) ⇒ Array
Query a user’s staking rewards.
-
#delegator_summary(user) ⇒ Hash
Query a user’s staking summary.
-
#exchange_status ⇒ Hash
Retrieve exchange system status information.
-
#extra_agents(user) ⇒ Array
Get authorized agent addresses for a user.
-
#frontend_open_orders(user, dex: nil) ⇒ Array
Get a user’s open orders with additional frontend info.
-
#funding_history(coin, start_time, end_time = nil) ⇒ Array
Retrieve historical funding rates.
-
#gossip_root_ips ⇒ Array<String>
Retrieve gossip root IPs.
-
#historical_orders(user, start_time = nil, end_time = nil) ⇒ Array
Retrieve a user’s historical orders.
-
#initialize(client) ⇒ Info
constructor
A new instance of Info.
-
#l2_book(coin) ⇒ Hash
Get L2 order book for a coin.
-
#leading_vaults(user) ⇒ Array<Hash>
Retrieve the vaults a user is leading.
-
#legal_check(user) ⇒ Hash
Retrieve a user’s legal verification status.
-
#liquidatable ⇒ Array
Retrieve addresses of currently liquidatable users.
-
#margin_table(id) ⇒ Hash
Retrieve the margin requirements table for a given id.
-
#max_builder_fee(user, builder) ⇒ Hash
Check builder fee approval.
-
#max_market_order_ntls ⇒ Array<Array>
Retrieve maximum market order notionals per asset.
-
#meta(dex: nil) ⇒ Hash
Get metadata for all assets.
-
#meta_and_asset_ctxs ⇒ Hash
Get metadata for all assets including universe info.
-
#open_orders(user, dex: nil) ⇒ Array
Get a user’s open orders.
-
#order_status(user, oid) ⇒ Hash
Get order status by order ID.
-
#order_status_by_cloid(user, cloid) ⇒ Hash
Get order status by client order ID (cloid).
-
#outcome_meta ⇒ Hash
Retrieve prediction market outcome metadata.
-
#perp_annotation(coin) ⇒ Hash?
Retrieve perp annotation for a single perpetual asset.
-
#perp_categories ⇒ Array<Array(String, String)>
Retrieve perpetual asset categories.
-
#perp_concise_annotations ⇒ Array<Array>
Retrieve concise annotations for all perpetual assets.
-
#perp_deploy_auction_status ⇒ Hash
Retrieve information about the Perp Deploy Auction.
-
#perp_dex_limits(dex) ⇒ Hash
Retrieve Builder-Deployed Perp Market Limits.
-
#perp_dex_status(dex) ⇒ Hash
Retrieve perp DEX status (e.g. total net deposit) for a builder-deployed dex.
-
#perp_dexs ⇒ Array
Retrieve all perpetual dexs.
-
#perps_at_open_interest_cap ⇒ Array
Query perps at open interest caps.
-
#portfolio(user) ⇒ Array
Query a user’s portfolio time series.
-
#pre_transfer_check(user, source) ⇒ Hash
Check user existence, activation fee, and sanctions status before a transfer.
-
#predicted_fundings ⇒ Array
Retrieve predicted funding rates for different venues.
-
#recent_trades(coin) ⇒ Array
Get recent trades for a coin.
-
#referral(user) ⇒ Hash
Query a user’s referral information.
-
#spot_balances(user) ⇒ Hash
Get a user’s spot token balances.
-
#spot_deploy_state(user) ⇒ Hash
Get Spot Deploy Auction state for a user.
-
#spot_meta ⇒ Hash
Get spot metadata.
-
#spot_meta_and_asset_ctxs ⇒ Array
Get spot metadata and asset contexts.
-
#spot_pair_deploy_auction_status ⇒ Hash
Get Spot Pair Deploy Auction status.
-
#sub_accounts2(user) ⇒ Array<Hash>?
Retrieve a user’s V2 subaccounts (per-dex clearinghouse + spot state).
-
#token_details(token_id) ⇒ Hash
Get token details by tokenId.
-
#twap_history(user) ⇒ Array<Hash>
Retrieve a user’s TWAP order history.
-
#user_abstraction(user) ⇒ String
Query a user’s abstraction state.
-
#user_borrow_lend_interest(user, start_time, end_time = nil) ⇒ Array<Hash>
Retrieve a user’s borrow/lend interest accrual history.
-
#user_dex_abstraction(user) ⇒ Hash
Get dex abstraction config for a user.
-
#user_fees(user) ⇒ Hash
Query a user’s effective fee rates and schedule.
-
#user_fills(user) ⇒ Array
Get a user’s fill history.
-
#user_fills_by_time(user, start_time, end_time = nil, aggregate_by_time: nil, reversed: nil) ⇒ Array
Get a user’s fills within a time range.
-
#user_funding(user, start_time, end_time = nil) ⇒ Array
Retrieve a user’s funding history.
-
#user_non_funding_ledger_updates(user, start_time, end_time = nil) ⇒ Array
Retrieve a user’s non-funding ledger updates.
-
#user_rate_limit(user) ⇒ Hash
Query user rate limits and usage.
-
#user_role(user) ⇒ Hash
Query a user’s role.
-
#user_state(user, dex: nil) ⇒ Hash
Get user’s trading state.
-
#user_subaccounts(user) ⇒ Array
Retrieve a user’s subaccounts.
-
#user_to_multi_sig_signers(user) ⇒ Hash
Get multi-sig signer mappings for a user.
-
#user_twap_slice_fills(user, start_time = nil, end_time = nil) ⇒ Array
Retrieve a user’s TWAP slice fills.
-
#user_twap_slice_fills_by_time(user, start_time, end_time = nil, aggregate_by_time: nil) ⇒ Array
Retrieve a user’s TWAP slice fills within a time range.
-
#user_vault_equities(user) ⇒ Array
Retrieve a user’s vault deposits.
-
#validator_l1_votes ⇒ Array
Retrieve L1 governance votes cast by validators.
-
#validator_summaries ⇒ Array
Retrieve validator performance summaries.
-
#vault_details(vault_address, user = nil) ⇒ Hash
Retrieve details for a vault.
-
#vault_summaries ⇒ Array
Retrieve a list of vaults less than 2 hours old.
-
#vip?(user) ⇒ Boolean?
Check whether a user is a VIP.
-
#web_data2(user) ⇒ Hash
Retrieve comprehensive user and market data in a single response.
Constructor Details
#initialize(client) ⇒ Info
Returns a new instance of Info.
6 7 8 |
# File 'lib/hyperliquid/info.rb', line 6 def initialize(client) @client = client end |
Instance Method Details
#active_asset_data(user, coin) ⇒ Hash
Retrieve User’s Active Asset Data
464 465 466 |
# File 'lib/hyperliquid/info.rb', line 464 def active_asset_data(user, coin) @client.post(Constants::INFO_ENDPOINT, { type: 'activeAssetData', user: user, coin: coin }) end |
#aligned_quote_token_info(token) ⇒ Hash
Get supply, rate, and pending payment information for an aligned quote token
591 592 593 |
# File 'lib/hyperliquid/info.rb', line 591 def aligned_quote_token_info(token) @client.post(Constants::INFO_ENDPOINT, { type: 'alignedQuoteTokenInfo', token: token }) end |
#all_borrow_lend_reserve_states ⇒ Array<Array>
Retrieve borrow/lend reserve states for all tokens
619 620 621 |
# File 'lib/hyperliquid/info.rb', line 619 def all_borrow_lend_reserve_states @client.post(Constants::INFO_ENDPOINT, { type: 'allBorrowLendReserveStates' }) end |
#all_mids(dex: nil) ⇒ Hash
Get all market mid prices
18 19 20 21 22 |
# File 'lib/hyperliquid/info.rb', line 18 def all_mids(dex: nil) body = { type: 'allMids' } body[:dex] = dex if dex @client.post(Constants::INFO_ENDPOINT, body) end |
#all_perp_metas ⇒ Array<Hash>
Get trading metadata for all perpetual dexs
428 429 430 |
# File 'lib/hyperliquid/info.rb', line 428 def @client.post(Constants::INFO_ENDPOINT, { type: 'allPerpMetas' }) end |
#approved_builders(user) ⇒ Array<String>
Query approved builders for a user
140 141 142 |
# File 'lib/hyperliquid/info.rb', line 140 def approved_builders(user) @client.post(Constants::INFO_ENDPOINT, { type: 'approvedBuilders', user: user }) end |
#block_details(height) ⇒ Hash
Get block details by block height
107 108 109 |
# File 'lib/hyperliquid/info.rb', line 107 def block_details(height) @client.post(Constants::INFO_ENDPOINT, { type: 'blockDetails', height: height }) end |
#borrow_lend_reserve_state(token) ⇒ Hash
Retrieve borrow/lend reserve state for a single token
611 612 613 |
# File 'lib/hyperliquid/info.rb', line 611 def borrow_lend_reserve_state(token) @client.post(Constants::INFO_ENDPOINT, { type: 'borrowLendReserveState', token: token }) end |
#borrow_lend_user_state(user) ⇒ Hash
Retrieve a user’s borrow/lend state across tokens
603 604 605 |
# File 'lib/hyperliquid/info.rb', line 603 def borrow_lend_user_state(user) @client.post(Constants::INFO_ENDPOINT, { type: 'borrowLendUserState', user: user }) end |
#candles_snapshot(coin, interval, start_time, end_time) ⇒ Array
Get candlestick data
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/hyperliquid/info.rb', line 117 def candles_snapshot(coin, interval, start_time, end_time) @client.post(Constants::INFO_ENDPOINT, { type: 'candleSnapshot', req: { coin: coin, interval: interval, startTime: start_time, endTime: end_time } }) end |
#delegations(user) ⇒ Array
Query a user’s staking delegations
253 254 255 |
# File 'lib/hyperliquid/info.rb', line 253 def delegations(user) @client.post(Constants::INFO_ENDPOINT, { type: 'delegations', user: user }) end |
#delegator_history(user) ⇒ Array
Query a user’s staking history
267 268 269 |
# File 'lib/hyperliquid/info.rb', line 267 def delegator_history(user) @client.post(Constants::INFO_ENDPOINT, { type: 'delegatorHistory', user: user }) end |
#delegator_rewards(user) ⇒ Array
Query a user’s staking rewards
274 275 276 |
# File 'lib/hyperliquid/info.rb', line 274 def delegator_rewards(user) @client.post(Constants::INFO_ENDPOINT, { type: 'delegatorRewards', user: user }) end |
#delegator_summary(user) ⇒ Hash
Query a user’s staking summary
260 261 262 |
# File 'lib/hyperliquid/info.rb', line 260 def delegator_summary(user) @client.post(Constants::INFO_ENDPOINT, { type: 'delegatorSummary', user: user }) end |
#exchange_status ⇒ Hash
Retrieve exchange system status information
339 340 341 |
# File 'lib/hyperliquid/info.rb', line 339 def exchange_status @client.post(Constants::INFO_ENDPOINT, { type: 'exchangeStatus' }) end |
#extra_agents(user) ⇒ Array
Get authorized agent addresses for a user
281 282 283 |
# File 'lib/hyperliquid/info.rb', line 281 def extra_agents(user) @client.post(Constants::INFO_ENDPOINT, { type: 'extraAgents', user: user }) end |
#frontend_open_orders(user, dex: nil) ⇒ Array
Get a user’s open orders with additional frontend info
38 39 40 41 42 |
# File 'lib/hyperliquid/info.rb', line 38 def frontend_open_orders(user, dex: nil) body = { type: 'frontendOpenOrders', user: user } body[:dex] = dex if dex @client.post(Constants::INFO_ENDPOINT, body) end |
#funding_history(coin, start_time, end_time = nil) ⇒ Array
Retrieve historical funding rates
538 539 540 541 542 |
# File 'lib/hyperliquid/info.rb', line 538 def funding_history(coin, start_time, end_time = nil) body = { type: 'fundingHistory', coin: coin, startTime: start_time } body[:endTime] = end_time if end_time @client.post(Constants::INFO_ENDPOINT, body) end |
#gossip_root_ips ⇒ Array<String>
Retrieve gossip root IPs
358 359 360 |
# File 'lib/hyperliquid/info.rb', line 358 def gossip_root_ips @client.post(Constants::INFO_ENDPOINT, { type: 'gossipRootIps' }) end |
#historical_orders(user, start_time = nil, end_time = nil) ⇒ Array
Retrieve a user’s historical orders
149 150 151 152 153 154 |
# File 'lib/hyperliquid/info.rb', line 149 def historical_orders(user, start_time = nil, end_time = nil) body = { type: 'historicalOrders', user: user } body[:startTime] = start_time if start_time body[:endTime] = end_time if end_time @client.post(Constants::INFO_ENDPOINT, body) end |
#l2_book(coin) ⇒ Hash
Get L2 order book for a coin
93 94 95 |
# File 'lib/hyperliquid/info.rb', line 93 def l2_book(coin) @client.post(Constants::INFO_ENDPOINT, { type: 'l2Book', coin: coin }) end |
#leading_vaults(user) ⇒ Array<Hash>
Retrieve the vaults a user is leading
379 380 381 |
# File 'lib/hyperliquid/info.rb', line 379 def leading_vaults(user) @client.post(Constants::INFO_ENDPOINT, { type: 'leadingVaults', user: user }) end |
#legal_check(user) ⇒ Hash
Retrieve a user’s legal verification status
365 366 367 |
# File 'lib/hyperliquid/info.rb', line 365 def legal_check(user) @client.post(Constants::INFO_ENDPOINT, { type: 'legalCheck', user: user }) end |
#liquidatable ⇒ Array
Retrieve addresses of currently liquidatable users
325 326 327 |
# File 'lib/hyperliquid/info.rb', line 325 def liquidatable @client.post(Constants::INFO_ENDPOINT, { type: 'liquidatable' }) end |
#margin_table(id) ⇒ Hash
Retrieve the margin requirements table for a given id
372 373 374 |
# File 'lib/hyperliquid/info.rb', line 372 def margin_table(id) @client.post(Constants::INFO_ENDPOINT, { type: 'marginTable', id: id }) end |
#max_builder_fee(user, builder) ⇒ Hash
Check builder fee approval
133 134 135 |
# File 'lib/hyperliquid/info.rb', line 133 def max_builder_fee(user, builder) @client.post(Constants::INFO_ENDPOINT, { type: 'maxBuilderFee', user: user, builder: builder }) end |
#max_market_order_ntls ⇒ Array<Array>
Retrieve maximum market order notionals per asset
345 346 347 |
# File 'lib/hyperliquid/info.rb', line 345 def max_market_order_ntls @client.post(Constants::INFO_ENDPOINT, { type: 'maxMarketOrderNtls' }) end |
#meta(dex: nil) ⇒ Hash
Get metadata for all assets
414 415 416 417 418 |
# File 'lib/hyperliquid/info.rb', line 414 def (dex: nil) body = { type: 'meta' } body[:dex] = dex if dex @client.post(Constants::INFO_ENDPOINT, body) end |
#meta_and_asset_ctxs ⇒ Hash
Get metadata for all assets including universe info
422 423 424 |
# File 'lib/hyperliquid/info.rb', line 422 def @client.post(Constants::INFO_ENDPOINT, { type: 'metaAndAssetCtxs' }) end |
#open_orders(user, dex: nil) ⇒ Array
Get a user’s open orders
28 29 30 31 32 |
# File 'lib/hyperliquid/info.rb', line 28 def open_orders(user, dex: nil) body = { type: 'openOrders', user: user } body[:dex] = dex if dex @client.post(Constants::INFO_ENDPOINT, body) end |
#order_status(user, oid) ⇒ Hash
Get order status by order ID
78 79 80 |
# File 'lib/hyperliquid/info.rb', line 78 def order_status(user, oid) @client.post(Constants::INFO_ENDPOINT, { type: 'orderStatus', user: user, oid: oid }) end |
#order_status_by_cloid(user, cloid) ⇒ Hash
Get order status by client order ID (cloid)
86 87 88 |
# File 'lib/hyperliquid/info.rb', line 86 def order_status_by_cloid(user, cloid) @client.post(Constants::INFO_ENDPOINT, { type: 'orderStatus', user: user, cloid: cloid }) end |
#outcome_meta ⇒ Hash
Retrieve prediction market outcome metadata
507 508 509 |
# File 'lib/hyperliquid/info.rb', line 507 def @client.post(Constants::INFO_ENDPOINT, { type: 'outcomeMeta' }) end |
#perp_annotation(coin) ⇒ Hash?
Retrieve perp annotation for a single perpetual asset
492 493 494 |
# File 'lib/hyperliquid/info.rb', line 492 def perp_annotation(coin) @client.post(Constants::INFO_ENDPOINT, { type: 'perpAnnotation', coin: coin }) end |
#perp_categories ⇒ Array<Array(String, String)>
Retrieve perpetual asset categories
484 485 486 |
# File 'lib/hyperliquid/info.rb', line 484 def perp_categories @client.post(Constants::INFO_ENDPOINT, { type: 'perpCategories' }) end |
#perp_concise_annotations ⇒ Array<Array>
Retrieve concise annotations for all perpetual assets
499 500 501 |
# File 'lib/hyperliquid/info.rb', line 499 def perp_concise_annotations @client.post(Constants::INFO_ENDPOINT, { type: 'perpConciseAnnotations' }) end |
#perp_deploy_auction_status ⇒ Hash
Retrieve information about the Perp Deploy Auction
456 457 458 |
# File 'lib/hyperliquid/info.rb', line 456 def perp_deploy_auction_status @client.post(Constants::INFO_ENDPOINT, { type: 'perpDeployAuctionStatus' }) end |
#perp_dex_limits(dex) ⇒ Hash
Retrieve Builder-Deployed Perp Market Limits
471 472 473 |
# File 'lib/hyperliquid/info.rb', line 471 def perp_dex_limits(dex) @client.post(Constants::INFO_ENDPOINT, { type: 'perpDexLimits', dex: dex }) end |
#perp_dex_status(dex) ⇒ Hash
Retrieve perp DEX status (e.g. total net deposit) for a builder-deployed dex
478 479 480 |
# File 'lib/hyperliquid/info.rb', line 478 def perp_dex_status(dex) @client.post(Constants::INFO_ENDPOINT, { type: 'perpDexStatus', dex: dex }) end |
#perp_dexs ⇒ Array
Retrieve all perpetual dexs
407 408 409 |
# File 'lib/hyperliquid/info.rb', line 407 def perp_dexs @client.post(Constants::INFO_ENDPOINT, { type: 'perpDexs' }) end |
#perps_at_open_interest_cap ⇒ Array
Query perps at open interest caps
450 451 452 |
# File 'lib/hyperliquid/info.rb', line 450 def perps_at_open_interest_cap @client.post(Constants::INFO_ENDPOINT, { type: 'perpsAtOpenInterestCap' }) end |
#portfolio(user) ⇒ Array
Query a user’s portfolio time series
232 233 234 |
# File 'lib/hyperliquid/info.rb', line 232 def portfolio(user) @client.post(Constants::INFO_ENDPOINT, { type: 'portfolio', user: user }) end |
#pre_transfer_check(user, source) ⇒ Hash
Check user existence, activation fee, and sanctions status before a transfer
312 313 314 |
# File 'lib/hyperliquid/info.rb', line 312 def pre_transfer_check(user, source) @client.post(Constants::INFO_ENDPOINT, { type: 'preTransferCheck', user: user, source: source }) end |
#predicted_fundings ⇒ Array
Retrieve predicted funding rates for different venues
444 445 446 |
# File 'lib/hyperliquid/info.rb', line 444 def predicted_fundings @client.post(Constants::INFO_ENDPOINT, { type: 'predictedFundings' }) end |
#recent_trades(coin) ⇒ Array
Get recent trades for a coin
100 101 102 |
# File 'lib/hyperliquid/info.rb', line 100 def recent_trades(coin) @client.post(Constants::INFO_ENDPOINT, { type: 'recentTrades', coin: coin }) end |
#referral(user) ⇒ Hash
Query a user’s referral information
239 240 241 |
# File 'lib/hyperliquid/info.rb', line 239 def referral(user) @client.post(Constants::INFO_ENDPOINT, { type: 'referral', user: user }) end |
#spot_balances(user) ⇒ Hash
Get a user’s spot token balances
563 564 565 |
# File 'lib/hyperliquid/info.rb', line 563 def spot_balances(user) @client.post(Constants::INFO_ENDPOINT, { type: 'spotClearinghouseState', user: user }) end |
#spot_deploy_state(user) ⇒ Hash
Get Spot Deploy Auction state for a user
570 571 572 |
# File 'lib/hyperliquid/info.rb', line 570 def spot_deploy_state(user) @client.post(Constants::INFO_ENDPOINT, { type: 'spotDeployState', user: user }) end |
#spot_meta ⇒ Hash
Get spot metadata
550 551 552 |
# File 'lib/hyperliquid/info.rb', line 550 def @client.post(Constants::INFO_ENDPOINT, { type: 'spotMeta' }) end |
#spot_meta_and_asset_ctxs ⇒ Array
Get spot metadata and asset contexts
556 557 558 |
# File 'lib/hyperliquid/info.rb', line 556 def @client.post(Constants::INFO_ENDPOINT, { type: 'spotMetaAndAssetCtxs' }) end |
#spot_pair_deploy_auction_status ⇒ Hash
Get Spot Pair Deploy Auction status
576 577 578 |
# File 'lib/hyperliquid/info.rb', line 576 def spot_pair_deploy_auction_status @client.post(Constants::INFO_ENDPOINT, { type: 'spotPairDeployAuctionStatus' }) end |
#sub_accounts2(user) ⇒ Array<Hash>?
Retrieve a user’s V2 subaccounts (per-dex clearinghouse + spot state)
194 195 196 |
# File 'lib/hyperliquid/info.rb', line 194 def sub_accounts2(user) @client.post(Constants::INFO_ENDPOINT, { type: 'subAccounts2', user: user }) end |
#token_details(token_id) ⇒ Hash
Get token details by tokenId
583 584 585 |
# File 'lib/hyperliquid/info.rb', line 583 def token_details(token_id) @client.post(Constants::INFO_ENDPOINT, { type: 'tokenDetails', tokenId: token_id }) end |
#twap_history(user) ⇒ Array<Hash>
Retrieve a user’s TWAP order history
387 388 389 |
# File 'lib/hyperliquid/info.rb', line 387 def twap_history(user) @client.post(Constants::INFO_ENDPOINT, { type: 'twapHistory', user: user }) end |
#user_abstraction(user) ⇒ String
Query a user’s abstraction state
303 304 305 |
# File 'lib/hyperliquid/info.rb', line 303 def user_abstraction(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userAbstraction', user: user }) end |
#user_borrow_lend_interest(user, start_time, end_time = nil) ⇒ Array<Hash>
Retrieve a user’s borrow/lend interest accrual history
629 630 631 632 633 |
# File 'lib/hyperliquid/info.rb', line 629 def user_borrow_lend_interest(user, start_time, end_time = nil) body = { type: 'userBorrowLendInterest', user: user, startTime: start_time } body[:endTime] = end_time if end_time @client.post(Constants::INFO_ENDPOINT, body) end |
#user_dex_abstraction(user) ⇒ Hash
Get dex abstraction config for a user
295 296 297 |
# File 'lib/hyperliquid/info.rb', line 295 def user_dex_abstraction(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userDexAbstraction', user: user }) end |
#user_fees(user) ⇒ Hash
Query a user’s effective fee rates and schedule
246 247 248 |
# File 'lib/hyperliquid/info.rb', line 246 def user_fees(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userFees', user: user }) end |
#user_fills(user) ⇒ Array
Get a user’s fill history
47 48 49 |
# File 'lib/hyperliquid/info.rb', line 47 def user_fills(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userFills', user: user }) end |
#user_fills_by_time(user, start_time, end_time = nil, aggregate_by_time: nil, reversed: nil) ⇒ Array
Get a user’s fills within a time range
59 60 61 62 63 64 65 |
# File 'lib/hyperliquid/info.rb', line 59 def user_fills_by_time(user, start_time, end_time = nil, aggregate_by_time: nil, reversed: nil) body = { type: 'userFillsByTime', user: user, startTime: start_time } body[:endTime] = end_time if end_time body[:aggregateByTime] = aggregate_by_time unless aggregate_by_time.nil? body[:reversed] = reversed unless reversed.nil? @client.post(Constants::INFO_ENDPOINT, body) end |
#user_funding(user, start_time, end_time = nil) ⇒ Array
Retrieve a user’s funding history
516 517 518 519 520 |
# File 'lib/hyperliquid/info.rb', line 516 def user_funding(user, start_time, end_time = nil) body = { type: 'userFunding', user: user, startTime: start_time } body[:endTime] = end_time if end_time @client.post(Constants::INFO_ENDPOINT, body) end |
#user_non_funding_ledger_updates(user, start_time, end_time = nil) ⇒ Array
Retrieve a user’s non-funding ledger updates
527 528 529 530 531 |
# File 'lib/hyperliquid/info.rb', line 527 def user_non_funding_ledger_updates(user, start_time, end_time = nil) body = { type: 'userNonFundingLedgerUpdates', user: user, startTime: start_time } body[:endTime] = end_time if end_time @client.post(Constants::INFO_ENDPOINT, body) end |
#user_rate_limit(user) ⇒ Hash
Query user rate limits and usage
70 71 72 |
# File 'lib/hyperliquid/info.rb', line 70 def user_rate_limit(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userRateLimit', user: user }) end |
#user_role(user) ⇒ Hash
Query a user’s role
225 226 227 |
# File 'lib/hyperliquid/info.rb', line 225 def user_role(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userRole', user: user }) end |
#user_state(user, dex: nil) ⇒ Hash
Get user’s trading state
436 437 438 439 440 |
# File 'lib/hyperliquid/info.rb', line 436 def user_state(user, dex: nil) body = { type: 'clearinghouseState', user: user } body[:dex] = dex if dex @client.post(Constants::INFO_ENDPOINT, body) end |
#user_subaccounts(user) ⇒ Array
Retrieve a user’s subaccounts
185 186 187 |
# File 'lib/hyperliquid/info.rb', line 185 def user_subaccounts(user) @client.post(Constants::INFO_ENDPOINT, { type: 'subaccounts', user: user }) end |
#user_to_multi_sig_signers(user) ⇒ Hash
Get multi-sig signer mappings for a user
288 289 290 |
# File 'lib/hyperliquid/info.rb', line 288 def user_to_multi_sig_signers(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userToMultiSigSigners', user: user }) end |
#user_twap_slice_fills(user, start_time = nil, end_time = nil) ⇒ Array
Retrieve a user’s TWAP slice fills
161 162 163 164 165 166 |
# File 'lib/hyperliquid/info.rb', line 161 def user_twap_slice_fills(user, start_time = nil, end_time = nil) body = { type: 'userTwapSliceFills', user: user } body[:startTime] = start_time if start_time body[:endTime] = end_time if end_time @client.post(Constants::INFO_ENDPOINT, body) end |
#user_twap_slice_fills_by_time(user, start_time, end_time = nil, aggregate_by_time: nil) ⇒ Array
Retrieve a user’s TWAP slice fills within a time range
175 176 177 178 179 180 |
# File 'lib/hyperliquid/info.rb', line 175 def user_twap_slice_fills_by_time(user, start_time, end_time = nil, aggregate_by_time: nil) body = { type: 'userTwapSliceFillsByTime', user: user, startTime: start_time } body[:endTime] = end_time if end_time body[:aggregateByTime] = aggregate_by_time unless aggregate_by_time.nil? @client.post(Constants::INFO_ENDPOINT, body) end |
#user_vault_equities(user) ⇒ Array
Retrieve a user’s vault deposits
211 212 213 |
# File 'lib/hyperliquid/info.rb', line 211 def user_vault_equities(user) @client.post(Constants::INFO_ENDPOINT, { type: 'userVaultEquities', user: user }) end |
#validator_l1_votes ⇒ Array
Retrieve L1 governance votes cast by validators
352 353 354 |
# File 'lib/hyperliquid/info.rb', line 352 def validator_l1_votes @client.post(Constants::INFO_ENDPOINT, { type: 'validatorL1Votes' }) end |
#validator_summaries ⇒ Array
Retrieve validator performance summaries
333 334 335 |
# File 'lib/hyperliquid/info.rb', line 333 def validator_summaries @client.post(Constants::INFO_ENDPOINT, { type: 'validatorSummaries' }) end |
#vault_details(vault_address, user = nil) ⇒ Hash
Retrieve details for a vault
202 203 204 205 206 |
# File 'lib/hyperliquid/info.rb', line 202 def vault_details(vault_address, user = nil) body = { type: 'vaultDetails', vaultAddress: vault_address } body[:user] = user if user @client.post(Constants::INFO_ENDPOINT, body) end |
#vault_summaries ⇒ Array
Retrieve a list of vaults less than 2 hours old
218 219 220 |
# File 'lib/hyperliquid/info.rb', line 218 def vault_summaries @client.post(Constants::INFO_ENDPOINT, { type: 'vaultSummaries' }) end |
#vip?(user) ⇒ Boolean?
Check whether a user is a VIP
319 320 321 |
# File 'lib/hyperliquid/info.rb', line 319 def vip?(user) @client.post(Constants::INFO_ENDPOINT, { type: 'isVip', user: user }) end |
#web_data2(user) ⇒ Hash
Retrieve comprehensive user and market data in a single response
397 398 399 |
# File 'lib/hyperliquid/info.rb', line 397 def web_data2(user) @client.post(Constants::INFO_ENDPOINT, { type: 'webData2', user: user }) end |