Indexer Data
Grouped HTTP indexer data endpoints.
IndexerData
dataclass
Bases: GetAssetPositions, GetCandlesPaged, GetComplianceScreen, GetFillsPaged, GetFundingPaymentsPaged, GetFundingPaymentsForParentSubaccount, GetHeight, GetHistoricalFundingPaged, GetHistoricalPnl, GetMarket, GetMegavaultHistoricalPnl, GetOrder, GetOrderBook, GetParentAssetPositions, GetParentFills, GetParentHistoricalPnl, GetParentSubaccount, GetParentTransfers, GetRewards, GetRewardsAggregated, GetScreen, GetSparklines, GetSubaccount, GetSubaccounts, GetTime, GetTrades, GetTransfersPaged, GetTransfersBetween, GetVaultsHistoricalPnl, ListOrders, ListParentOrders, ListParentPositions, GetOpenPosition
HTTP indexer data endpoint group.
Source code in pkg/src/dydx/indexer/data/__init__.py
dYdX indexer get asset positions types and endpoint.
AssetPosition
GetAssetPositions
dataclass
Bases: IndexerMixin
Endpoint mixin for asset_positions.
Source code in pkg/src/dydx/indexer/data/get_asset_positions.py
get_asset_positions(address, *, subaccount, status=None, limit=None, created_before_or_at_height=None, created_before_or_at=None, validate=None)
async
Get asset positions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
subaccount
|
int
|
Subaccount number. |
required |
status
|
Literal['OPEN', 'CLOSED', 'LIQUIDATED'] | None
|
Position status filter. |
None
|
limit
|
int | None
|
Maximum number of results to return. |
None
|
created_before_or_at_height
|
int | None
|
Restrict results to entries created at or before a specific block height. |
None
|
created_before_or_at
|
datetime | None
|
Restrict results to entries created at or before a specific timestamp. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[AssetPosition]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_asset_positions.py
dYdX indexer get candles types and endpoint.
Candle
Bases: TypedDict
Candle payload.
Source code in pkg/src/dydx/indexer/data/get_candles.py
CandlesResponse
GetCandles
dataclass
Bases: IndexerMixin
Endpoint mixin for candles.
Source code in pkg/src/dydx/indexer/data/get_candles.py
get_candles(market, *, resolution, from_iso=None, to_iso=None, limit=None, validate=None)
async
Fetch candles for a perpetual market.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str
|
Perpetual market ticker. |
required |
resolution
|
Literal['1MIN', '5MINS', '15MINS', '30MINS', '1HOUR', '4HOURS', '1DAY']
|
Candle resolution. |
required |
from_iso
|
datetime | None
|
Start timestamp in ISO 8601 format. |
None
|
to_iso
|
datetime | None
|
End timestamp in ISO 8601 format. |
None
|
limit
|
int | None
|
Maximum number of candles to return. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
CandlesResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_candles.py
GetCandlesPaged
dataclass
Bases: GetCandles
Endpoint mixin for candles_paged.
Source code in pkg/src/dydx/indexer/data/get_candles.py
get_candles_paged(market, resolution, *, start=None, end=None, limit=None)
async
Page through candles for a perpetual market.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str
|
The market ticker (e.g. |
required |
resolution
|
Resolution
|
The resolution of the candles. |
required |
start
|
datetime | None
|
If given, fetches candles starting from the given timestamp. |
None
|
end
|
datetime | None
|
If given, fetches candles up to and including the given timestamp. |
None
|
limit
|
int | None
|
The max. number of candles to retrieve per request (default: 1000, max: 1000). |
None
|
Returns:
| Type | Description |
|---|---|
AsyncIterable[Sequence[Candle]]
|
An async iterable of candle pages. Each request advances by the last candle timestamp until an empty page is returned. |
Source code in pkg/src/dydx/indexer/data/get_candles.py
dYdX indexer get compliance screen types and endpoint.
ComplianceV2Response
Bases: TypedDict
Compliance v2 response payload.
Source code in pkg/src/dydx/indexer/data/get_compliance_screen.py
GetComplianceScreen
dataclass
Bases: IndexerMixin
Endpoint mixin for compliance_screen.
Source code in pkg/src/dydx/indexer/data/get_compliance_screen.py
get_compliance_screen(address, validate=None)
async
Get compliance screen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
EVM or dYdX address. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
ComplianceV2Response
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_compliance_screen.py
dYdX indexer get markets types and endpoint.
GetMarkets
dataclass
Bases: IndexerMixin
Endpoint mixin for markets.
Source code in pkg/src/dydx/indexer/data/get_markets.py
get_markets(*, market=None, limit=None, validate=None)
async
Fetch perpetual market metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str | None
|
Specific market ticker to retrieve, for example |
None
|
limit
|
int | None
|
Maximum number of market entries to return. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
GetMarketsResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_markets.py
dYdX indexer get market types and endpoint.
GetMarket
dataclass
Bases: GetMarkets
Endpoint mixin for market.
Source code in pkg/src/dydx/indexer/data/get_market.py
get_market(market, *, validate=None)
async
Fetch one perpetual market by ticker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str
|
Market ticker. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
PerpetualMarket
|
The validated indexer response payload. |
Source code in pkg/src/dydx/indexer/data/get_market.py
dYdX indexer get fills types and endpoint.
Fill
Bases: TypedDict
Fill payload.
Source code in pkg/src/dydx/indexer/data/get_fills.py
FillsResponse
GetFills
dataclass
Bases: IndexerMixin
Endpoint mixin for fills.
Source code in pkg/src/dydx/indexer/data/get_fills.py
get_fills(address, *, subaccount, market=None, market_type=None, created_before_or_at_height=None, created_before_or_at=None, limit=None, page=None, validate=None)
async
Fetch fills for a subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the subaccount. |
required |
subaccount
|
int
|
Subaccount number. |
required |
market
|
str | None
|
Market ticker filter. |
None
|
market_type
|
Literal['PERPETUAL', 'SPOT'] | None
|
Market type filter. |
None
|
created_before_or_at_height
|
int | None
|
Latest block height to include. |
None
|
created_before_or_at
|
datetime | None
|
Latest timestamp to include. |
None
|
limit
|
int | None
|
Maximum number of fills to return. |
None
|
page
|
int | None
|
Page number for paginated results. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
FillsResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_fills.py
GetFillsPaged
dataclass
Bases: GetFills
Endpoint mixin for fills_paged.
Source code in pkg/src/dydx/indexer/data/get_fills.py
get_fills_paged(address, *, subaccount, market=None, market_type=None, created_before_or_at_height=None, created_before_or_at=None, limit=None, validate=None)
Page through fills for a subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
The wallet address that owns the account. |
required |
subaccount
|
int
|
The identifier for the specific subaccount within the wallet address. |
required |
market
|
str | None
|
The market name (e.g. |
None
|
market_type
|
MarketType | None
|
The market type ( |
None
|
created_before_or_at_height
|
int | None
|
If given, fetches fills up to and including the given block height. |
None
|
created_before_or_at
|
datetime | None
|
If given, fetches fills up to and including the given timestamp. |
None
|
limit
|
int | None
|
The max. number of fills to retrieve (default: 1000, max: 1000). |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
PaginatedResponse[Fill, int]
|
A paginated response. Each request advances by page number until the endpoint returns no items. |
References
Source code in pkg/src/dydx/indexer/data/get_fills.py
dYdX indexer get funding payments types and endpoint.
FundingPayment
Bases: TypedDict
FundingPayment payload.
Source code in pkg/src/dydx/indexer/data/get_funding_payments.py
FundingPaymentsResponse
GetFundingPayments
dataclass
Bases: IndexerMixin
Endpoint mixin for funding_payments.
Source code in pkg/src/dydx/indexer/data/get_funding_payments.py
get_funding_payments(address, *, subaccount, ticker=None, after_or_at=None, limit=None, page=None, validate=None)
async
Fetch funding payments for a subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the subaccount. |
required |
subaccount
|
int
|
Subaccount number. |
required |
ticker
|
str | None
|
Market ticker filter. |
None
|
after_or_at
|
datetime | None
|
Earliest timestamp to include. |
None
|
limit
|
int | None
|
Maximum number of funding payments to return. |
None
|
page
|
int | None
|
Page number for paginated results. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
FundingPaymentsResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_funding_payments.py
GetFundingPaymentsPaged
dataclass
Bases: GetFundingPayments
Endpoint mixin for funding_payments_paged.
Source code in pkg/src/dydx/indexer/data/get_funding_payments.py
get_funding_payments_paged(address, *, subaccount, ticker=None, after_or_at=None, limit=None, validate=None)
Page through funding payments for a subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
The wallet address that owns the account. |
required |
subaccount
|
int
|
The identifier for the specific subaccount within the wallet address. |
required |
ticker
|
str | None
|
The market ticker (e.g. |
None
|
after_or_at
|
datetime | None
|
If given, fetches funding payments starting from the given timestamp. |
None
|
limit
|
int | None
|
The max. number of funding payments to retrieve. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
PaginatedResponse[FundingPayment, int]
|
A paginated response. Each request advances by page number until the endpoint returns no items. |
References
Source code in pkg/src/dydx/indexer/data/get_funding_payments.py
dYdX indexer get funding payments for parent subaccount types and endpoint.
FundingPayment
Bases: TypedDict
FundingPayment payload.
Source code in pkg/src/dydx/indexer/data/get_funding_payments_for_parent_subaccount.py
FundingPaymentsResponse
GetFundingPaymentsForParentSubaccount
dataclass
Bases: IndexerMixin
Endpoint mixin for funding_payments_for_parent_subaccount.
Source code in pkg/src/dydx/indexer/data/get_funding_payments_for_parent_subaccount.py
get_funding_payments_for_parent_subaccount(address, *, parent_subaccount, limit=None, after_or_at=None, page=None, validate=None)
async
Get funding payments for parent subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
after_or_at
|
datetime | None
|
Only include payments created at or after this timestamp. |
None
|
page
|
int | None
|
Page number for paginated results. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
FundingPaymentsResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_funding_payments_for_parent_subaccount.py
dYdX indexer get height types and endpoint.
GetHeight
dataclass
Bases: IndexerMixin
Endpoint mixin for height.
Source code in pkg/src/dydx/indexer/data/get_height.py
get_height(validate=None)
async
Fetch the latest indexer block height.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
HeightResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_height.py
dYdX indexer get historical funding types and endpoint.
Funding
GetHistoricalFunding
dataclass
Bases: IndexerMixin
Endpoint mixin for historical_funding.
Source code in pkg/src/dydx/indexer/data/get_historical_funding.py
get_historical_funding(market, *, effective_before_or_at=None, effective_before_or_at_height=None, limit=None, validate=None)
async
Fetch historical funding rates for a market.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str
|
Perpetual market ticker. |
required |
effective_before_or_at
|
datetime | None
|
Latest effective timestamp to include. |
None
|
effective_before_or_at_height
|
int | None
|
Latest effective block height to include. |
None
|
limit
|
int | None
|
Maximum number of funding entries to return. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
HistoricalFundingResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_historical_funding.py
GetHistoricalFundingPaged
dataclass
Bases: GetHistoricalFunding
Endpoint mixin for historical_funding_paged.
Source code in pkg/src/dydx/indexer/data/get_historical_funding.py
get_historical_funding_paged(market, *, effective_before_or_at=None, effective_before_or_at_height=None, limit=None)
Page through historical funding rates for a market.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str
|
The market ticker (e.g. |
required |
effective_before_or_at
|
datetime | None
|
If given, fetches funding rates up to and including the given timestamp. |
None
|
effective_before_or_at_height
|
int | None
|
If given, fetches funding rates up to and including the given block height. |
None
|
limit
|
int | None
|
The max. number of candles to retrieve (default: 1000, max: 1000). |
None
|
Returns:
| Type | Description |
|---|---|
PaginatedResponse[Funding, int]
|
A paginated response. Each request advances by the last returned funding block height until no newer page is available. |
Source code in pkg/src/dydx/indexer/data/get_historical_funding.py
dYdX indexer get historical pnl types and endpoint.
GetHistoricalPnl
dataclass
Bases: IndexerMixin
Endpoint mixin for historical_pnl.
Source code in pkg/src/dydx/indexer/data/get_historical_pnl.py
get_historical_pnl(address, *, subaccount, limit=None, created_before_or_at_height=None, created_before_or_at=None, created_on_or_after_height=None, created_on_or_after=None, page=None, validate=None)
async
Get historical pnl.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
subaccount
|
int
|
Subaccount number. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
created_before_or_at_height
|
int | None
|
Restrict results to entries created at or before a specific block height. |
None
|
created_before_or_at
|
datetime | None
|
Restrict results to entries created at or before a specific timestamp. |
None
|
created_on_or_after_height
|
int | None
|
Restrict results to entries created on or after a specific block height. |
None
|
created_on_or_after
|
datetime | None
|
Restrict results to entries created on or after a specific timestamp. |
None
|
page
|
int | None
|
Page number for paginated results. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[PnlTick]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_historical_pnl.py
dYdX indexer get megavault historical pnl types and endpoint.
GetMegavaultHistoricalPnl
dataclass
Bases: IndexerMixin
Endpoint mixin for megavault_historical_pnl.
Source code in pkg/src/dydx/indexer/data/get_megavault_historical_pnl.py
get_megavault_historical_pnl(*, resolution, validate=None)
async
Get megavault historical pnl.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resolution
|
Literal['hour', 'day']
|
PnL tick resolution. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[PnlTick]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_megavault_historical_pnl.py
dYdX indexer get open position types and endpoint.
GetOpenPosition
dataclass
Bases: ListPositions
Endpoint mixin for open_position.
Source code in pkg/src/dydx/indexer/data/get_open_position.py
get_open_position(address, market, *, subaccount, validate=None)
async
Fetch one open perpetual position for a subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address. |
required |
market
|
str
|
Market ticker. |
required |
subaccount
|
int
|
Subaccount number. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
PerpetualPosition | None
|
The validated indexer response payload. |
Source code in pkg/src/dydx/indexer/data/get_open_position.py
dYdX indexer get order types and endpoint.
GetOrder
dataclass
Bases: IndexerMixin
Endpoint mixin for order.
Source code in pkg/src/dydx/indexer/data/get_order.py
get_order(order_id, validate=None)
async
Get order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_id
|
str
|
Order id. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
Order
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_order.py
Order
Bases: TypedDict
Order payload.
Source code in pkg/src/dydx/indexer/data/get_order.py
dYdX indexer get order book types and endpoint.
BookEntry
GetOrderBook
dataclass
Bases: IndexerMixin
Endpoint mixin for order_book.
Source code in pkg/src/dydx/indexer/data/get_order_book.py
get_order_book(market, validate=None)
async
Get order book.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str
|
Perpetual market ticker. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
OrderBook
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_order_book.py
dYdX indexer get parent asset positions types and endpoint.
AssetPosition
GetParentAssetPositions
dataclass
Bases: IndexerMixin
Endpoint mixin for parent_asset_positions.
Source code in pkg/src/dydx/indexer/data/get_parent_asset_positions.py
get_parent_asset_positions(address, *, parent_subaccount, validate=None)
async
Get parent asset positions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[AssetPosition]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_parent_asset_positions.py
dYdX indexer get parent fills types and endpoint.
Fill
Bases: TypedDict
Fill payload.
Source code in pkg/src/dydx/indexer/data/get_parent_fills.py
FillsResponse
GetParentFills
dataclass
Bases: IndexerMixin
Endpoint mixin for parent_fills.
Source code in pkg/src/dydx/indexer/data/get_parent_fills.py
get_parent_fills(address, *, parent_subaccount, limit=None, created_before_or_at_height=None, created_before_or_at=None, market=None, market_type=None, validate=None)
async
Get parent fills.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
created_before_or_at_height
|
int | None
|
Restrict results to entries created at or before a specific block height. |
None
|
created_before_or_at
|
datetime | None
|
Latest timestamp to include. |
None
|
market
|
str | None
|
Ticker filter. |
None
|
market_type
|
Literal['PERPETUAL', 'SPOT'] | None
|
Market type filter. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
FillsResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_parent_fills.py
dYdX indexer get parent historical pnl types and endpoint.
GetParentHistoricalPnl
dataclass
Bases: IndexerMixin
Endpoint mixin for parent_historical_pnl.
Source code in pkg/src/dydx/indexer/data/get_parent_historical_pnl.py
get_parent_historical_pnl(address, *, parent_subaccount, limit=None, created_before_or_at_height=None, created_before_or_at=None, created_on_or_after_height=None, created_on_or_after=None, validate=None)
async
Get parent historical pnl.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
created_before_or_at_height
|
int | None
|
Restrict results to entries created at or before a specific block height. |
None
|
created_before_or_at
|
datetime | None
|
Restrict results to entries created at or before a specific timestamp. |
None
|
created_on_or_after_height
|
int | None
|
Restrict results to entries created on or after a specific block height. |
None
|
created_on_or_after
|
datetime | None
|
Restrict results to entries created on or after a specific timestamp. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[PnlTick]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_parent_historical_pnl.py
dYdX indexer get parent subaccount types and endpoint.
AssetPosition
GetParentSubaccount
dataclass
Bases: IndexerMixin
Endpoint mixin for parent_subaccount.
Source code in pkg/src/dydx/indexer/data/get_parent_subaccount.py
get_parent_subaccount(address, parent_subaccount, validate=None)
async
Get parent subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the parent subaccount. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
ParentSubaccount
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_parent_subaccount.py
ParentSubaccount
Bases: TypedDict
ParentSubaccount payload.
Source code in pkg/src/dydx/indexer/data/get_parent_subaccount.py
PerpetualPosition
Bases: TypedDict
PerpetualPosition payload.
Source code in pkg/src/dydx/indexer/data/get_parent_subaccount.py
Subaccount
Bases: TypedDict
Subaccount payload.
Source code in pkg/src/dydx/indexer/data/get_parent_subaccount.py
dYdX indexer get parent transfers types and endpoint.
Account
GetParentTransfers
dataclass
Bases: IndexerMixin
Endpoint mixin for parent_transfers.
Source code in pkg/src/dydx/indexer/data/get_parent_transfers.py
get_parent_transfers(address, *, parent_subaccount, limit=None, created_before_or_at_height=None, created_before_or_at=None, validate=None)
async
Get parent transfers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
created_before_or_at_height
|
int | None
|
Restrict results to entries created at or before a specific block height. |
None
|
created_before_or_at
|
datetime | None
|
Restrict results to entries created at or before a specific timestamp. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
TransfersResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_parent_transfers.py
Transfer
Bases: TypedDict
Transfer payload.
Source code in pkg/src/dydx/indexer/data/get_parent_transfers.py
dYdX indexer get rewards types and endpoint.
GetRewards
dataclass
Bases: IndexerMixin
Endpoint mixin for rewards.
Source code in pkg/src/dydx/indexer/data/get_rewards.py
get_rewards(address, *, limit=None, starting_before_or_at_height=None, starting_before_or_at=None, validate=None)
async
Get rewards.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
starting_before_or_at_height
|
int | None
|
Only include rewards starting at or before this block height. |
None
|
starting_before_or_at
|
datetime | None
|
Only include rewards starting at or before this timestamp. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[HistoricalBlockTradingReward]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_rewards.py
HistoricalBlockTradingReward
dYdX indexer get rewards aggregated types and endpoint.
GetRewardsAggregated
dataclass
Bases: IndexerMixin
Endpoint mixin for rewards_aggregated.
Source code in pkg/src/dydx/indexer/data/get_rewards_aggregated.py
get_rewards_aggregated(address, *, period, limit=None, starting_before_or_at=None, starting_before_or_at_height=None, validate=None)
async
Get rewards aggregated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
period
|
Literal['DAILY', 'WEEKLY', 'MONTHLY']
|
Aggregation period. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
starting_before_or_at
|
datetime | None
|
Only include aggregations starting at or before this timestamp. |
None
|
starting_before_or_at_height
|
int | None
|
Only include aggregations starting at or before this block height. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[HistoricalTradingRewardAggregation]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_rewards_aggregated.py
HistoricalTradingRewardAggregation
Bases: TypedDict
HistoricalTradingRewardAggregation payload.
Source code in pkg/src/dydx/indexer/data/get_rewards_aggregated.py
dYdX indexer get screen types and endpoint.
ComplianceResponse
GetScreen
dataclass
Bases: IndexerMixin
Endpoint mixin for screen.
Source code in pkg/src/dydx/indexer/data/get_screen.py
get_screen(address, *, validate=None)
async
Get screen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address to screen. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
ComplianceResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_screen.py
dYdX indexer get sparklines types and endpoint.
GetSparklines
dataclass
Bases: IndexerMixin
Endpoint mixin for sparklines.
Source code in pkg/src/dydx/indexer/data/get_sparklines.py
get_sparklines(*, time_period, validate=None)
async
Get sparklines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
time_period
|
Literal['OneDay', 'SevenDays']
|
Sparkline time period. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
Sparkline
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_sparklines.py
dYdX indexer get subaccount types and endpoint.
AssetPosition
GetSubaccount
dataclass
Bases: IndexerMixin
Endpoint mixin for subaccount.
Source code in pkg/src/dydx/indexer/data/get_subaccount.py
get_subaccount(address, subaccount, validate=None)
async
Get subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Account address. |
required |
subaccount
|
int
|
Subaccount number. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
GetSubaccountResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_subaccount.py
GetSubaccountResponse
PerpetualPosition
Bases: TypedDict
PerpetualPosition payload.
Source code in pkg/src/dydx/indexer/data/get_subaccount.py
Subaccount
Bases: TypedDict
Subaccount payload.
Source code in pkg/src/dydx/indexer/data/get_subaccount.py
dYdX indexer get subaccounts types and endpoint.
AddressResponse
AssetPosition
GetSubaccounts
dataclass
Bases: IndexerMixin
Endpoint mixin for subaccounts.
Source code in pkg/src/dydx/indexer/data/get_subaccounts.py
get_subaccounts(address, *, limit=None, validate=None)
async
Get subaccounts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Account address. |
required |
limit
|
int | None
|
Maximum number of subaccounts to return. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
AddressResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_subaccounts.py
PerpetualPosition
Bases: TypedDict
PerpetualPosition payload.
Source code in pkg/src/dydx/indexer/data/get_subaccounts.py
Subaccount
Bases: TypedDict
Subaccount payload.
Source code in pkg/src/dydx/indexer/data/get_subaccounts.py
dYdX indexer get time types and endpoint.
GetTime
dataclass
Bases: IndexerMixin
Endpoint mixin for time.
Source code in pkg/src/dydx/indexer/data/get_time.py
get_time(validate=None)
async
Fetch the indexer server time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
TimeResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_time.py
dYdX indexer get trades types and endpoint.
GetTrades
dataclass
Bases: IndexerMixin
Endpoint mixin for trades.
Source code in pkg/src/dydx/indexer/data/get_trades.py
get_trades(market, *, starting_before_or_at_height=None, limit=None, validate=None)
async
Get trades.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market
|
str
|
Perpetual market ticker. |
required |
starting_before_or_at_height
|
int | None
|
Latest block height to include. |
None
|
limit
|
int | None
|
Maximum number of trades to return. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
TradesResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_trades.py
Trade
Bases: TypedDict
Trade payload.
Source code in pkg/src/dydx/indexer/data/get_trades.py
dYdX indexer get transfers types and endpoint.
Account
GetTransfers
dataclass
Bases: IndexerMixin
Endpoint mixin for transfers.
Source code in pkg/src/dydx/indexer/data/get_transfers.py
get_transfers(address, *, subaccount, created_before_or_at_height=None, created_before_or_at=None, limit=None, page=None, validate=None)
async
Fetch transfers for a subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the subaccount. |
required |
subaccount
|
int
|
Subaccount number. |
required |
created_before_or_at_height
|
int | None
|
Latest block height to include. |
None
|
created_before_or_at
|
datetime | None
|
Latest timestamp to include. |
None
|
limit
|
int | None
|
Maximum number of transfers to return. |
None
|
page
|
int | None
|
Page number for paginated results. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
TransfersResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_transfers.py
GetTransfersPaged
dataclass
Bases: GetTransfers
Endpoint mixin for transfers_paged.
Source code in pkg/src/dydx/indexer/data/get_transfers.py
get_transfers_paged(address, *, subaccount, created_before_or_at_height=None, created_before_or_at=None, limit=None, validate=None)
Page through transfers for a subaccount.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
The wallet address that owns the account. |
required |
subaccount
|
int
|
The identifier for the specific subaccount within the wallet address. |
required |
created_before_or_at_height
|
int | None
|
If given, fetches transfers up to and including the given block height. |
None
|
created_before_or_at
|
datetime | None
|
If given, fetches transfers up to and including the given timestamp. |
None
|
limit
|
int | None
|
The max. number of transfers to retrieve (default: 1000, max: 1000). |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
PaginatedResponse[Transfer, int]
|
A paginated response. Each request advances by page number until the endpoint returns no items. |
References
Source code in pkg/src/dydx/indexer/data/get_transfers.py
Transfer
Bases: TypedDict
Transfer payload.
Source code in pkg/src/dydx/indexer/data/get_transfers.py
dYdX indexer get transfers between types and endpoint.
Account
GetTransfersBetween
dataclass
Bases: IndexerMixin
Endpoint mixin for transfers_between.
Source code in pkg/src/dydx/indexer/data/get_transfers_between.py
get_transfers_between(source_address, *, source_subaccount, recipient_address, recipient_subaccount, created_before_or_at_height=None, created_before_or_at=None, validate=None)
async
Get transfers between.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source_address
|
str
|
Sender wallet address. |
required |
source_subaccount
|
str
|
Sender subaccount number. |
required |
recipient_address
|
str
|
Recipient wallet address. |
required |
recipient_subaccount
|
str
|
Recipient subaccount number. |
required |
created_before_or_at_height
|
int | None
|
Restrict results to entries created at or before a specific block height. |
None
|
created_before_or_at
|
datetime | None
|
Restrict results to entries created at or before a specific timestamp. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
TransfersResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_transfers_between.py
Transfer
Bases: TypedDict
Transfer payload.
Source code in pkg/src/dydx/indexer/data/get_transfers_between.py
dYdX indexer get vaults historical pnl types and endpoint.
GetVaultsHistoricalPnl
dataclass
Bases: IndexerMixin
Endpoint mixin for vaults_historical_pnl.
Source code in pkg/src/dydx/indexer/data/get_vaults_historical_pnl.py
get_vaults_historical_pnl(*, resolution, validate=None)
async
Get vaults historical pnl.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resolution
|
Literal['hour', 'day']
|
PnL tick resolution. |
required |
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[VaultHistoricalPnl]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/get_vaults_historical_pnl.py
PnlTick
dYdX indexer list orders types and endpoint.
ListOrders
dataclass
Bases: IndexerMixin
Endpoint mixin for ListOrders.
Source code in pkg/src/dydx/indexer/data/list_orders.py
list_orders(address, *, subaccount, limit=None, ticker=None, side=None, status=None, type=None, good_til_block_before_or_at=None, good_til_block_time_before_or_at=None, return_latest_orders=None, validate=None)
async
List orders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the subaccount. |
required |
subaccount
|
int
|
Subaccount number. |
required |
limit
|
int | None
|
Maximum number of orders to return. |
None
|
ticker
|
str | None
|
Ticker filter. |
None
|
side
|
Literal['BUY', 'SELL'] | None
|
Order side filter. |
None
|
status
|
Literal['OPEN', 'FILLED', 'CANCELED', 'BEST_EFFORT_CANCELED', 'UNTRIGGERED', 'BEST_EFFORT_OPENED', 'PENDING'] | None
|
Order status filter. |
None
|
type
|
Literal['LIMIT', 'MARKET', 'STOP_LIMIT', 'STOP_MARKET', 'TRAILING_STOP', 'TAKE_PROFIT', 'TAKE_PROFIT_MARKET', 'HARD_TRADE', 'FAILED_HARD_TRADE', 'TRANSFER_PLACEHOLDER'] | None
|
Order type filter. |
None
|
good_til_block_before_or_at
|
int | None
|
Latest good-til-block to include. |
None
|
good_til_block_time_before_or_at
|
datetime | None
|
Latest good-til-block time to include. |
None
|
return_latest_orders
|
bool | None
|
Whether to return only the latest orders. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[Order]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/list_orders.py
Order
Bases: TypedDict
Order payload.
Source code in pkg/src/dydx/indexer/data/list_orders.py
dYdX indexer list parent orders types and endpoint.
ListParentOrders
dataclass
Bases: IndexerMixin
Endpoint mixin for ListParentOrders.
Source code in pkg/src/dydx/indexer/data/list_parent_orders.py
list_parent_orders(address, *, parent_subaccount, limit=None, ticker=None, side=None, status=None, type=None, good_til_block_before_or_at=None, good_til_block_time_before_or_at=None, return_latest_orders=None, validate=None)
async
List parent orders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
ticker
|
str | None
|
Ticker filter. |
None
|
side
|
Literal['BUY', 'SELL'] | None
|
Order side filter. |
None
|
status
|
Literal['OPEN', 'FILLED', 'CANCELED', 'BEST_EFFORT_CANCELED', 'UNTRIGGERED', 'BEST_EFFORT_OPENED', 'PENDING'] | None
|
Order status filter. |
None
|
type
|
Literal['LIMIT', 'MARKET', 'STOP_LIMIT', 'STOP_MARKET', 'TRAILING_STOP', 'TAKE_PROFIT', 'TAKE_PROFIT_MARKET', 'HARD_TRADE', 'FAILED_HARD_TRADE', 'TRANSFER_PLACEHOLDER'] | None
|
Order type filter. |
None
|
good_til_block_before_or_at
|
int | None
|
Latest good-til-block to include. |
None
|
good_til_block_time_before_or_at
|
datetime | None
|
Latest good-til-block time to include. |
None
|
return_latest_orders
|
bool | None
|
Whether to return only the latest orders. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[Order]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/list_parent_orders.py
Order
Bases: TypedDict
Order payload.
Source code in pkg/src/dydx/indexer/data/list_parent_orders.py
dYdX indexer list parent positions types and endpoint.
ListParentPositions
dataclass
Bases: IndexerMixin
Endpoint mixin for ListParentPositions.
Source code in pkg/src/dydx/indexer/data/list_parent_positions.py
list_parent_positions(address, *, parent_subaccount, limit=None, validate=None)
async
List parent positions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the account. |
required |
parent_subaccount
|
int
|
Parent subaccount number. |
required |
limit
|
int | None
|
Maximum number of results to return. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
list[PerpetualPosition]
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/list_parent_positions.py
PerpetualPosition
Bases: TypedDict
PerpetualPosition payload.
Source code in pkg/src/dydx/indexer/data/list_parent_positions.py
dYdX indexer list positions types and endpoint.
ListPositions
dataclass
Bases: IndexerMixin
Endpoint mixin for ListPositions.
Source code in pkg/src/dydx/indexer/data/list_positions.py
list_positions(address, *, subaccount, status=None, limit=None, created_before_or_at_height=None, created_before_or_at=None, validate=None)
async
List positions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
address
|
str
|
Wallet address that owns the subaccount. |
required |
subaccount
|
int
|
Subaccount number. |
required |
status
|
Literal['OPEN', 'CLOSED', 'LIQUIDATED'] | None
|
Position status filter. |
None
|
limit
|
int | None
|
Maximum number of positions to return. |
None
|
created_before_or_at_height
|
int | None
|
Latest block height to include. |
None
|
created_before_or_at
|
datetime | None
|
Latest timestamp to include. |
None
|
validate
|
bool | None
|
Override the client response validation default for this call. |
None
|
Returns:
| Type | Description |
|---|---|
PositionsResponse
|
The validated indexer response payload. |
References
Source code in pkg/src/dydx/indexer/data/list_positions.py
PerpetualPosition
Bases: TypedDict
PerpetualPosition payload.