Markets
TODO: How to access to the accounts space.
Python
market = indexer_client.markets()Get Perpetual Markets
Retrieves perpetual markets.
Method Declaration
Python
def get_perpetual_markets(self, market: str = None) -> ResponseUnification Plan
- Add alias for the return type in Rust:
PerpetualMarketsMap
Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
market | query | Ticker | false | The specific market ticker to retrieve. If not provided, all markets are returned. |
limit | query | u32 | false | Maximum number of asset positions to return in the response. |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | PerpetualMarketMap | The perpetual markets data. |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The market was not found. |
Get Perpetual Market Orderbook
Retrieves the orderbook for a specific perpetual market.
Method Declaration
Python
async def get_perpetual_market_orderbook(
self,
market: str,
) -> dictParameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
market | path | Ticker | true | The market ticker. |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | OrderBookResponseObject ⛁ | The orderbook data. |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The market was not found. |
API Example
Get Trades
Retrieves trades for a specific perpetual market.
Method Declaration
Python
async def get_perpetual_market_trades(
self,
market: str,
starting_before_or_at_height: Optional[int] = None,
limit: Optional[int] = None,
) -> dictParameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
market | path | Ticker | true | The market ticker. |
limit | query | u32 | false | The maximum number of trades to retrieve. |
startingBeforeOrAtHeight | query | Height | false | The block height to start retrieving trades from. |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | TradeResponseObject ⛁ | The trades data. |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The market was not found. |
API Example
Get Candles
Retrieves candle data for a specific perpetual market.
Method Declaration
Python
async def get_perpetual_market_candles(
self,
market: str,
resolution: str,
from_iso: Optional[str] = None,
to_iso: Optional[str] = None,
limit: Optional[int] = None,
) -> dictParameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
market | path | Ticker | true | The market ticker. |
resolution | query | CandleResolution | true | The candle resolution (e.g., "1DAY", "1HOUR", "1MIN"). |
limit | query | u32 | false | The maximum number of candles to retrieve. |
fromISO | query | DateTime | false | The start timestamp in ISO format. |
toISO | query | DateTime | false | The end timestamp in ISO format. |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | CandleResponseObject ⛁ | The candle data. |
400 | Bad Request | The request was malformed or invalid. |
API Example
Get Historical Funding
Retrieves historical funding rates for a specific perpetual market.
Method Declaration
Python
async def get_perpetual_market_historical_funding(
self,
market: str,
effective_before_or_at: Optional[str] = None,
effective_before_or_at_height: Optional[int] = None,
limit: Optional[int] = None,
) -> dictParameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
market | path | Ticker | true | The market ticker. |
limit | query | u32 | false | The maximum number of funding rates to retrieve. |
effectiveBeforeOrAt | query | DateTime | false | The timestamp to retrieve funding rates effective before or at. |
effectiveBeforeOrAtHeight | query | Height | false | The block height to retrieve funding rates effective before or at. |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | HistoricalFundingResponseObject ⛁ | The historical funding rates data. |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The market was not found. |
API Example
Get Sparklines
Retrieves sparkline data for perpetual markets.
Method Declaration
Python
async def get_perpetual_market_sparklines(
self,
period: str = TimePeriod.ONE_DAY
) -> dictParameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
timePeriod | query | SparklineTimePeriod | true | The time period for the sparkline data (e.g., "ONE_DAY", "SEVEN_DAYS"). |
Response
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | SparklineResponseObject ⛁ | The sparkline data. |
400 | Bad Request | The request was malformed or invalid. |