Reader Contract

The Reader contract provides read-only functions to query protocol state, market data, and position information.

Overview

Reader is used for:

  • Querying market information

  • Getting position details

  • Calculating prices and fees

  • Retrieving account data

  • Simulating deposits and withdrawals

Functions

Market Data

getMarket

Get market configuration.

function getMarket(
    DataStore dataStore,
    address key
) external view returns (Market.Props);

getMarketBySalt

Get market by salt.

getMarketInfo

Get detailed market information.

getMarketInfoList

Get market information for multiple markets.

getMarkets

Get all markets.

getMarketTokenPrice

Get current HM token price.

Position Data

getAccountPositionInfoList

Get position information for all positions of an account.

getAccountPositions

Get all positions for an account.

getPosition

Get position details.

getPositionInfo

Get detailed position information including fees.

getPositionInfoList

Get position information for multiple positions.

getPositionPnlUsd

Get position PnL in USD.

isPositionLiquidatable

Check if a position can be liquidated.

Order Data

getAccountOrders

Get all orders for an account.

getOrder

Get order details.

Deposit & Withdrawal Data

getDeposit

Get deposit details.

getShift

Get shift details.

getWithdrawal

Get withdrawal details.

Simulation Functions

getDepositAmountOut

Simulate deposit and get expected HM tokens out.

getExecutionPrice

Get execution price for a position change.

getSwapAmountOut

Simulate swap and get expected output.

getWithdrawalAmountOut

Simulate withdrawal and get expected tokens out.

PnL & Analytics

getNetPnl

Get net PnL for a market.

getOpenInterestWithPnl

Get open interest with PnL.

getPnl

Get PnL for a specific side.

getPnlToPoolFactor

Get PnL to pool factor.

Price Impact

getSwapPriceImpact

Calculate swap price impact.

ADL State

getAdlState

Get ADL (Auto-Deleveraging) state.

Utility

getPendingPositionImpactPoolDistributionAmount

Get pending position impact pool distribution.


Notes

circle-info

This documentation was auto-generated from the contract ABI.

Last updated