Skip to content

Types¤

hl.types ¤

Classes:

Name Description
ActiveAssetCtxMsg

A message from the exchange containing active perpetual asset context. Response to an ActiveAssetCtxSubscription .

ActiveAssetCtxSubscription

Subscribe to active asset context.

ActiveAssetData

The payload of a message from the exchange containing active asset data. Response to an :obj:ActiveAssetDataSubscription.

ActiveAssetDataMsg

A message from the exchange containing active asset data. Response to an :obj:ActiveAssetDataSubscription.

ActiveAssetDataSubscription

Subscribe to active asset data.

ActiveSpotAssetCtxMsg

A message from the exchange containing active spot asset context. Response to an :obj:ActiveAssetCtxSubscription.

AgentData

Data for an agent.

AgentUserRoleResponse

A response to a user role request for an agent.

AllMidsData

The payload of a message from the exchange containing all mids.

AllMidsMsg

A message from the exchange containing all mids. Response to an :obj:AllMidsSubscription.

AllMidsRequest

A request to retrieve all mids for all actively traded coins.

AllMidsSubscription

Subscribe to all mids.

ApproveAgentAction

An action to approve an agent.

ApproveAgentRequest

A request to approve an agent.

ApproveAgentResponse

A response from the exchange after approving an agent.

ApproveAgentResponseBody

The body of a response from the exchange after approving an agent.

ApproveBuilderFeeAction

An action to approve a builder fee.

ApproveBuilderFeeRequest

A request to approve a builder fee.

ApproveBuilderFeeResponse

A response from the exchange after approving a builder fee.

ApproveBuilderFeeResponseBody

The body of a response from the exchange after approving a builder fee.

AssetCtx

Additional context for a perpetual asset.

AssetCtxData

The payload of a message from the exchange containing active asset context. Response to an :obj:ActiveAssetCtxSubscription.

AssetInfo

Information about an asset.

AssetMeta

Perpetual asset metadata.

AssetPosition

A user's position in a perpetual asset.

BatchModifyAction

An action to modify multiple orders.

BatchModifyRequest

A request to modify multiple orders.

BatchModifyResponse

A response from the exchange after modifying multiple orders.

BatchModifyResponseResponse

The response from the exchange after modifying multiple orders.

BestBidOfferData

The payload of a message from the exchange containing best bid offer data. Response to an :obj:BestBidOfferSubscription.

BestBidOfferMsg

A message from the exchange containing best bid offer data. Response to an :obj:BestBidOfferSubscription.

BestBidOfferSubscription

Subscribe to best bid offer data.

BuilderOptions

Options for a builder.

Cancel

A request to cancel an order by its oid.

CancelAction

An action to cancel one or more orders by their oid.

CancelByCloid

A request to cancel an order by its cloid.

CancelByCloidAction

An action to cancel one or more orders by their cloid.

CancelByCloidParams

Parameters for a request to cancel an order by its cloid.

CancelByCloidRequest

A request to cancel one or more orders by their cloid.

CancelByCloidResponse

A response from the exchange after cancelling an order by its cloid.

CancelParams

Parameters for a request to cancel an order by its oid.

CancelRequest

A request to cancel one or more orders by their oid.

CancelResponse

A response from the exchange after cancelling an order by its oid.

CancelResponseData

The data of a response from the exchange after cancelling an order by its oid.

CancelResponseDataErrorStatus

The status of an order that failed to be cancelled.

CancelResponseResponse

A response from the exchange after cancelling an order by its oid.

Candle

A candle.

CandleMsg

A message from the exchange containing a candle. Response to a :obj:CandleSubscription.

CandleSnapshotRequest

A request to retrieve a candle snapshot.

CandleSnapshotRequestPayload

The specification for which candle snapshot to retrieve.

CandleSubscription

Subscribe to candles.

ConvertToMultiSigUserAction

An action to convert an address to a multi-sig address.

ConvertToMultiSigUserRequest

A request to convert an address to a multi-sig address.

ConvertToMultiSigUserResponse

A response from the exchange after converting an address to a multi-sig address.

CreateSubAccountAction

An action to create a subaccount.

CreateSubAccountRequest

A request to create a subaccount.

CreateSubAccountResponse

A response from the exchange after creating a subaccount.

CreateSubAccountResponseBody

The body of a response from the exchange after creating a subaccount.

CreateVaultAction

An action to create a vault.

CreateVaultRequest

A request to create a vault.

CreateVaultResponse

A response from the exchange after creating a vault.

CreateVaultResponseBody

The body of a response from the exchange after creating a vault.

CumFunding

The cumulative funding of a position.

DailyUserVlm

A daily user VLM.

Delegation

A delegation.

DelegationsRequest

A request to retrieve a user's delegations.

DelegatorDeltaCDeposit

A delegator delta c deposit.

DelegatorDeltaCDepositData

A delegator delta c deposit.

DelegatorDeltaDelegate

A delegator delta.

DelegatorDeltaDelegateData

A delegator delta delegate.

DelegatorDeltaWithdrawal

A delegator delta withdrawal.

DelegatorDeltaWithdrawalData

A delegator delta withdrawal.

DelegatorHistoryItem

A delegator history item.

DelegatorHistoryRequest

A request to retrieve a user's delegator history.

DelegatorReward

A delegator reward.

DelegatorRewardsRequest

A request to retrieve a user's delegator rewards.

DelegatorSummaryRequest

A request to retrieve a user's delegator summary.

DelegatorSummaryResponse

A response to a user's delegator summary request.

DepositStakingAction

An action to deposit a token into staking.

DepositStakingRequest

A request to deposit a token into staking.

DepositStakingResponse

A response from the exchange after depositing a token into staking.

DepositStakingResponseBody

The body of a response from the exchange after depositing a token into staking.

FeeSchedule

A fee schedule.

FeeTiers

A fee tiers.

FrontendOpenOrder

An open order with additional frontend info.

FrontendOpenOrdersRequest

A request to retrieve a user's open orders with additional frontend info.

FundingHistoryItem

An entry in a funding history.

FundingHistoryRequest

A request to retrieve funding history.

GasAuction

A gas auction.

GenesisTokenDetails

A token's genesis details.

HistoricalOrdersRequest

A request to retrieve a user's historical orders.

L2Book

L2 book data.

L2BookMsg

A message from the exchange containing the L2 book for a given coin. Response to an :obj:L2BookSubscription.

L2BookRequest

A request to retrieve the L2 book for a given coin.

L2BookSubscription

Subscribe to the L2 book.

L2Level

An entry on one side of the L2 book.

Leverage

The leverage of a position.

LimitOrderType

Limit parameters for an order.

LimitOrderTypeWire

Serialized limit parameters for an order.

LimitOrderTypeWireData

Specific time in force for a limit order.

MakerFractionCutoffTier

A maker fraction cutoff tier.

MarginSummary

A summary of either the cross or total account margin.

MarginTable

A margin table.

MarginTier

A margin tier.

MaxBuilderFeeRequest

A request to retrieve the max builder fee.

Meta

Perpetual metadata.

MetaAndAssetCtxsRequest

A request to retrieve perpetual metadata and asset context.

MetaRequest

A request to retrieve perpetual metadata.

MissingUserRoleResponse

A response to a user role request for a missing user.

ModifyAction

An action to modify an order.

ModifyParams

Parameters for a request to modify an order.

ModifyRequest

A request to modify an order.

ModifyResponse

A response from the exchange after modifying an order.

ModifyResponseResponse

The response from the exchange after modifying an order.

ModifyWire

A request to modify an order.

MultiSigAction

An action to perform a multi-sig transaction.

MultiSigActionPayload

The payload of a multi-sig action.

MultiSigRequest

A request to perform a multi-sig transaction.

MultiSigResponse

A response from the exchange after performing a multi-sig transaction.

NeedToCreateCodeReferrerState

A referrer state when the referrer needs to create a code.

Network

A network such as Mainnet or Testnet.

NonUserCancel

A non-user cancel.

NonUserCancelEvent

The payload of a message from the exchange containing a non-user cancel. Response to a :obj:NonUserCancelsSubscription.

Notification

A notification.

NotificationMsg

A message from the exchange containing a notification. Response to a :obj:NotificationSubscription.

NotificationSubscription

Subscribe to notifications.

OpenOrder

An open order.

OpenOrdersRequest

A request to retrieve a user's open orders.

OrderAction

An action to place one or more orders.

OrderIdData

The id of a placed order.

OrderParams

Parameters for an order. Used for high-level order creation.

OrderRequest

A request to place one or more orders.

OrderResponse

A response from the exchange after placing an order.

OrderResponseData

The statuses of the orders in a response from the exchange after placing an order.

OrderResponseDataStatusError

The status of an order that failed to be placed.

OrderResponseDataStatusFilled

The status of a filled order.

OrderResponseDataStatusResting

The status of an order that is still resting.

OrderResponseFill

The details of a fill of a filled order.

OrderResponseResponse

The content of a response from the exchange after placing an order.

OrderStatus

The status of an order.

OrderStatusData

The data for an order status.

OrderStatusRequest

A request to retrieve the status of an order.

OrderStatusResponse

The response to a request for the status of an order.

OrderUpdate

A single order update.

OrderUpdatesMsg

A message from the exchange containing order updates. Response to an :obj:OrderUpdatesSubscription.

OrderUpdatesSubscription

Subscribe to order updates.

OrderWire

Serialized order to be sent to the exchange.

PerpDeployAuctionStatusRequest

A request to retrieve perp deploy auction status.

PerpDeployAuctionStatusResponse

The perp deploy auction status as a response to a perp deploy auction status request.

PerpDex

A perp dex.

PerpDexClassTransferAction

An action to transfer a token from a user's spot wallet to their perp wallet and vice versa.

PerpDexClassTransferRequest

A request to transfer a token from a user's spot wallet to their perp wallet and vice versa.

PerpDexClassTransferResponse

A response from the exchange after transferring a token from a user's spot wallet to their perp wallet and vice versa.

PerpDexClassTransferResponseBody

The body of a response from the exchange after transferring a token from a user's spot wallet to their perp wallet and vice versa.

PerpDexsRequest

A request to retrieve perp dexs.

PerpsAtOpenInterestCapRequest

A request to retrieve perps at open interest cap.

Ping

A request to ping the exchange.

PongMsg

A message from the exchange indicating a ping was received. Response to a :obj:Ping.

PortfolioItem

A portfolio item.

PortfolioRequest

A request to retrieve a user's portfolio.

Position

Details of a user's position in a perpetual asset.

PostData

The data of a response from the exchange after sending a :obj:PostRequest.

PostMsg

A message from the exchange containing the response to a :obj:PostRequest.

PostRequest

A request to send to the websocket API via the post method.

PostRequestExchange

A request to send to the websocket API via the post method to the /exchange endpoint.

PostRequestInfo

A request to send to the websocket API via the post method to the /info endpoint.

PostResponseExchange

The value of a response from the exchange after sending a /exchange :obj:PostRequest.

PostResponseInfo

The value of a response from the exchange after sending a /info :obj:PostRequest.

PredictedFundingRate

A predicted funding rate.

PredictedFundingsRequest

A request to retrieve predicted fundings.

ReadyReferrerState

A referrer state when the referrer is ready.

ReadyReferrerStateData

Data for a ready referrer state.

ReferralRequest

A request to retrieve a user's referral.

ReferralResponse

A referral response.

ReferralState

A referral state.

ReferredBy

A referred by.

RegisterReferrerAction

An action to register a referrer.

RegisterReferrerRequest

A request to register a referrer.

RegisterReferrerResponse

A response from the exchange after registering a referrer.

RegisterReferrerResponseBody

The body of a response from the exchange after registering a referrer.

ReserveRequestWeightAction

An action to reserve additional request weight.

ReserveRequestWeightRequest

A request to reserve additional request weight.

ReserveRequestWeightResponse

A response to a request to reserve additional request weight.

ReserveRequestWeightResponseBody

A body of response to a request to reserve additional request weight.

ScheduleCancelAction

An action to schedule a cancel-all operation at a future time.

ScheduleCancelRequest

A request to schedule a cancel-all operation at a future time.

ScheduleCancelResponse

A response from the exchange after scheduling a cancel-all operation at a future time.

SetReferrerAction

An action to set a referrer.

SetReferrerRequest

A request to set a referrer.

SetReferrerResponse

A response from the exchange after setting a referrer.

Signature

A signature for an action request.

Signers

Signers of a multi-sig.

SpotAssetCtx

Spot asset context.

SpotAssetMeta

Spot asset metadata.

SpotBalance

A user's spot balance for a given coin.

SpotDeployAuctionStatusRequest

A request to retrieve spot deploy auction status.

SpotDeployAuctionStatusResponse

A response to a spot deploy auction status request.

SpotDeploySpec

A spot deploy spec.

SpotDeployState

A spot deploy state.

SpotMeta

Spot metadata.

SpotMetaAndAssetCtxsRequest

A request to retrieve spot metadata and asset context.

SpotMetaRequest

A request to retrieve spot metadata.

SpotSendAction

An action to send a spot asset to another address.

SpotSendRequest

A request to send a spot asset to another address.

SpotSendResponse

A response from the exchange after sending a spot asset to another address.

SpotSendResponseBody

The body of a response from the exchange after sending a spot asset to another address.

SpotTokenMeta

Spot token metadata.

SpotUserState

A user's spot balances.

SpotUserStateRequest

A request to retrieve a user's spot balances.

StakingDiscountTier

A staking discount tier.

StakingLink

A staking link.

SubAccount

A subaccount.

SubAccountData

Data for a sub account.

SubAccountTransferAction

An action to transfer USDC between a user's main account and a subaccount.

SubAccountTransferRequest

A request to transfer USDC between a user's main account and a subaccount.

SubAccountTransferResponse

A response from the exchange after transferring USDC between a user's main account and a subaccount.

SubAccountUserRoleResponse

A response to a user role request for a sub account.

SubAccountsRequest

A request to retrieve a user's subaccounts.

Subscribe

A request to subscribe to a specific data feed.

SubscriptionResponseMsg

The response from the exchange after subscribing to a data feed.

TokenDelegateAction

An action to delegate or undelegate stake from a validator.

TokenDelegateRequest

A request to delegate or undelegate stake from a validator.

TokenDelegateResponse

The response from the exchange after delegating or undelegating a stake.

TokenDelegateResponseBody

The body of a response from the exchange after delegating or undelegating a stake.

TokenDetailsRequest

A request to retrieve token details.

TokenDetailsResponse

A response to a token details request.

TopUpIsolatedOnlyMarginAction

An action to top up the isolated margin for a given asset.

TopUpIsolatedOnlyMarginRequest

A request to top up the isolated margin for a given asset.

TopUpIsolatedOnlyMarginResponse

A response from the exchange after top up of the isolated margin for a given asset.

TopUpIsolatedOnlyMarginResponseBody

The data of a response from the exchange after top up of the isolated margin for a given asset.

Trade

A trade.

TradesMsg

A message from the exchange containing trades. Response to a :obj:TradesSubscription.

TradesSubscription

Subscribe to trades.

TriggerOrderType

Trigger price, limit vs market, and take profit/stop loss parameters for an order.

TriggerOrderTypeWire

Serialized trigger parameters for an order.

TriggerOrderTypeWireData

Serialized trigger price, limit vs market, and take profit/stop loss parameters for an order.

TwapCancelAction

An action to cancel a TWAP order.

TwapCancelRequest

A request to cancel a TWAP order.

TwapCancelResponse

A response to a request to cancel a TWAP order.

TwapCancelResponseBody

A body of response to a request to cancel a TWAP order.

TwapCancelResponseDataError

A error status in response to canceling a TWAP order.

TwapCancelResponseDataErrorDetail

A error status' details in response to canceling a TWAP order.

TwapCancelResponseDataSuccess

A success status in response to canceling a TWAP order.

TwapOrderAction

An action to place a TWAP order.

TwapOrderData

A status in response to placing a TWAP order.

TwapOrderDataStatusError

A error status in response to placing a TWAP order.

TwapOrderDataStatusRunning

A running status in response to placing a TWAP order.

TwapOrderDataStatusRunningData

A twap id of in response to placing a TWAP order.

TwapOrderRequest

A request to place a TWAP order.

TwapOrderResponse

A response to a request to place a TWAP order.

TwapOrderResponseBody

A body of response to a request to place a TWAP order.

TwapState

A user TWAP state.

TwapStatus

A user TWAP status.

TwapWire

A wire representation of a twap order.

Unsubscribe

A request to unsubscribe from a specific data feed.

UpdateIsolatedMarginAction

An action to update the isolated margin for a given asset.

UpdateIsolatedMarginRequest

A request to update the isolated margin for a given asset.

UpdateIsolatedMarginResponse

A response from the exchange after successfully updating the isolated margin for a given asset.

UpdateIsolatedMarginResponseBody

The body of a response from the exchange after successfully updating the isolated margin for a given asset.

UpdateLeverageAction

An action to update the leverage for a given asset.

UpdateLeverageRequest

A request to update the leverage for a given asset.

UpdateLeverageResponse

A response from the exchange after successfully updating the leverage for a given asset.

UpdateLeverageResponseBody

The body of a response from the exchange after successfully updating the leverage for a given asset.

UsdClassTransferAction

An action to transfer USDC from a user's spot wallet to their perp wallet and vice versa.

UsdClassTransferRequest

A request to transfer USDC from a user's spot wallet to their perp wallet and vice versa.

UsdClassTransferResponse

A response from the exchange after transferring USDC from a user's spot wallet to their perp wallet and vice versa.

UsdClassTransferResponseBody

The body of a response from the exchange after transferring USDC from a user's spot wallet to their perp wallet and vice versa.

UsdSendAction

An action to send USDC to another address.

UsdSendRequest

A request to send USDC to another address.

UsdSendResponse

A response from the exchange after sending USDC to another address.

UsdSendResponseBody

The body of a response from the exchange after sending USDC to another address.

UserAccountClassTransferDelta

The delta of an account class transfer in a user's non-funding ledger.

UserDepositDelta

The delta of a deposit in a user's non-funding ledger.

UserEventsMsg

A message from the exchange containing user events. Response to a :obj:UserEventsSubscription.

UserEventsSubscription

Subscribe to user events.

UserFeesRequest

A request to retrieve a user's fees.

UserFeesResponse

A response to a user's fees request.

UserFill

A user fill.

UserFillsByTimeRequest

A request to retrieve a user's fills by time.

UserFillsData

The payload of a message from the exchange containing user fills. Response to a :obj:UserFillsSubscription.

UserFillsEvent

The payload of a message from the exchange containing user fills. Response to a :obj:UserFillsSubscription.

UserFillsMsg

A message from the exchange containing user fills. Response to a :obj:UserFillsSubscription.

UserFillsRequest

A request to retrieve a user's fills.

UserFillsSubscription

Subscribe to user fills.

UserFunding

An entry in a user's funding history.

UserFundingData

A user funding.

UserFundingDelta

The delta of an entry in a user's funding history.

UserFundingEvent

The payload of a message from the exchange containing a user funding. Response to a :obj:UserFundingsSubscription.

UserFundingRequest

A request to retrieve a user's funding history.

UserFundingsData

The payload of a message from the exchange containing user fundings. Response to a :obj:UserFundingsSubscription.

UserFundingsMsg

A message from the exchange containing user fundings. Response to a :obj:UserFundingsSubscription.

UserFundingsSubscription

Subscribe to user fundings.

UserLiquidation

A user liquidation.

UserLiquidationEvent

The payload of a message from the exchange containing a user liquidation. Response to a :obj:UserLiquidationsSubscription.

UserNonFundingLedgerUpdate

An entry in a user's non-funding ledger.

UserNonFundingLedgerUpdatesData

The payload of a message from the exchange containing user non-funding ledger updates. Response to a :obj:UserNonFundingLedgerUpdatesSubscription.

UserNonFundingLedgerUpdatesMsg

A message from the exchange containing user non-funding ledger updates. Response to a :obj:UserNonFundingLedgerUpdatesSubscription.

UserNonFundingLedgerUpdatesRequest

A request to retrieve a user's non-funding ledger.

UserNonFundingLedgerUpdatesSubscription

Subscribe to user non-funding ledger updates.

UserRateLimitRequest

A request to retrieve a user's rate limit.

UserRateLimitResponse

A user's rate limit as a response to a user rate limit request.

UserRoleRequest

A request to retrieve a user's role.

UserSpotGenesisDelta

The delta of a spot genesis in a user's non-funding ledger.

UserSpotTransferDelta

The delta of a spot transfer in a user's non-funding ledger.

UserState

A user's open positions and margin summary for perpetuals trading.

UserStateRequest

A request to retrieve a user's open positions and margin summary for perpetuals trading.

UserTwapHistoryData

The payload of a message from the exchange containing user TWAP history. Response to an :obj:UserTwapHistorySubscription.

UserTwapHistoryItem

A user TWAP history item.

UserTwapHistoryMsg

A message from the exchange containing user TWAP history. Response to an :obj:UserTwapHistorySubscription.

UserTwapHistorySubscription

Subscribe to user TWAP history.

UserTwapSliceFill

A user's TWAP slice fill.

UserTwapSliceFillsData

The payload of a message from the exchange containing user TWAP slice fills. Response to an :obj:UserTwapSliceFillsSubscription.

UserTwapSliceFillsMsg

A message from the exchange containing user TWAP slice fills. Response to an :obj:UserTwapSliceFillsSubscription.

UserTwapSliceFillsRequest

A request to retrieve a user's TWAP slice fills.

UserTwapSliceFillsSubscription

Subscribe to user TWAP slice fills.

UserUserRoleResponse

A response to a user role request for a user.

UserVaultCreateDelta

The delta of a vault create in a user's non-funding ledger.

UserVaultEquitiesRequest

A request to retrieve a user's vault equities.

UserVaultEquity

A user's vault equity.

UserWithdrawDelta

The delta of a withdrawal in a user's non-funding ledger.

VaultDetailsRequest

A request to retrieve vault details.

VaultDetailsResponse

A response from the exchange after retrieving vault details.

VaultFollower

A vault follower.

VaultPortfolioItem

A portfolio item.

VaultRelationship

A vault relationship.

VaultTransferAction

An action to add or remove USDC from a vault.

VaultTransferRequest

A request to add or remove USDC from a vault.

VaultTransferResponse

A response from the exchange after adding or removing USDC from a vault.

VaultTransferResponseBody

The body of a response from the exchange after adding or removing USDC from a vault.

VaultUserRoleResponse

A response to a user role request for a vault.

VipTier

A VIP tier.

WebData2Data

The payload of a message from the exchange containing web data 2.

WebData2Msg

A message from the exchange containing web data 2. Response to a :obj:WebData2Subscription.

WebData2Subscription

Subscribe to web data 2.

WithdrawAction

An action to withdraw USDC via Arbitrum.

WithdrawRequest

A request to withdraw USDC via Arbitrum.

WithdrawResponse

A response from the exchange after withdrawing USDC via Arbitrum.

WithdrawResponseBody

The body of a response from the exchange after withdrawing USDC via Arbitrum.

WithdrawStakingAction

An action to withdraw a token from staking.

WithdrawStakingRequest

A request to withdraw a token from staking.

WithdrawStakingResponse

A response from the exchange after withdrawing a token from staking.

WithdrawStakingResponseBody

The body of a response from the exchange after withdrawing a token from staking.

WsSpotAssetCtx

Spot asset context with additional fields only present in the WebSocket version.

WsUserFundingDelta

A user funding delta as present in the WebSocket version.

Functions:

Name Description
is_error_status

Type guard to check if an order status is an error.

is_filled_status

Type guard to check if an order status is filled.

is_resting_status

Type guard to check if an order status is resting.

Attributes:

Name Type Description
Action TypeAlias

A union of all possible actions that can be performed on the exchange.

AllMids TypeAlias

All mids for all actively traded coins mapping the coin name to the mid price.

AllMidsResponse TypeAlias

All mids for all actively traded coins as a response to an all mids request.

CandleInterval

The interval of a candle.

CandleSnapshotResponse TypeAlias

A list of candles as a response to a candle snapshot request.

DelegationsResponse TypeAlias

A response to a user's delegations request.

DelegatorHistoryResponse TypeAlias

A response to a user's delegator history request.

DelegatorRewardsResponse TypeAlias

A response to a user's delegator rewards request.

ExchangeRequest

A union of all possible requests that can be sent to the exchange API.

ExchangeResponse

A union of all possible responses that can be returned from the exchange API.

FillDirection

The direction of a fill.

FrontendOpenOrdersResponse TypeAlias

A list of open orders with additional frontend info as a response to a frontend open orders request.

FundingHistoryResponse TypeAlias

A list of funding history items as a response to a funding history request.

Grouping

Grouping literals.

HistoricalOrdersResponse TypeAlias

A list of historical orders as a response to a historical orders request.

InfoRequest

A union of all possible requests that can be sent to the info API.

InfoResponse

A union of all possible responses that can be returned from the info API.

L2BookResponse TypeAlias

L2 book data as a response to an L2 book request.

MaxBuilderFeeResponse TypeAlias

The max builder fee as a response to a max builder fee request.

MetaAndAssetCtxsResponse TypeAlias

The perpetual metadata and asset context as a response to a meta and asset ctxs request.

MetaResponse TypeAlias

Perpetual metadata as a response to a meta request.

Msg

A union of all possible messages that can be received via WebSocket.

OpenOrdersResponse TypeAlias

A list of open orders as a response to an open orders request.

OrderResponseDataStatus TypeAlias

The status of an order.

OrderStatusValue

The possible values for the status of an order (e.g. open, filled, canceled, etc.).

OrderType

A union of order types (limit or trigger).

OrderTypeWire TypeAlias

Serialized limit or trigger parameters for an order.

PerpDexsResponse TypeAlias

A response to a perp dexs request. The first item is always None, subsequent items are perp dex dicts.

PerpsAtOpenInterestCapResponse TypeAlias

A list of perps at open interest cap as a response to a perps at open interest cap request.

PortfolioResponse TypeAlias

A response to a user's portfolio request. Inner list is always [period: Literal["day", "week", "month", "allTime", "perpDay", "perpWeek", "perpMonth", "perpAllTime"], portfolio_item: PortfolioItem]

PredictedFundingsItem TypeAlias

A list of list of predicted funding rates. First item in the inner list is the venue, second item is a list of predicted funding rates.

PredictedFundingsResponse TypeAlias

A list of list of predicted fundings as a response to a predicted fundings request.

ReferrerState TypeAlias

A referrer state.

SIDES list[Side]

A list of all possible sides.

Side

The side of an order either A = Ask = Short or B = Bid = Buy.

SpotMetaAndAssetCtxsResponse TypeAlias

The spot metadata and asset context as a response to a spot meta and asset ctxs request.

SpotMetaResponse TypeAlias

Spot metadata as a response to a spot meta request.

SpotUserStateResponse TypeAlias

A user's spot balances as a response to a spot user state request.

SubAccountsResponse TypeAlias

A list of subaccounts as a response to a subaccounts request.

Subscription TypeAlias

A union of all possible WebSocket subscription types.

Tif

Time in force literals.

Tpsl

Take profit/stop loss literals.

UserEvent

A union of all possible user events that can be received via WebSocket.

UserFillsResponse TypeAlias

A list of user fills as a response to a user fills request.

UserFundingResponse TypeAlias

A list of user funding history entries as a response to a user funding request.

UserNonFundingLedgerUpdatesResponse TypeAlias

A list of user non-funding ledger entries as a response to a user non-funding ledger updates request.

UserRoleResponse TypeAlias

A response to a user role request.

UserStateResponse TypeAlias

A user's open positions and margin summary for perpetuals trading as a response to a user state request.

UserTwapSliceFillsResponse TypeAlias

A user's TWAP slice fills as a response to a user TWAP slice fills request.

UserVaultEquitiesResponse TypeAlias

A list of user vault equities as a response to a user vault equities request.

AllMids module-attribute ¤

AllMids: TypeAlias = dict[str, str]

All mids for all actively traded coins mapping the coin name to the mid price.

AllMidsResponse module-attribute ¤

AllMidsResponse: TypeAlias = AllMids

All mids for all actively traded coins as a response to an all mids request.

CandleInterval module-attribute ¤

CandleInterval = Literal[
    "1m",
    "3m",
    "5m",
    "15m",
    "30m",
    "1h",
    "2h",
    "4h",
    "8h",
    "12h",
    "1d",
    "3d",
    "1w",
    "1M",
]

The interval of a candle.

CandleSnapshotResponse module-attribute ¤

CandleSnapshotResponse: TypeAlias = list[Candle]

A list of candles as a response to a candle snapshot request.

DelegationsResponse module-attribute ¤

DelegationsResponse: TypeAlias = list[Delegation]

A response to a user's delegations request.

DelegatorHistoryResponse module-attribute ¤

DelegatorHistoryResponse: TypeAlias = list[
    DelegatorHistoryItem
]

A response to a user's delegator history request.

DelegatorRewardsResponse module-attribute ¤

DelegatorRewardsResponse: TypeAlias = list[DelegatorReward]

A response to a user's delegator rewards request.

FillDirection module-attribute ¤

FillDirection = Literal[
    "Close Long",
    "Close Short",
    "Long > Short",
    "Open Long",
    "Open Short",
    "Short > Long",
]

The direction of a fill.

FrontendOpenOrdersResponse module-attribute ¤

FrontendOpenOrdersResponse: TypeAlias = list[
    FrontendOpenOrder
]

A list of open orders with additional frontend info as a response to a frontend open orders request.

FundingHistoryResponse module-attribute ¤

FundingHistoryResponse: TypeAlias = list[FundingHistoryItem]

A list of funding history items as a response to a funding history request.

Grouping module-attribute ¤

Grouping = Literal['na', 'normalTpsl', 'positionTpsl']

Grouping literals.

HistoricalOrdersResponse module-attribute ¤

HistoricalOrdersResponse: TypeAlias = list[OrderStatus]

A list of historical orders as a response to a historical orders request.

L2BookResponse module-attribute ¤

L2BookResponse: TypeAlias = L2Book

L2 book data as a response to an L2 book request.

MaxBuilderFeeResponse module-attribute ¤

MaxBuilderFeeResponse: TypeAlias = int

The max builder fee as a response to a max builder fee request.

MetaAndAssetCtxsResponse module-attribute ¤

MetaAndAssetCtxsResponse: TypeAlias = tuple[
    Meta, list[AssetCtx]
]

The perpetual metadata and asset context as a response to a meta and asset ctxs request.

MetaResponse module-attribute ¤

MetaResponse: TypeAlias = Meta

Perpetual metadata as a response to a meta request.

OpenOrdersResponse module-attribute ¤

OpenOrdersResponse: TypeAlias = list[OpenOrder]

A list of open orders as a response to an open orders request.

OrderResponseDataStatus module-attribute ¤

The status of an order.

OrderStatusValue module-attribute ¤

OrderStatusValue = Literal[
    "open",
    "filled",
    "canceled",
    "triggered",
    "rejected",
    "marginCanceled",
    "vaultWithdrawalCanceled",
    "openInterestCapCanceled",
    "selfTradeCanceled",
    "reduceOnlyCanceled",
    "siblingFilledCanceled",
    "delistedCanceled",
    "liquidatedCanceled",
    "scheduledCancel",
]

The possible values for the status of an order (e.g. open, filled, canceled, etc.).

OrderType module-attribute ¤

A union of order types (limit or trigger).

OrderTypeWire module-attribute ¤

Serialized limit or trigger parameters for an order.

PerpDexsResponse module-attribute ¤

PerpDexsResponse: TypeAlias = list[None | PerpDex]

A response to a perp dexs request. The first item is always None, subsequent items are perp dex dicts.

PerpsAtOpenInterestCapResponse module-attribute ¤

PerpsAtOpenInterestCapResponse: TypeAlias = list[str]

A list of perps at open interest cap as a response to a perps at open interest cap request.

PortfolioResponse module-attribute ¤

PortfolioResponse: TypeAlias = list[
    list[
        Literal[
            "day",
            "week",
            "month",
            "allTime",
            "perpDay",
            "perpWeek",
            "perpMonth",
            "perpAllTime",
        ]
        | PortfolioItem
    ]
]

A response to a user's portfolio request. Inner list is always [period: Literal["day", "week", "month", "allTime", "perpDay", "perpWeek", "perpMonth", "perpAllTime"], portfolio_item: PortfolioItem]

PredictedFundingsItem module-attribute ¤

PredictedFundingsItem: TypeAlias = list[
    list[str | PredictedFundingRate]
]

A list of list of predicted funding rates. First item in the inner list is the venue, second item is a list of predicted funding rates.

PredictedFundingsResponse module-attribute ¤

PredictedFundingsResponse: TypeAlias = list[
    list[str | PredictedFundingsItem]
]

A list of list of predicted fundings as a response to a predicted fundings request. First item of the inner list is the coin, second item is a list of predicted fundings.

ReferrerState module-attribute ¤

A referrer state.

SIDES module-attribute ¤

SIDES: list[Side] = ['A', 'B']

A list of all possible sides.

Side module-attribute ¤

Side = Literal['A', 'B']

The side of an order either A = Ask = Short or B = Bid = Buy.

SpotMetaAndAssetCtxsResponse module-attribute ¤

SpotMetaAndAssetCtxsResponse: TypeAlias = list[
    SpotMeta | list[SpotAssetCtx]
]

The spot metadata and asset context as a response to a spot meta and asset ctxs request. First item is the spot metadata, the second item is a list of asset contexts.

SpotMetaResponse module-attribute ¤

SpotMetaResponse: TypeAlias = SpotMeta

Spot metadata as a response to a spot meta request.

SpotUserStateResponse module-attribute ¤

SpotUserStateResponse: TypeAlias = SpotUserState

A user's spot balances as a response to a spot user state request.

SubAccountsResponse module-attribute ¤

SubAccountsResponse: TypeAlias = list[SubAccount]

A list of subaccounts as a response to a subaccounts request.

Tif module-attribute ¤

Tif = Literal['Alo', 'Ioc', 'Gtc']

Time in force literals.

Tpsl module-attribute ¤

Tpsl = Literal['tp', 'sl']

Take profit/stop loss literals.

UserEvent module-attribute ¤

A union of all possible user events that can be received via WebSocket.

UserFillsResponse module-attribute ¤

UserFillsResponse: TypeAlias = list[UserFill]

A list of user fills as a response to a user fills request.

UserFundingResponse module-attribute ¤

UserFundingResponse: TypeAlias = list[UserFunding]

A list of user funding history entries as a response to a user funding request.

UserNonFundingLedgerUpdatesResponse module-attribute ¤

UserNonFundingLedgerUpdatesResponse: TypeAlias = list[
    UserNonFundingLedgerUpdate
]

A list of user non-funding ledger entries as a response to a user non-funding ledger updates request.

UserRoleResponse module-attribute ¤

A response to a user role request.

UserStateResponse module-attribute ¤

UserStateResponse: TypeAlias = UserState

A user's open positions and margin summary for perpetuals trading as a response to a user state request.

UserTwapSliceFillsResponse module-attribute ¤

UserTwapSliceFillsResponse: TypeAlias = list[
    UserTwapSliceFill
]

A user's TWAP slice fills as a response to a user TWAP slice fills request.

UserVaultEquitiesResponse module-attribute ¤

UserVaultEquitiesResponse: TypeAlias = list[UserVaultEquity]

A list of user vault equities as a response to a user vault equities request.

ActiveAssetCtxMsg ¤

Bases: TypedDict

A message from the exchange containing active perpetual asset context. Response to an ActiveAssetCtxSubscription .

Attributes:

Name Type Description
channel Literal['activeAssetCtx']

The channel of the message set to activeAssetCtx.

data AssetCtxData

The payload of the message containing the active asset context.

channel instance-attribute ¤

channel: Literal['activeAssetCtx']

The channel of the message set to activeAssetCtx.

data instance-attribute ¤

The payload of the message containing the active asset context.

ActiveAssetCtxSubscription ¤

Bases: TypedDict

Subscribe to active asset context.

Attributes:

Name Type Description
coin str

The asset to subscribe to.

type Literal['activeAssetCtx']

The subscription type.

coin instance-attribute ¤

coin: str

The asset to subscribe to.

type instance-attribute ¤

type: Literal['activeAssetCtx']

The subscription type.

ActiveAssetData ¤

Bases: TypedDict

The payload of a message from the exchange containing active asset data. Response to an :obj:ActiveAssetDataSubscription.

Attributes:

Name Type Description
availableToTrade tuple[str, str]

The available amounts to trade for buy and sell orders.

coin str

The asset name.

leverage Leverage

The leverage information for the asset.

maxTradeSzs tuple[str, str]

The maximum trade sizes for buy and sell orders.

user str

The user address.

availableToTrade instance-attribute ¤

availableToTrade: tuple[str, str]

The available amounts to trade for buy and sell orders.

coin instance-attribute ¤

coin: str

The asset name.

leverage instance-attribute ¤

leverage: Leverage

The leverage information for the asset.

maxTradeSzs instance-attribute ¤

maxTradeSzs: tuple[str, str]

The maximum trade sizes for buy and sell orders.

user instance-attribute ¤

user: str

The user address.

ActiveAssetDataMsg ¤

Bases: TypedDict

A message from the exchange containing active asset data. Response to an :obj:ActiveAssetDataSubscription.

Attributes:

Name Type Description
channel Literal['activeAssetData']

The channel of the message set to activeAssetData.

data ActiveAssetData

The active asset data.

channel instance-attribute ¤

channel: Literal['activeAssetData']

The channel of the message set to activeAssetData.

data instance-attribute ¤

The active asset data.

ActiveAssetDataSubscription ¤

Bases: TypedDict

Subscribe to active asset data.

Note: Only supports perpetual assets.

Attributes:

Name Type Description
coin str

The asset to subscribe to.

type Literal['activeAssetData']

The subscription type.

user str

The user address to subscribe to.

coin instance-attribute ¤

coin: str

The asset to subscribe to.

type instance-attribute ¤

type: Literal['activeAssetData']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

ActiveSpotAssetCtxMsg ¤

Bases: TypedDict

A message from the exchange containing active spot asset context. Response to an :obj:ActiveAssetCtxSubscription.

Attributes:

Name Type Description
channel Literal['activeSpotAssetCtx']

The channel of the message set to activeSpotAssetCtx.

data SpotAssetCtx

The spot asset context data.

channel instance-attribute ¤

channel: Literal['activeSpotAssetCtx']

The channel of the message set to activeSpotAssetCtx.

data instance-attribute ¤

The spot asset context data.

AgentData ¤

Bases: TypedDict

Data for an agent.

Attributes:

Name Type Description
user str

The user of the agent.

user instance-attribute ¤

user: str

The user of the agent.

AgentUserRoleResponse ¤

Bases: TypedDict

A response to a user role request for an agent.

Attributes:

Name Type Description
data AgentData

The data of the agent.

role Literal['agent']

The role agent.

data instance-attribute ¤

data: AgentData

The data of the agent.

role instance-attribute ¤

role: Literal['agent']

The role agent.

AllMidsData ¤

Bases: TypedDict

The payload of a message from the exchange containing all mids.

Attributes:

Name Type Description
mids AllMids

The mids data mapping asset names to prices.

mids instance-attribute ¤

mids: AllMids

The mids data mapping asset names to prices.

AllMidsMsg ¤

Bases: TypedDict

A message from the exchange containing all mids. Response to an :obj:AllMidsSubscription.

Attributes:

Name Type Description
channel Literal['allMids']

The channel of the message set to allMids.

data AllMidsData

The all mids data.

channel instance-attribute ¤

channel: Literal['allMids']

The channel of the message set to allMids.

data instance-attribute ¤

The all mids data.

AllMidsRequest ¤

Bases: TypedDict

A request to retrieve all mids for all actively traded coins.

Attributes:

Name Type Description
dex NotRequired[str]

The dex to get the mids for.

type Literal['allMids']

The allMids request type.

dex instance-attribute ¤

The dex to get the mids for.

type instance-attribute ¤

type: Literal['allMids']

The allMids request type.

AllMidsSubscription ¤

Bases: TypedDict

Subscribe to all mids.

Attributes:

Name Type Description
type Literal['allMids']

The subscription type.

type instance-attribute ¤

type: Literal['allMids']

The subscription type.

ApproveAgentAction ¤

Bases: TypedDict

An action to approve an agent.

Attributes:

Name Type Description
agentAddress str

The agent address.

agentName str | None

The agent name.

hyperliquidChain str

The hyperliquid chain identifier.

nonce int

The nonce for the action.

signatureChainId str

The signature chain ID.

type Literal['approveAgent']

The action type.

agentAddress instance-attribute ¤

agentAddress: str

The agent address.

agentName instance-attribute ¤

agentName: str | None

The agent name.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

type instance-attribute ¤

type: Literal['approveAgent']

The action type.

ApproveAgentRequest ¤

Bases: TypedDict

A request to approve an agent.

Attributes:

Name Type Description
action ApproveAgentAction

The approve agent action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The approve agent action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

ApproveAgentResponse ¤

Bases: TypedDict

A response from the exchange after approving an agent.

Attributes:

Name Type Description
response ApproveAgentResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

ApproveAgentResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after approving an agent.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

ApproveBuilderFeeAction ¤

Bases: TypedDict

An action to approve a builder fee.

Attributes:

Name Type Description
builder str

The builder address.

hyperliquidChain str

The hyperliquid chain identifier.

maxFeeRate str

The maximum fee rate.

nonce int

The nonce for the action.

signatureChainId str

The signature chain ID.

type Literal['approveBuilderFee']

The action type.

builder instance-attribute ¤

builder: str

The builder address.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

maxFeeRate instance-attribute ¤

maxFeeRate: str

The maximum fee rate.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

type instance-attribute ¤

type: Literal['approveBuilderFee']

The action type.

ApproveBuilderFeeRequest ¤

Bases: TypedDict

A request to approve a builder fee.

Attributes:

Name Type Description
action ApproveBuilderFeeAction

The approve builder fee action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The approve builder fee action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

ApproveBuilderFeeResponse ¤

Bases: TypedDict

A response from the exchange after approving a builder fee.

Attributes:

Name Type Description
response ApproveBuilderFeeResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

ApproveBuilderFeeResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after approving a builder fee.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

AssetCtx ¤

Bases: TypedDict

Additional context for a perpetual asset.

Attributes:

Name Type Description
dayBaseVlm str

The day base volume.

dayNtlVlm str

The day notional volume.

funding str

The funding rate.

impactPxs tuple[str, str] | None

The impact prices.

markPx str

The mark price.

midPx str | None

The mid price.

openInterest str

The open interest.

oraclePx str

The oracle price.

premium str | None

The premium.

prevDayPx str

The previous day price.

dayBaseVlm instance-attribute ¤

dayBaseVlm: str

The day base volume.

dayNtlVlm instance-attribute ¤

dayNtlVlm: str

The day notional volume.

funding instance-attribute ¤

funding: str

The funding rate.

impactPxs instance-attribute ¤

impactPxs: tuple[str, str] | None

The impact prices.

markPx instance-attribute ¤

markPx: str

The mark price.

midPx instance-attribute ¤

midPx: str | None

The mid price.

openInterest instance-attribute ¤

openInterest: str

The open interest.

oraclePx instance-attribute ¤

oraclePx: str

The oracle price.

premium instance-attribute ¤

premium: str | None

The premium.

prevDayPx instance-attribute ¤

prevDayPx: str

The previous day price.

AssetCtxData ¤

Bases: TypedDict

The payload of a message from the exchange containing active asset context. Response to an :obj:ActiveAssetCtxSubscription.

Attributes:

Name Type Description
coin str

The asset name.

ctx AssetCtx

The asset context information.

coin instance-attribute ¤

coin: str

The asset name.

ctx instance-attribute ¤

ctx: AssetCtx

The asset context information.

AssetInfo ¤

Bases: TypedDict

Information about an asset.

Attributes:

Name Type Description
id int

The asset ID.

name str

The asset name.

pxDecimals int

The maximum number of decimals for the price.

szDecimals int

The maximum number of decimals for the size.

type Literal['SPOT', 'PERPETUAL']

The type of asset either SPOT or PERPETUAL.

id instance-attribute ¤

id: int

The asset ID.

name instance-attribute ¤

name: str

The asset name.

pxDecimals instance-attribute ¤

pxDecimals: int

The maximum number of decimals for the price.

szDecimals instance-attribute ¤

szDecimals: int

The maximum number of decimals for the size.

type instance-attribute ¤

type: Literal['SPOT', 'PERPETUAL']

The type of asset either SPOT or PERPETUAL.

AssetMeta ¤

Bases: TypedDict

Perpetual asset metadata.

Attributes:

Name Type Description
maxLeverage int

The maximum leverage allowed.

name str

The name of the asset.

onlyIsolated NotRequired[bool]

Whether the asset is only available for isolated margin.

szDecimals int

The number of decimals for the size.

maxLeverage instance-attribute ¤

maxLeverage: int

The maximum leverage allowed.

name instance-attribute ¤

name: str

The name of the asset.

onlyIsolated instance-attribute ¤

onlyIsolated: NotRequired[bool]

Whether the asset is only available for isolated margin.

szDecimals instance-attribute ¤

szDecimals: int

The number of decimals for the size.

AssetPosition ¤

Bases: TypedDict

A user's position in a perpetual asset.

Attributes:

Name Type Description
position Position

The position details.

type Literal['oneWay']

The type of position.

position instance-attribute ¤

position: Position

The position details.

type instance-attribute ¤

type: Literal['oneWay']

The type of position.

BatchModifyAction ¤

Bases: TypedDict

An action to modify multiple orders.

Attributes:

Name Type Description
modifies list[ModifyWire]

The list of order modifications.

type Literal['batchModify']

The action type.

modifies instance-attribute ¤

modifies: list[ModifyWire]

The list of order modifications.

type instance-attribute ¤

type: Literal['batchModify']

The action type.

BatchModifyRequest ¤

Bases: TypedDict

A request to modify multiple orders.

Attributes:

Name Type Description
action BatchModifyAction

The batch modify action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

The batch modify action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

BatchModifyResponse ¤

Bases: TypedDict

A response from the exchange after modifying multiple orders.

Attributes:

Name Type Description
response BatchModifyResponseResponse

The response content.

status Literal['ok']

The response status.

response instance-attribute ¤

The response content.

status instance-attribute ¤

status: Literal['ok']

The response status.

BatchModifyResponseResponse ¤

Bases: TypedDict

The response from the exchange after modifying multiple orders.

Attributes:

Name Type Description
data OrderResponseData

The order response data.

type Literal['order']

The response type.

data instance-attribute ¤

The order response data.

type instance-attribute ¤

type: Literal['order']

The response type.

BestBidOfferData ¤

Bases: TypedDict

The payload of a message from the exchange containing best bid offer data. Response to an :obj:BestBidOfferSubscription.

Attributes:

Name Type Description
bbo list[L2Level | None]

The best bid offer levels.

coin str

The asset for the best bid offer data.

time int

The timestamp of the best bid offer data.

bbo instance-attribute ¤

bbo: list[L2Level | None]

The best bid offer levels.

coin instance-attribute ¤

coin: str

The asset for the best bid offer data.

time instance-attribute ¤

time: int

The timestamp of the best bid offer data.

BestBidOfferMsg ¤

Bases: TypedDict

A message from the exchange containing best bid offer data. Response to an :obj:BestBidOfferSubscription.

Attributes:

Name Type Description
channel Literal['bbo']

The channel of the message set to bbo.

data BestBidOfferData

The best bid offer data.

channel instance-attribute ¤

channel: Literal['bbo']

The channel of the message set to bbo.

data instance-attribute ¤

The best bid offer data.

BestBidOfferSubscription ¤

Bases: TypedDict

Subscribe to best bid offer data.

Attributes:

Name Type Description
coin str

The asset to subscribe to.

type Literal['bbo']

The subscription type.

coin instance-attribute ¤

coin: str

The asset to subscribe to.

type instance-attribute ¤

type: Literal['bbo']

The subscription type.

BuilderOptions ¤

Bases: TypedDict

Options for a builder.

Attributes:

Name Type Description
b str

Address that should receive the additional fee.

f int

Size of the fee in tenths of a basis point e.g. if f is 10, 1bp of the order notional.

b instance-attribute ¤

b: str

Address that should receive the additional fee.

f instance-attribute ¤

f: int

Size of the fee in tenths of a basis point e.g. if f is 10, 1bp of the order notional.

Cancel ¤

Bases: TypedDict

A request to cancel an order by its oid.

Attributes:

Name Type Description
a int

The asset ID.

o int

The order ID.

a instance-attribute ¤

a: int

The asset ID.

o instance-attribute ¤

o: int

The order ID.

CancelAction ¤

Bases: TypedDict

An action to cancel one or more orders by their oid.

Attributes:

Name Type Description
cancels list[Cancel]

The list of cancels.

type Literal['cancel']

The action type.

cancels instance-attribute ¤

cancels: list[Cancel]

The list of cancels.

type instance-attribute ¤

type: Literal['cancel']

The action type.

CancelByCloid ¤

Bases: TypedDict

A request to cancel an order by its cloid.

Attributes:

Name Type Description
asset int

The asset ID.

cloid str

The client order ID.

asset instance-attribute ¤

asset: int

The asset ID.

cloid instance-attribute ¤

cloid: str

The client order ID.

CancelByCloidAction ¤

Bases: TypedDict

An action to cancel one or more orders by their cloid.

Attributes:

Name Type Description
cancels list[CancelByCloid]

The list of cancels by cloid.

type Literal['cancelByCloid']

The action type.

cancels instance-attribute ¤

cancels: list[CancelByCloid]

The list of cancels by cloid.

type instance-attribute ¤

type: Literal['cancelByCloid']

The action type.

CancelByCloidParams ¤

Bases: TypedDict

Parameters for a request to cancel an order by its cloid.

Attributes:

Name Type Description
asset int | str

The asset ID or name.

client_order_id Cloid | str

The client order ID.

asset instance-attribute ¤

asset: int | str

The asset ID or name.

client_order_id instance-attribute ¤

client_order_id: Cloid | str

The client order ID.

CancelByCloidRequest ¤

Bases: TypedDict

A request to cancel one or more orders by their cloid.

Attributes:

Name Type Description
action CancelByCloidAction

The cancel by cloid action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

The cancel by cloid action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

CancelByCloidResponse ¤

Bases: TypedDict

A response from the exchange after cancelling an order by its cloid.

Attributes:

Name Type Description
response CancelResponseResponse

The response content.

status Literal['ok']

The response status.

response instance-attribute ¤

The response content.

status instance-attribute ¤

status: Literal['ok']

The response status.

CancelParams ¤

Bases: TypedDict

Parameters for a request to cancel an order by its oid.

Attributes:

Name Type Description
asset int | str

The asset ID or name.

order_id int

The order ID to cancel.

asset instance-attribute ¤

asset: int | str

The asset ID or name.

order_id instance-attribute ¤

order_id: int

The order ID to cancel.

CancelRequest ¤

Bases: TypedDict

A request to cancel one or more orders by their oid.

Attributes:

Name Type Description
action CancelAction

The cancel action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

action: CancelAction

The cancel action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

CancelResponse ¤

Bases: TypedDict

A response from the exchange after cancelling an order by its oid.

Attributes:

Name Type Description
response CancelResponseResponse

The response content.

status Literal['ok']

The response status.

response instance-attribute ¤

The response content.

status instance-attribute ¤

status: Literal['ok']

The response status.

CancelResponseData ¤

Bases: TypedDict

The data of a response from the exchange after cancelling an order by its oid.

Attributes:

Name Type Description
statuses list[Literal['success'] | CancelResponseDataErrorStatus]

The list of cancellation statuses.

statuses instance-attribute ¤

statuses: list[
    Literal["success"] | CancelResponseDataErrorStatus
]

The list of cancellation statuses.

CancelResponseDataErrorStatus ¤

Bases: TypedDict

The status of an order that failed to be cancelled.

Attributes:

Name Type Description
error str

The error message.

error instance-attribute ¤

error: str

The error message.

CancelResponseResponse ¤

Bases: TypedDict

A response from the exchange after cancelling an order by its oid.

Attributes:

Name Type Description
data CancelResponseData

The cancel response data.

type Literal['cancel']

The response type.

data instance-attribute ¤

The cancel response data.

type instance-attribute ¤

type: Literal['cancel']

The response type.

Candle ¤

Bases: TypedDict

A candle.

Attributes:

Name Type Description
T int

The end time of the candle in ms.

c str

The close price of the candle.

h str

The high price of the candle.

i CandleInterval

The interval of the candle.

l str

The low price of the candle.

n int

The number of trades in the candle.

o str

The open price of the candle.

s str

The asset name of the candle.

t int

The start time of the candle in ms.

v str

The volume of the candle.

T instance-attribute ¤

T: int

The end time of the candle in ms.

c instance-attribute ¤

c: str

The close price of the candle.

h instance-attribute ¤

h: str

The high price of the candle.

i instance-attribute ¤

The interval of the candle.

l instance-attribute ¤

l: str

The low price of the candle.

n instance-attribute ¤

n: int

The number of trades in the candle.

o instance-attribute ¤

o: str

The open price of the candle.

s instance-attribute ¤

s: str

The asset name of the candle.

t instance-attribute ¤

t: int

The start time of the candle in ms.

v instance-attribute ¤

v: str

The volume of the candle.

CandleMsg ¤

Bases: TypedDict

A message from the exchange containing a candle. Response to a :obj:CandleSubscription.

Attributes:

Name Type Description
channel Literal['candle']

The channel of the message set to candle.

data Candle

The candle data.

channel instance-attribute ¤

channel: Literal['candle']

The channel of the message set to candle.

data instance-attribute ¤

data: Candle

The candle data.

CandleSnapshotRequest ¤

Bases: TypedDict

A request to retrieve a candle snapshot.

Attributes:

Name Type Description
req CandleSnapshotRequestPayload

The request payload.

type Literal['candleSnapshot']

The candleSnapshot request type.

req instance-attribute ¤

The request payload.

type instance-attribute ¤

type: Literal['candleSnapshot']

The candleSnapshot request type.

CandleSnapshotRequestPayload ¤

Bases: TypedDict

The specification for which candle snapshot to retrieve.

Attributes:

Name Type Description
coin str

The asset to get the candle snapshot for.

endTime NotRequired[int | None]

The end time of the candle snapshot.

interval CandleInterval

The interval of the candle snapshot.

startTime int

The start time of the candle snapshot.

coin instance-attribute ¤

coin: str

The asset to get the candle snapshot for.

endTime instance-attribute ¤

endTime: NotRequired[int | None]

The end time of the candle snapshot.

interval instance-attribute ¤

interval: CandleInterval

The interval of the candle snapshot.

startTime instance-attribute ¤

startTime: int

The start time of the candle snapshot.

CandleSubscription ¤

Bases: TypedDict

Subscribe to candles.

Attributes:

Name Type Description
coin str

The asset to subscribe to.

interval CandleInterval

The candle interval.

type Literal['candle']

The subscription type.

coin instance-attribute ¤

coin: str

The asset to subscribe to.

interval instance-attribute ¤

interval: CandleInterval

The candle interval.

type instance-attribute ¤

type: Literal['candle']

The subscription type.

ConvertToMultiSigUserAction ¤

Bases: TypedDict

An action to convert an address to a multi-sig address.

Attributes:

Name Type Description
nonce int

The nonce for the action.

signers str

JSON dump of :obj:Signers (i.e. signers=json.dumps(signers)).

type Literal['convertToMultiSigUser']

The action type.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signers instance-attribute ¤

signers: str

JSON dump of :obj:Signers (i.e. signers=json.dumps(signers)).

type instance-attribute ¤

type: Literal['convertToMultiSigUser']

The action type.

ConvertToMultiSigUserRequest ¤

Bases: TypedDict

A request to convert an address to a multi-sig address.

Attributes:

Name Type Description
action ConvertToMultiSigUserAction

The convert to multi-sig action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The convert to multi-sig action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

ConvertToMultiSigUserResponse ¤

Bases: TypedDict

A response from the exchange after converting an address to a multi-sig address.

Attributes:

Name Type Description
todo FIXME

Placeholder field - not documented in API docs.

todo instance-attribute ¤

todo: FIXME

Placeholder field - not documented in API docs.

CreateSubAccountAction ¤

Bases: TypedDict

An action to create a subaccount.

Attributes:

Name Type Description
name str

The name of the subaccount.

type Literal['createSubAccount']

The action type.

name instance-attribute ¤

name: str

The name of the subaccount.

type instance-attribute ¤

type: Literal['createSubAccount']

The action type.

CreateSubAccountRequest ¤

Bases: TypedDict

A request to create a subaccount.

Attributes:

Name Type Description
action CreateSubAccountAction

The create subaccount action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The create subaccount action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

CreateSubAccountResponse ¤

Bases: TypedDict

A response from the exchange after creating a subaccount.

Attributes:

Name Type Description
response CreateSubAccountResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

CreateSubAccountResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after creating a subaccount.

Attributes:

Name Type Description
data str

The subaccount user address.

type Literal['createSubAccount']

The response type.

data instance-attribute ¤

data: str

The subaccount user address.

type instance-attribute ¤

type: Literal['createSubAccount']

The response type.

CreateVaultAction ¤

Bases: TypedDict

An action to create a vault.

Attributes:

Name Type Description
description str

The description of the vault.

initialUsd int

The initial USD amount for the vault.

name str

The name of the vault.

nonce int

The nonce for the action.

type Literal['createVault']

The action type.

description instance-attribute ¤

description: str

The description of the vault.

initialUsd instance-attribute ¤

initialUsd: int

The initial USD amount for the vault.

name instance-attribute ¤

name: str

The name of the vault.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

type instance-attribute ¤

type: Literal['createVault']

The action type.

CreateVaultRequest ¤

Bases: TypedDict

A request to create a vault.

Attributes:

Name Type Description
action CreateVaultAction

The create vault action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The create vault action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

CreateVaultResponse ¤

Bases: TypedDict

A response from the exchange after creating a vault.

Attributes:

Name Type Description
response CreateVaultResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

CreateVaultResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after creating a vault.

Attributes:

Name Type Description
data str

The vault address.

type Literal['createVault']

The response type.

data instance-attribute ¤

data: str

The vault address.

type instance-attribute ¤

type: Literal['createVault']

The response type.

CumFunding ¤

Bases: TypedDict

The cumulative funding of a position.

Attributes:

Name Type Description
allTime str

The cumulative funding all time.

sinceChange str

The cumulative funding since the last change.

sinceOpen str

The cumulative funding since the position was opened.

allTime instance-attribute ¤

allTime: str

The cumulative funding all time.

sinceChange instance-attribute ¤

sinceChange: str

The cumulative funding since the last change.

sinceOpen instance-attribute ¤

sinceOpen: str

The cumulative funding since the position was opened.

DailyUserVlm ¤

Bases: TypedDict

A daily user VLM.

Attributes:

Name Type Description
date str

The date of the daily user VLM.

exchange str

The exchange of the daily user VLM.

userAdd str

The user add of the daily user VLM.

userCross str

The user cross of the daily user VLM.

date instance-attribute ¤

date: str

The date of the daily user VLM.

exchange instance-attribute ¤

exchange: str

The exchange of the daily user VLM.

userAdd instance-attribute ¤

userAdd: str

The user add of the daily user VLM.

userCross instance-attribute ¤

userCross: str

The user cross of the daily user VLM.

Delegation ¤

Bases: TypedDict

A delegation.

Attributes:

Name Type Description
amount str

The amount delegated.

lockedUntilTimestamp int

The timestamp until which the delegation is locked.

validator str

The validator address.

amount instance-attribute ¤

amount: str

The amount delegated.

lockedUntilTimestamp instance-attribute ¤

lockedUntilTimestamp: int

The timestamp until which the delegation is locked.

validator instance-attribute ¤

validator: str

The validator address.

DelegationsRequest ¤

Bases: TypedDict

A request to retrieve a user's delegations.

Attributes:

Name Type Description
type Literal['delegations']

The delegations request type.

user str

The user to get the delegations for.

type instance-attribute ¤

type: Literal['delegations']

The delegations request type.

user instance-attribute ¤

user: str

The user to get the delegations for.

DelegatorDeltaCDeposit ¤

Bases: TypedDict

A delegator delta c deposit.

Attributes:

Name Type Description
cDeposit DelegatorDeltaCDepositData

The c deposit data.

cDeposit instance-attribute ¤

The c deposit data.

DelegatorDeltaCDepositData ¤

Bases: TypedDict

A delegator delta c deposit.

Attributes:

Name Type Description
amount str

The deposit amount.

amount instance-attribute ¤

amount: str

The deposit amount.

DelegatorDeltaDelegate ¤

Bases: TypedDict

A delegator delta.

Attributes:

Name Type Description
delegate DelegatorDeltaDelegateData

The delegate data.

delegate instance-attribute ¤

The delegate data.

DelegatorDeltaDelegateData ¤

Bases: TypedDict

A delegator delta delegate.

Attributes:

Name Type Description
amount str

The amount delegated/undelegated.

isUndelegate bool

Whether this is an undelegate operation.

validator str

The validator address.

amount instance-attribute ¤

amount: str

The amount delegated/undelegated.

isUndelegate instance-attribute ¤

isUndelegate: bool

Whether this is an undelegate operation.

validator instance-attribute ¤

validator: str

The validator address.

DelegatorDeltaWithdrawal ¤

Bases: TypedDict

A delegator delta withdrawal.

Attributes:

Name Type Description
withdrawal DelegatorDeltaWithdrawalData

The withdrawal data.

withdrawal instance-attribute ¤

The withdrawal data.

DelegatorDeltaWithdrawalData ¤

Bases: TypedDict

A delegator delta withdrawal.

Attributes:

Name Type Description
amount str

The withdrawal amount.

phase Literal['finalized', 'initiated']

The phase of the withdrawal.

amount instance-attribute ¤

amount: str

The withdrawal amount.

phase instance-attribute ¤

phase: Literal['finalized', 'initiated']

The phase of the withdrawal.

DelegatorHistoryItem ¤

Bases: TypedDict

A delegator history item.

Attributes:

Name Type Description
delta DelegatorDeltaDelegate | DelegatorDeltaWithdrawal | DelegatorDeltaCDeposit

The delta data for the history item.

hash str

The hash of the history item.

time int

The timestamp of the history item.

delta instance-attribute ¤

The delta data for the history item.

hash instance-attribute ¤

hash: str

The hash of the history item.

time instance-attribute ¤

time: int

The timestamp of the history item.

DelegatorHistoryRequest ¤

Bases: TypedDict

A request to retrieve a user's delegator history.

Attributes:

Name Type Description
type Literal['delegatorHistory']

The delegatorHistory request type.

user str

The user to get the delegator history for.

type instance-attribute ¤

type: Literal['delegatorHistory']

The delegatorHistory request type.

user instance-attribute ¤

user: str

The user to get the delegator history for.

DelegatorReward ¤

Bases: TypedDict

A delegator reward.

Attributes:

Name Type Description
source Literal['delegation', 'commission']

The source of the reward.

time str

The time of the reward.

totalAmount str

The total amount of the reward.

source instance-attribute ¤

source: Literal['delegation', 'commission']

The source of the reward.

time instance-attribute ¤

time: str

The time of the reward.

totalAmount instance-attribute ¤

totalAmount: str

The total amount of the reward.

DelegatorRewardsRequest ¤

Bases: TypedDict

A request to retrieve a user's delegator rewards.

Attributes:

Name Type Description
type Literal['delegatorRewards']

The delegatorRewards request type.

user str

The user to get the delegator rewards for.

type instance-attribute ¤

type: Literal['delegatorRewards']

The delegatorRewards request type.

user instance-attribute ¤

user: str

The user to get the delegator rewards for.

DelegatorSummaryRequest ¤

Bases: TypedDict

A request to retrieve a user's delegator summary.

Attributes:

Name Type Description
type Literal['delegatorSummary']

The delegatorSummary request type.

user str

The user to get the delegator summary for.

type instance-attribute ¤

type: Literal['delegatorSummary']

The delegatorSummary request type.

user instance-attribute ¤

user: str

The user to get the delegator summary for.

DelegatorSummaryResponse ¤

Bases: TypedDict

A response to a user's delegator summary request.

Attributes:

Name Type Description
delegated str

The amount delegated.

nPendingWithdrawals int

The number of pending withdrawals.

totalPendingWithdrawal str

The total pending withdrawal amount.

undelegated str

The amount undelegated.

delegated instance-attribute ¤

delegated: str

The amount delegated.

nPendingWithdrawals instance-attribute ¤

nPendingWithdrawals: int

The number of pending withdrawals.

totalPendingWithdrawal instance-attribute ¤

totalPendingWithdrawal: str

The total pending withdrawal amount.

undelegated instance-attribute ¤

undelegated: str

The amount undelegated.

DepositStakingAction ¤

Bases: TypedDict

An action to deposit a token into staking.

Attributes:

Name Type Description
hyperliquidChain str

The hyperliquid chain identifier.

nonce int

The nonce for the action.

signatureChainId str

The signature chain ID.

type Literal['cDeposit']

The action type.

wei int

The amount in wei.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

type instance-attribute ¤

type: Literal['cDeposit']

The action type.

wei instance-attribute ¤

wei: int

The amount in wei.

DepositStakingRequest ¤

Bases: TypedDict

A request to deposit a token into staking.

Attributes:

Name Type Description
action DepositStakingAction

The deposit staking action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The deposit staking action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

DepositStakingResponse ¤

Bases: TypedDict

A response from the exchange after depositing a token into staking.

Attributes:

Name Type Description
response DepositStakingResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

DepositStakingResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after depositing a token into staking.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

FeeSchedule ¤

Bases: TypedDict

A fee schedule.

Attributes:

Name Type Description
add str

The add liquidity fee rate.

cross str

The cross trading fee rate.

referralDiscount str

The referral discount amount.

spotAdd str

The spot add liquidity fee rate.

spotCross str

The spot cross trading fee rate.

stakingDiscountTiers list[StakingDiscountTier]

The staking discount tiers.

tiers FeeTiers

The fee tiers structure.

add instance-attribute ¤

add: str

The add liquidity fee rate.

cross instance-attribute ¤

cross: str

The cross trading fee rate.

referralDiscount instance-attribute ¤

referralDiscount: str

The referral discount amount.

spotAdd instance-attribute ¤

spotAdd: str

The spot add liquidity fee rate.

spotCross instance-attribute ¤

spotCross: str

The spot cross trading fee rate.

stakingDiscountTiers instance-attribute ¤

stakingDiscountTiers: list[StakingDiscountTier]

The staking discount tiers.

tiers instance-attribute ¤

tiers: FeeTiers

The fee tiers structure.

FeeTiers ¤

Bases: TypedDict

A fee tiers.

Attributes:

Name Type Description
mm list[MakerFractionCutoffTier]

The maker fraction cutoff tiers.

vip list[VipTier]

The VIP tiers.

mm instance-attribute ¤

The maker fraction cutoff tiers.

vip instance-attribute ¤

vip: list[VipTier]

The VIP tiers.

FrontendOpenOrder ¤

Bases: OpenOrder

An open order with additional frontend info.

Attributes:

Name Type Description
coin str

The asset of the order.

isPositionTpsl bool

Whether the order is a position take profit or stop loss order.

isTrigger bool

Whether the order is a trigger order.

limitPx str

The limit price of the order.

oid int

The order ID.

orderType Literal['Limit', 'Trigger']

The type of the order.

origSz str

The original size of the order.

reduceOnly bool

Whether the order is a reduce only order.

side Side

The side of the order.

sz str

The size of the order.

timestamp int

The timestamp of the order.

triggerCondition Literal['N/A']

The trigger condition of the order.

triggerPx str

The trigger price of the order.

coin instance-attribute ¤

coin: str

The asset of the order.

isPositionTpsl instance-attribute ¤

isPositionTpsl: bool

Whether the order is a position take profit or stop loss order.

isTrigger instance-attribute ¤

isTrigger: bool

Whether the order is a trigger order.

limitPx instance-attribute ¤

limitPx: str

The limit price of the order.

oid instance-attribute ¤

oid: int

The order ID.

orderType instance-attribute ¤

orderType: Literal['Limit', 'Trigger']

The type of the order.

origSz instance-attribute ¤

origSz: str

The original size of the order.

reduceOnly instance-attribute ¤

reduceOnly: bool

Whether the order is a reduce only order.

side instance-attribute ¤

side: Side

The side of the order.

sz instance-attribute ¤

sz: str

The size of the order.

timestamp instance-attribute ¤

timestamp: int

The timestamp of the order.

triggerCondition instance-attribute ¤

triggerCondition: Literal['N/A']

The trigger condition of the order.

triggerPx instance-attribute ¤

triggerPx: str

The trigger price of the order.

FrontendOpenOrdersRequest ¤

Bases: TypedDict

A request to retrieve a user's open orders with additional frontend info.

Attributes:

Name Type Description
type Literal['frontendOpenOrders']

The frontendOpenOrders request type.

user str

The user to get the open orders for.

type instance-attribute ¤

type: Literal['frontendOpenOrders']

The frontendOpenOrders request type.

user instance-attribute ¤

user: str

The user to get the open orders for.

FundingHistoryItem ¤

Bases: TypedDict

An entry in a funding history.

Attributes:

Name Type Description
coin str

The asset of the funding history item.

fundingRate str

The funding rate.

premium str

The premium.

time int

The timestamp of the funding history item.

coin instance-attribute ¤

coin: str

The asset of the funding history item.

fundingRate instance-attribute ¤

fundingRate: str

The funding rate.

premium instance-attribute ¤

premium: str

The premium.

time instance-attribute ¤

time: int

The timestamp of the funding history item.

FundingHistoryRequest ¤

Bases: TypedDict

A request to retrieve funding history.

Attributes:

Name Type Description
coin str

The asset to get the funding history for.

endTime NotRequired[int | None]

The end time for the funding history.

startTime int

The start time for the funding history.

type Literal['fundingHistory']

The fundingHistory request type.

coin instance-attribute ¤

coin: str

The asset to get the funding history for.

endTime instance-attribute ¤

endTime: NotRequired[int | None]

The end time for the funding history.

startTime instance-attribute ¤

startTime: int

The start time for the funding history.

type instance-attribute ¤

type: Literal['fundingHistory']

The fundingHistory request type.

GasAuction ¤

Bases: TypedDict

A gas auction.

Attributes:

Name Type Description
currentGas str | None

The current gas price.

durationSeconds int

The duration in seconds.

endGas str | None

The ending gas price.

startGas str

The starting gas price.

startTimeSeconds int

The start time in seconds.

currentGas instance-attribute ¤

currentGas: str | None

The current gas price.

durationSeconds instance-attribute ¤

durationSeconds: int

The duration in seconds.

endGas instance-attribute ¤

endGas: str | None

The ending gas price.

startGas instance-attribute ¤

startGas: str

The starting gas price.

startTimeSeconds instance-attribute ¤

startTimeSeconds: int

The start time in seconds.

GenesisTokenDetails ¤

Bases: TypedDict

A token's genesis details.

Attributes:

Name Type Description
existingTokenBalances list[list[int | str]]

The existing token balances in the genesis.

userBalances list[list[str]]

The user balances in the genesis.

existingTokenBalances instance-attribute ¤

existingTokenBalances: list[list[int | str]]

The existing token balances in the genesis.

userBalances instance-attribute ¤

userBalances: list[list[str]]

The user balances in the genesis.

HistoricalOrdersRequest ¤

Bases: TypedDict

A request to retrieve a user's historical orders.

Attributes:

Name Type Description
type Literal['historicalOrders']

The historicalOrders request type.

user str

The user to get the historical orders for.

type instance-attribute ¤

type: Literal['historicalOrders']

The historicalOrders request type.

user instance-attribute ¤

user: str

The user to get the historical orders for.

L2Book ¤

Bases: TypedDict

L2 book data.

Attributes:

Name Type Description
coin str

The asset of the L2 book.

levels list[list[L2Level]]

The L2 levels for the bid and ask sides of the L2 book. The first list is the bid side, the second is the ask side.

time int

The timestamp of the L2 book.

coin instance-attribute ¤

coin: str

The asset of the L2 book.

levels instance-attribute ¤

levels: list[list[L2Level]]

The L2 levels for the bid and ask sides of the L2 book. The first list is the bid side, the second is the ask side.

time instance-attribute ¤

time: int

The timestamp of the L2 book.

L2BookMsg ¤

Bases: TypedDict

A message from the exchange containing the L2 book for a given coin. Response to an :obj:L2BookSubscription.

Attributes:

Name Type Description
channel Literal['l2Book']

The channel of the message set to l2Book.

data L2Book

The L2 book data.

channel instance-attribute ¤

channel: Literal['l2Book']

The channel of the message set to l2Book.

data instance-attribute ¤

data: L2Book

The L2 book data.

L2BookRequest ¤

Bases: TypedDict

A request to retrieve the L2 book for a given coin.

Attributes:

Name Type Description
coin str

The asset to get the L2 book data for.

mantissa NotRequired[int | None]

The mantissa to use for the L2 book.

nSigFigs NotRequired[int | None]

The number of significant figures to use for the L2 book.

type Literal['l2Book']

The l2Book request type.

coin instance-attribute ¤

coin: str

The asset to get the L2 book data for.

mantissa instance-attribute ¤

mantissa: NotRequired[int | None]

The mantissa to use for the L2 book.

nSigFigs instance-attribute ¤

nSigFigs: NotRequired[int | None]

The number of significant figures to use for the L2 book.

type instance-attribute ¤

type: Literal['l2Book']

The l2Book request type.

L2BookSubscription ¤

Bases: TypedDict

Subscribe to the L2 book.

Attributes:

Name Type Description
coin str

The asset to subscribe to.

mantissa NotRequired[int]

The mantissa to use for the L2 book.

nSigFigs NotRequired[int]

The number of significant figures to use for the L2 book.

type Literal['l2Book']

The subscription type.

coin instance-attribute ¤

coin: str

The asset to subscribe to.

mantissa instance-attribute ¤

mantissa: NotRequired[int]

The mantissa to use for the L2 book.

nSigFigs instance-attribute ¤

nSigFigs: NotRequired[int]

The number of significant figures to use for the L2 book.

type instance-attribute ¤

type: Literal['l2Book']

The subscription type.

L2Level ¤

Bases: TypedDict

An entry on one side of the L2 book.

Attributes:

Name Type Description
n int

The number of orders at the L2 level.

px str

The price of the L2 level.

sz str

The size of the L2 level.

n instance-attribute ¤

n: int

The number of orders at the L2 level.

px instance-attribute ¤

px: str

The price of the L2 level.

sz instance-attribute ¤

sz: str

The size of the L2 level.

Leverage ¤

Bases: TypedDict

The leverage of a position.

Attributes:

Name Type Description
type Literal['cross', 'isolated']

The type of leverage (cross or isolated).

value int

The leverage value.

type instance-attribute ¤

type: Literal['cross', 'isolated']

The type of leverage (cross or isolated).

value instance-attribute ¤

value: int

The leverage value.

LimitOrderType ¤

Bases: TypedDict

Limit parameters for an order.

Attributes:

Name Type Description
tif Tif

The time in force setting.

type Literal['limit']

The order type.

tif instance-attribute ¤

tif: Tif

The time in force setting.

type instance-attribute ¤

type: Literal['limit']

The order type.

LimitOrderTypeWire ¤

Bases: TypedDict

Serialized limit parameters for an order.

Attributes:

Name Type Description
limit LimitOrderTypeWireData

The limit order data.

limit instance-attribute ¤

The limit order data.

LimitOrderTypeWireData ¤

Bases: TypedDict

Specific time in force for a limit order.

Attributes:

Name Type Description
tif Tif

The time in force setting.

tif instance-attribute ¤

tif: Tif

The time in force setting.

MakerFractionCutoffTier ¤

Bases: TypedDict

A maker fraction cutoff tier.

Attributes:

Name Type Description
add str

The add of the maker fraction cutoff tier.

makerFractionCutoff str

The maker fraction cutoff of the maker fraction cutoff tier.

add instance-attribute ¤

add: str

The add of the maker fraction cutoff tier.

makerFractionCutoff instance-attribute ¤

makerFractionCutoff: str

The maker fraction cutoff of the maker fraction cutoff tier.

MarginSummary ¤

Bases: TypedDict

A summary of either the cross or total account margin.

Attributes:

Name Type Description
accountValue str

The account value.

totalMarginUsed str

The total margin used.

totalNtlPos str

The total notional position.

totalRawUsd str

The total raw USD.

accountValue instance-attribute ¤

accountValue: str

The account value.

totalMarginUsed instance-attribute ¤

totalMarginUsed: str

The total margin used.

totalNtlPos instance-attribute ¤

totalNtlPos: str

The total notional position.

totalRawUsd instance-attribute ¤

totalRawUsd: str

The total raw USD.

MarginTable ¤

Bases: TypedDict

A margin table.

Attributes:

Name Type Description
description str

The description of the margin table.

marginTiers list[MarginTier]

The margin tiers in the table.

description instance-attribute ¤

description: str

The description of the margin table.

marginTiers instance-attribute ¤

marginTiers: list[MarginTier]

The margin tiers in the table.

MarginTier ¤

Bases: TypedDict

A margin tier.

Attributes:

Name Type Description
lowerBound str

The lower bound of the margin tier.

maxLeverage int

The maximum leverage for this tier.

lowerBound instance-attribute ¤

lowerBound: str

The lower bound of the margin tier.

maxLeverage instance-attribute ¤

maxLeverage: int

The maximum leverage for this tier.

MaxBuilderFeeRequest ¤

Bases: TypedDict

A request to retrieve the max builder fee.

Attributes:

Name Type Description
builder str

The builder to get the max builder fee for.

type Literal['maxBuilderFee']

The maxBuilderFee request type.

user str

The user to get the max builder fee for.

builder instance-attribute ¤

builder: str

The builder to get the max builder fee for.

type instance-attribute ¤

type: Literal['maxBuilderFee']

The maxBuilderFee request type.

user instance-attribute ¤

user: str

The user to get the max builder fee for.

Meta ¤

Bases: TypedDict

Perpetual metadata.

Attributes:

Name Type Description
marginTables list[tuple[int, MarginTable]]

The margin tables for different assets.

universe list[AssetMeta]

The list of asset metadata.

marginTables instance-attribute ¤

marginTables: list[tuple[int, MarginTable]]

The margin tables for different assets.

universe instance-attribute ¤

universe: list[AssetMeta]

The list of asset metadata.

MetaAndAssetCtxsRequest ¤

Bases: TypedDict

A request to retrieve perpetual metadata and asset context.

MetaRequest ¤

Bases: TypedDict

A request to retrieve perpetual metadata.

MissingUserRoleResponse ¤

Bases: TypedDict

A response to a user role request for a missing user.

Attributes:

Name Type Description
role Literal['missing']

The role missing.

role instance-attribute ¤

role: Literal['missing']

The role missing.

ModifyAction ¤

Bases: TypedDict

An action to modify an order.

Attributes:

Name Type Description
oid int | str

The order ID to modify.

order OrderWire

The new order details.

type Literal['modify']

The action type.

oid instance-attribute ¤

oid: int | str

The order ID to modify.

order instance-attribute ¤

order: OrderWire

The new order details.

type instance-attribute ¤

type: Literal['modify']

The action type.

ModifyParams ¤

Bases: TypedDict

Parameters for a request to modify an order.

Attributes:

Name Type Description
order OrderParams

The new order parameters.

order_id int | Cloid

The order ID or client order ID.

order instance-attribute ¤

order: OrderParams

The new order parameters.

order_id instance-attribute ¤

order_id: int | Cloid

The order ID or client order ID.

ModifyRequest ¤

Bases: TypedDict

A request to modify an order.

Attributes:

Name Type Description
action ModifyAction

The modify action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

action: ModifyAction

The modify action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

ModifyResponse ¤

Bases: TypedDict

A response from the exchange after modifying an order.

Attributes:

Name Type Description
response ModifyResponseResponse

The response content.

status Literal['ok']

The response status.

response instance-attribute ¤

The response content.

status instance-attribute ¤

status: Literal['ok']

The response status.

ModifyResponseResponse ¤

Bases: TypedDict

The response from the exchange after modifying an order.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

ModifyWire ¤

Bases: TypedDict

A request to modify an order.

Attributes:

Name Type Description
oid int | str

The order ID to modify.

order OrderWire

The new order details.

oid instance-attribute ¤

oid: int | str

The order ID to modify.

order instance-attribute ¤

order: OrderWire

The new order details.

MultiSigAction ¤

Bases: TypedDict

An action to perform a multi-sig transaction.

Attributes:

Name Type Description
payload MultiSigActionPayload

The multi-sig action payload.

signatures list[Signature]

The list of signatures.

type Literal['multiSig']

The action type.

payload instance-attribute ¤

The multi-sig action payload.

signatures instance-attribute ¤

signatures: list[Signature]

The list of signatures.

type instance-attribute ¤

type: Literal['multiSig']

The action type.

MultiSigActionPayload ¤

Bases: TypedDict

The payload of a multi-sig action.

Attributes:

Name Type Description
action 'Action'

The action to be performed.

multiSigUser str

The multi-sig user address.

outerSigner str

The outer signer address.

action instance-attribute ¤

action: 'Action'

The action to be performed.

multiSigUser instance-attribute ¤

multiSigUser: str

The multi-sig user address.

outerSigner instance-attribute ¤

outerSigner: str

The outer signer address.

MultiSigRequest ¤

Bases: TypedDict

A request to perform a multi-sig transaction.

Attributes:

Name Type Description
action MultiSigAction

The multi-sig action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The multi-sig action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

MultiSigResponse ¤

Bases: TypedDict

A response from the exchange after performing a multi-sig transaction.

Attributes:

Name Type Description
todo FIXME

Placeholder field - not documented in API docs.

todo instance-attribute ¤

todo: FIXME

Placeholder field - not documented in API docs.

NeedToCreateCodeReferrerState ¤

Bases: TypedDict

A referrer state when the referrer needs to create a code.

Attributes:

Name Type Description
stage Literal['needToCreateCode']

The stage of the referrer state.

stage instance-attribute ¤

stage: Literal['needToCreateCode']

The stage of the referrer state.

Network ¤

Bases: TypedDict

A network such as Mainnet or Testnet.

Attributes:

Name Type Description
api_url str

The API URL for the network.

name str

The name of the network.

phantom_agent_source str

The phantom agent source for the network.

signature_chain_id str

The signature chain ID for the network.

ws_url str

The WebSocket URL for the network.

api_url instance-attribute ¤

api_url: str

The API URL for the network.

name instance-attribute ¤

name: str

The name of the network.

phantom_agent_source instance-attribute ¤

phantom_agent_source: str

The phantom agent source for the network.

signature_chain_id instance-attribute ¤

signature_chain_id: str

The signature chain ID for the network.

ws_url instance-attribute ¤

ws_url: str

The WebSocket URL for the network.

NonUserCancel ¤

Bases: TypedDict

A non-user cancel.

Attributes:

Name Type Description
coin str

The asset of the cancelled order.

oid int

The order ID that was cancelled.

coin instance-attribute ¤

coin: str

The asset of the cancelled order.

oid instance-attribute ¤

oid: int

The order ID that was cancelled.

NonUserCancelEvent ¤

Bases: TypedDict

The payload of a message from the exchange containing a non-user cancel. Response to a :obj:NonUserCancelsSubscription.

Attributes:

Name Type Description
nonUserCancel list[NonUserCancel]

List of non-user cancels.

nonUserCancel instance-attribute ¤

nonUserCancel: list[NonUserCancel]

List of non-user cancels.

Notification ¤

Bases: TypedDict

A notification.

Attributes:

Name Type Description
notification str

The notification message.

notification instance-attribute ¤

notification: str

The notification message.

NotificationMsg ¤

Bases: TypedDict

A message from the exchange containing a notification. Response to a :obj:NotificationSubscription.

Attributes:

Name Type Description
channel Literal['notification']

The channel of the message set to notification.

data Notification

The notification data.

channel instance-attribute ¤

channel: Literal['notification']

The channel of the message set to notification.

data instance-attribute ¤

The notification data.

NotificationSubscription ¤

Bases: TypedDict

Subscribe to notifications.

Attributes:

Name Type Description
type Literal['notification']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['notification']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

OpenOrder ¤

Bases: TypedDict

An open order.

Attributes:

Name Type Description
coin str

The asset of the order.

limitPx str

The limit price of the order.

oid int

The order ID.

origSz str

The original size of the order.

side Side

The side of the order.

sz str

The size of the order.

timestamp int

The timestamp of the order.

coin instance-attribute ¤

coin: str

The asset of the order.

limitPx instance-attribute ¤

limitPx: str

The limit price of the order.

oid instance-attribute ¤

oid: int

The order ID.

origSz instance-attribute ¤

origSz: str

The original size of the order.

side instance-attribute ¤

side: Side

The side of the order.

sz instance-attribute ¤

sz: str

The size of the order.

timestamp instance-attribute ¤

timestamp: int

The timestamp of the order.

OpenOrdersRequest ¤

Bases: TypedDict

A request to retrieve a user's open orders.

Attributes:

Name Type Description
type Literal['openOrders']

The openOrders request type.

user str

The user to get the open orders for.

type instance-attribute ¤

type: Literal['openOrders']

The openOrders request type.

user instance-attribute ¤

user: str

The user to get the open orders for.

OrderAction ¤

Bases: TypedDict

An action to place one or more orders.

Attributes:

Name Type Description
builder NotRequired[BuilderOptions]

The builder options.

grouping Grouping

The grouping for the orders.

orders list[OrderWire]

The list of orders to place.

type Literal['order']

The action type.

builder instance-attribute ¤

The builder options.

grouping instance-attribute ¤

grouping: Grouping

The grouping for the orders.

orders instance-attribute ¤

orders: list[OrderWire]

The list of orders to place.

type instance-attribute ¤

type: Literal['order']

The action type.

OrderIdData ¤

Bases: TypedDict

The id of a placed order.

Attributes:

Name Type Description
cloid NotRequired[str]

The client order ID.

oid int

The order ID.

cloid instance-attribute ¤

cloid: NotRequired[str]

The client order ID.

oid instance-attribute ¤

oid: int

The order ID.

OrderParams ¤

Bases: TypedDict

Parameters for an order. Used for high-level order creation.

Attributes:

Name Type Description
asset int | str

The asset ID or name.

cloid NotRequired[Cloid | None]

The client order ID.

is_buy bool

Whether this is a buy order.

limit_price Decimal

The limit price for the order.

order_type OrderType

The order type (limit or trigger).

reduce_only bool

Whether this is a reduce-only order.

size Decimal

The size of the order.

asset instance-attribute ¤

asset: int | str

The asset ID or name.

cloid instance-attribute ¤

cloid: NotRequired[Cloid | None]

The client order ID.

is_buy instance-attribute ¤

is_buy: bool

Whether this is a buy order.

limit_price instance-attribute ¤

limit_price: Decimal

The limit price for the order.

order_type instance-attribute ¤

order_type: OrderType

The order type (limit or trigger).

reduce_only instance-attribute ¤

reduce_only: bool

Whether this is a reduce-only order.

size instance-attribute ¤

size: Decimal

The size of the order.

OrderRequest ¤

Bases: TypedDict

A request to place one or more orders.

Attributes:

Name Type Description
action OrderAction

The order action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

action: OrderAction

The order action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

OrderResponse ¤

Bases: TypedDict

A response from the exchange after placing an order.

Attributes:

Name Type Description
response OrderResponseResponse

The response content.

status Literal['ok']

The response status.

response instance-attribute ¤

The response content.

status instance-attribute ¤

status: Literal['ok']

The response status.

OrderResponseData ¤

Bases: TypedDict

The statuses of the orders in a response from the exchange after placing an order.

Attributes:

Name Type Description
statuses list[OrderResponseDataStatus]

The list of order statuses.

statuses instance-attribute ¤

The list of order statuses.

OrderResponseDataStatusError ¤

Bases: TypedDict

The status of an order that failed to be placed.

Attributes:

Name Type Description
error str

The error message.

error instance-attribute ¤

error: str

The error message.

OrderResponseDataStatusFilled ¤

Bases: TypedDict

The status of a filled order.

Attributes:

Name Type Description
filled OrderResponseFill

The fill details.

filled instance-attribute ¤

The fill details.

OrderResponseDataStatusResting ¤

Bases: TypedDict

The status of an order that is still resting.

Attributes:

Name Type Description
resting OrderIdData

The order ID data for the resting order.

resting instance-attribute ¤

resting: OrderIdData

The order ID data for the resting order.

OrderResponseFill ¤

Bases: TypedDict

The details of a fill of a filled order.

Attributes:

Name Type Description
avgPx str

The average price of the fill.

oid int

The order ID.

totalSz str

The total size filled.

avgPx instance-attribute ¤

avgPx: str

The average price of the fill.

oid instance-attribute ¤

oid: int

The order ID.

totalSz instance-attribute ¤

totalSz: str

The total size filled.

OrderResponseResponse ¤

Bases: TypedDict

The content of a response from the exchange after placing an order.

Attributes:

Name Type Description
data OrderResponseData

The order response data.

type Literal['order']

The response type.

data instance-attribute ¤

The order response data.

type instance-attribute ¤

type: Literal['order']

The response type.

OrderStatus ¤

Bases: TypedDict

The status of an order.

Attributes:

Name Type Description
order OrderStatusData

The order status data.

status OrderStatusValue

The status of the order.

statusTimestamp int

The timestamp of the status of the order.

order instance-attribute ¤

The order status data.

status instance-attribute ¤

The status of the order.

statusTimestamp instance-attribute ¤

statusTimestamp: int

The timestamp of the status of the order.

OrderStatusData ¤

Bases: TypedDict

The data for an order status.

Attributes:

Name Type Description
children list[FIXME]

The children of the order.

cloid str | None

The cloid of the order.

coin str

The asset of the order.

isPositionTpsl bool

Whether the order is a position take profit or stop loss order.

isTrigger bool

Whether the order is a trigger order.

limitPx str

The limit price of the order.

oid int

The order ID.

orderType Literal['Limit', 'Trigger', 'Market']

The type of the order.

origSz str

The original size of the order.

reduceOnly bool

Whether the order is a reduce only order.

side Side

The side of the order.

sz str

The size of the order.

tif Literal['FrontendMarket', 'Gtc']

The time in force of the order.

timestamp int

The timestamp of the order.

triggerCondition Literal['N/A']

The trigger condition of the order.

triggerPx str

The trigger price of the order.

children instance-attribute ¤

children: list[FIXME]

The children of the order.

cloid instance-attribute ¤

cloid: str | None

The cloid of the order.

coin instance-attribute ¤

coin: str

The asset of the order.

isPositionTpsl instance-attribute ¤

isPositionTpsl: bool

Whether the order is a position take profit or stop loss order.

isTrigger instance-attribute ¤

isTrigger: bool

Whether the order is a trigger order.

limitPx instance-attribute ¤

limitPx: str

The limit price of the order.

oid instance-attribute ¤

oid: int

The order ID.

orderType instance-attribute ¤

orderType: Literal['Limit', 'Trigger', 'Market']

The type of the order.

origSz instance-attribute ¤

origSz: str

The original size of the order.

reduceOnly instance-attribute ¤

reduceOnly: bool

Whether the order is a reduce only order.

side instance-attribute ¤

side: Side

The side of the order.

sz instance-attribute ¤

sz: str

The size of the order.

tif instance-attribute ¤

tif: Literal['FrontendMarket', 'Gtc']

The time in force of the order.

timestamp instance-attribute ¤

timestamp: int

The timestamp of the order.

triggerCondition instance-attribute ¤

triggerCondition: Literal['N/A']

The trigger condition of the order.

triggerPx instance-attribute ¤

triggerPx: str

The trigger price of the order.

OrderStatusRequest ¤

Bases: TypedDict

A request to retrieve the status of an order.

Attributes:

Name Type Description
oid int | str

The order ID to get the status for.

type Literal['orderStatus']

The orderStatus request type.

user str

The user to get the order status for.

oid instance-attribute ¤

oid: int | str

The order ID to get the status for.

type instance-attribute ¤

type: Literal['orderStatus']

The orderStatus request type.

user instance-attribute ¤

user: str

The user to get the order status for.

OrderStatusResponse ¤

Bases: TypedDict

The response to a request for the status of an order.

Attributes:

Name Type Description
order OrderStatus

The order data.

status Literal['order']

The status of the response (always "order").

order instance-attribute ¤

order: OrderStatus

The order data.

status instance-attribute ¤

status: Literal['order']

The status of the response (always "order").

OrderUpdate ¤

Bases: TypedDict

A single order update.

Attributes:

Name Type Description
order OpenOrder

The order data.

status OrderStatusValue

The status of the order.

statusTimestamp int

The timestamp of the status change.

order instance-attribute ¤

order: OpenOrder

The order data.

status instance-attribute ¤

The status of the order.

statusTimestamp instance-attribute ¤

statusTimestamp: int

The timestamp of the status change.

OrderUpdatesMsg ¤

Bases: TypedDict

A message from the exchange containing order updates. Response to an :obj:OrderUpdatesSubscription.

Attributes:

Name Type Description
channel Literal['orderUpdates']

The channel of the message set to orderUpdates.

data list[OrderUpdate]

List of order updates.

channel instance-attribute ¤

channel: Literal['orderUpdates']

The channel of the message set to orderUpdates.

data instance-attribute ¤

List of order updates.

OrderUpdatesSubscription ¤

Bases: TypedDict

Subscribe to order updates.

Attributes:

Name Type Description
type Literal['orderUpdates']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['orderUpdates']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

OrderWire ¤

Bases: TypedDict

Serialized order to be sent to the exchange.

Attributes:

Name Type Description
a int

The asset ID.

b bool

Whether this is a buy order.

c NotRequired[str | None]

The client order ID.

p str

The price.

r bool

Whether this is a reduce-only order.

s str

The size.

t OrderTypeWire

The order type data.

a instance-attribute ¤

a: int

The asset ID.

b instance-attribute ¤

b: bool

Whether this is a buy order.

c instance-attribute ¤

c: NotRequired[str | None]

The client order ID.

p instance-attribute ¤

p: str

The price.

r instance-attribute ¤

r: bool

Whether this is a reduce-only order.

s instance-attribute ¤

s: str

The size.

t instance-attribute ¤

The order type data.

PerpDeployAuctionStatusRequest ¤

Bases: TypedDict

A request to retrieve perp deploy auction status.

PerpDeployAuctionStatusResponse ¤

Bases: TypedDict

The perp deploy auction status as a response to a perp deploy auction status request.

Attributes:

Name Type Description
currentGas str | None

The current gas price.

durationSeconds int

The duration in seconds.

endGas str | None

The ending gas price.

startGas str

The starting gas price.

startTimeSeconds int

The start time in seconds.

currentGas instance-attribute ¤

currentGas: str | None

The current gas price.

durationSeconds instance-attribute ¤

durationSeconds: int

The duration in seconds.

endGas instance-attribute ¤

endGas: str | None

The ending gas price.

startGas instance-attribute ¤

startGas: str

The starting gas price.

startTimeSeconds instance-attribute ¤

startTimeSeconds: int

The start time in seconds.

PerpDex ¤

Bases: TypedDict

A perp dex.

Attributes:

Name Type Description
deployer str

The deployer address.

full_name str

The full name of the perp dex.

name str

The name of the perp dex.

oracle_updater str | None

The oracle updater address.

deployer instance-attribute ¤

deployer: str

The deployer address.

full_name instance-attribute ¤

full_name: str

The full name of the perp dex.

name instance-attribute ¤

name: str

The name of the perp dex.

oracle_updater instance-attribute ¤

oracle_updater: str | None

The oracle updater address.

PerpDexClassTransferAction ¤

Bases: TypedDict

An action to transfer a token from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
amount str

The amount to transfer.

dex str

The dex identifier.

hyperliquidChain str

The hyperliquid chain identifier.

nonce int

The nonce for the action.

signatureChainId str

The signature chain ID.

toPerp bool

Whether to transfer to perpetuals or from perpetuals.

token str

The token to transfer.

type Literal['perpDexClassTransfer']

The action type.

amount instance-attribute ¤

amount: str

The amount to transfer.

dex instance-attribute ¤

dex: str

The dex identifier.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

toPerp instance-attribute ¤

toPerp: bool

Whether to transfer to perpetuals or from perpetuals.

token instance-attribute ¤

token: str

The token to transfer.

type instance-attribute ¤

type: Literal['perpDexClassTransfer']

The action type.

PerpDexClassTransferRequest ¤

Bases: TypedDict

A request to transfer a token from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
action PerpDexClassTransferAction

The perp dex class transfer action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The perp dex class transfer action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

PerpDexClassTransferResponse ¤

Bases: TypedDict

A response from the exchange after transferring a token from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
response PerpDexClassTransferResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

PerpDexClassTransferResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after transferring a token from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

PerpDexsRequest ¤

Bases: TypedDict

A request to retrieve perp dexs.

PerpsAtOpenInterestCapRequest ¤

Bases: TypedDict

A request to retrieve perps at open interest cap.

Ping ¤

Bases: TypedDict

A request to ping the exchange.

Attributes:

Name Type Description
method Literal['ping']

The method set to ping.

method instance-attribute ¤

method: Literal['ping']

The method set to ping.

PongMsg ¤

Bases: TypedDict

A message from the exchange indicating a ping was received. Response to a :obj:Ping.

Attributes:

Name Type Description
channel Literal['pong']

The channel of the message set to pong.

channel instance-attribute ¤

channel: Literal['pong']

The channel of the message set to pong.

PortfolioItem ¤

Bases: TypedDict

A portfolio item.

Attributes:

Name Type Description
accountValueHistory list[list[int | str]]

The account value history of the portfolio. Inner list is always [timestamp: int, value: str]

pnlHistory list[list[int | str]]

The PNL history of the portfolio. Inner list is always [timestamp: int, value: str]

vlm str

The VLM of the portfolio.

accountValueHistory instance-attribute ¤

accountValueHistory: list[list[int | str]]

The account value history of the portfolio. Inner list is always [timestamp: int, value: str]

pnlHistory instance-attribute ¤

pnlHistory: list[list[int | str]]

The PNL history of the portfolio. Inner list is always [timestamp: int, value: str]

vlm instance-attribute ¤

vlm: str

The VLM of the portfolio.

PortfolioRequest ¤

Bases: TypedDict

A request to retrieve a user's portfolio.

Attributes:

Name Type Description
type Literal['portfolio']

The portfolio request type.

user str

The user to get the portfolio for.

type instance-attribute ¤

type: Literal['portfolio']

The portfolio request type.

user instance-attribute ¤

user: str

The user to get the portfolio for.

Position ¤

Bases: TypedDict

Details of a user's position in a perpetual asset.

Attributes:

Name Type Description
coin str

The asset of the position.

cumFunding CumFunding

The cumulative funding data.

entryPx str

The entry price of the position.

leverage Leverage

The leverage information.

liquidationPx str | None

The liquidation price.

marginUsed str

The margin used for the position.

maxLeverage int

The maximum leverage allowed.

positionValue str

The value of the position.

returnOnEquity str

The return on equity.

szi str

The size of the position.

unrealizedPnl str

The unrealized PnL.

coin instance-attribute ¤

coin: str

The asset of the position.

cumFunding instance-attribute ¤

cumFunding: CumFunding

The cumulative funding data.

entryPx instance-attribute ¤

entryPx: str

The entry price of the position.

leverage instance-attribute ¤

leverage: Leverage

The leverage information.

liquidationPx instance-attribute ¤

liquidationPx: str | None

The liquidation price.

marginUsed instance-attribute ¤

marginUsed: str

The margin used for the position.

maxLeverage instance-attribute ¤

maxLeverage: int

The maximum leverage allowed.

positionValue instance-attribute ¤

positionValue: str

The value of the position.

returnOnEquity instance-attribute ¤

returnOnEquity: str

The return on equity.

szi instance-attribute ¤

szi: str

The size of the position.

unrealizedPnl instance-attribute ¤

unrealizedPnl: str

The unrealized PnL.

PostData ¤

Bases: TypedDict

The data of a response from the exchange after sending a :obj:PostRequest.

Attributes:

Name Type Description
id int

The request ID.

response PostResponseInfo | PostResponseExchange

The response data.

id instance-attribute ¤

id: int

The request ID.

response instance-attribute ¤

The response data.

PostMsg ¤

Bases: TypedDict

A message from the exchange containing the response to a :obj:PostRequest.

Attributes:

Name Type Description
channel Literal['post']

The channel of the message set to post.

data PostData

The post response data.

channel instance-attribute ¤

channel: Literal['post']

The channel of the message set to post.

data instance-attribute ¤

data: PostData

The post response data.

PostRequest ¤

Bases: TypedDict

A request to send to the websocket API via the post method.

Attributes:

Name Type Description
id int

The request ID.

method Literal['post']

The method set to post.

request PostRequestInfo | PostRequestExchange

The request details.

id instance-attribute ¤

id: int

The request ID.

method instance-attribute ¤

method: Literal['post']

The method set to post.

request instance-attribute ¤

The request details.

PostRequestExchange ¤

Bases: TypedDict

A request to send to the websocket API via the post method to the /exchange endpoint.

Attributes:

Name Type Description
payload ExchangeRequest

The exchange request payload.

type Literal['exchange']

The request type.

payload instance-attribute ¤

payload: ExchangeRequest

The exchange request payload.

type instance-attribute ¤

type: Literal['exchange']

The request type.

PostRequestInfo ¤

Bases: TypedDict

A request to send to the websocket API via the post method to the /info endpoint.

Attributes:

Name Type Description
payload InfoRequest

The info request payload.

type Literal['info']

The request type.

payload instance-attribute ¤

payload: InfoRequest

The info request payload.

type instance-attribute ¤

type: Literal['info']

The request type.

PostResponseExchange ¤

Bases: TypedDict

The value of a response from the exchange after sending a /exchange :obj:PostRequest.

Attributes:

Name Type Description
payload ExchangeResponse

The exchange response payload.

type Literal['exchange']

The response type.

payload instance-attribute ¤

The exchange response payload.

type instance-attribute ¤

type: Literal['exchange']

The response type.

PostResponseInfo ¤

Bases: TypedDict

The value of a response from the exchange after sending a /info :obj:PostRequest.

Attributes:

Name Type Description
payload InfoResponse

The info response payload.

type Literal['info']

The response type.

payload instance-attribute ¤

payload: InfoResponse

The info response payload.

type instance-attribute ¤

type: Literal['info']

The response type.

PredictedFundingRate ¤

Bases: TypedDict

A predicted funding rate.

Attributes:

Name Type Description
fundingRate str

The predicted funding rate.

nextFundingTime int

The next funding time.

fundingRate instance-attribute ¤

fundingRate: str

The predicted funding rate.

nextFundingTime instance-attribute ¤

nextFundingTime: int

The next funding time.

PredictedFundingsRequest ¤

Bases: TypedDict

A request to retrieve predicted fundings.

ReadyReferrerState ¤

Bases: TypedDict

A referrer state when the referrer is ready.

Attributes:

Name Type Description
data ReadyReferrerStateData

The data of the referrer state.

stage Literal['ready']

The stage of the referrer state.

data instance-attribute ¤

The data of the referrer state.

stage instance-attribute ¤

stage: Literal['ready']

The stage of the referrer state.

ReadyReferrerStateData ¤

Bases: TypedDict

Data for a ready referrer state.

Attributes:

Name Type Description
code str

Referrer's code

referralStates list[ReferralState]

The referral states of the referrer.

code instance-attribute ¤

code: str

Referrer's code

referralStates instance-attribute ¤

referralStates: list[ReferralState]

The referral states of the referrer.

ReferralRequest ¤

Bases: TypedDict

A request to retrieve a user's referral.

Attributes:

Name Type Description
type Literal['referral']

The referral request type.

user str

The user to get the referral for.

type instance-attribute ¤

type: Literal['referral']

The referral request type.

user instance-attribute ¤

user: str

The user to get the referral for.

ReferralResponse ¤

Bases: TypedDict

A referral response.

Attributes:

Name Type Description
builderRewards str

The builder rewards of the referral.

claimedRewards str

The claimed rewards of the referral.

cumVlm str

The cumulative VLM of the referral.

referredBy ReferredBy | None

The referred by of the referral.

referrerState ReferrerState

The referrer state of the referral.

rewardHistory list[list[int | str]]

Legacy field

unclaimedRewards str

The unclaimed rewards of the referral.

builderRewards instance-attribute ¤

builderRewards: str

The builder rewards of the referral.

claimedRewards instance-attribute ¤

claimedRewards: str

The claimed rewards of the referral.

cumVlm instance-attribute ¤

cumVlm: str

The cumulative VLM of the referral.

referredBy instance-attribute ¤

referredBy: ReferredBy | None

The referred by of the referral.

referrerState instance-attribute ¤

referrerState: ReferrerState

The referrer state of the referral.

rewardHistory instance-attribute ¤

rewardHistory: list[list[int | str]]

Legacy field

unclaimedRewards instance-attribute ¤

unclaimedRewards: str

The unclaimed rewards of the referral.

ReferralState ¤

Bases: TypedDict

A referral state.

Attributes:

Name Type Description
cumFeesRewardedToReferrer str

Cumulative fees rewarded to referrer

cumRewardedFeesSinceReferred str

Cumulative rewarded fees since referred

cumVlm str

Cumulative VLM

timeJoined int

Time joined

user str

User's address

cumFeesRewardedToReferrer instance-attribute ¤

cumFeesRewardedToReferrer: str

Cumulative fees rewarded to referrer

cumRewardedFeesSinceReferred instance-attribute ¤

cumRewardedFeesSinceReferred: str

Cumulative rewarded fees since referred

cumVlm instance-attribute ¤

cumVlm: str

Cumulative VLM

timeJoined instance-attribute ¤

timeJoined: int

Time joined

user instance-attribute ¤

user: str

User's address

ReferredBy ¤

Bases: TypedDict

A referred by.

Attributes:

Name Type Description
name str

Referrer's name

referrer str

Referrer's address

name instance-attribute ¤

name: str

Referrer's name

referrer instance-attribute ¤

referrer: str

Referrer's address

RegisterReferrerAction ¤

Bases: TypedDict

An action to register a referrer.

Attributes:

Name Type Description
code str

The referrer code.

type Literal['registerReferrer']

The action type.

code instance-attribute ¤

code: str

The referrer code.

type instance-attribute ¤

type: Literal['registerReferrer']

The action type.

RegisterReferrerRequest ¤

Bases: TypedDict

A request to register a referrer.

Attributes:

Name Type Description
action RegisterReferrerAction

The register referrer action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The register referrer action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

RegisterReferrerResponse ¤

Bases: TypedDict

A response from the exchange after registering a referrer.

Attributes:

Name Type Description
response RegisterReferrerResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

RegisterReferrerResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after registering a referrer.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

ReserveRequestWeightAction ¤

Bases: TypedDict

An action to reserve additional request weight.

Attributes:

Name Type Description
type Literal['reserveRequestWeight']

The action type.

weight int

The amount of request weight to reserve.

type instance-attribute ¤

type: Literal['reserveRequestWeight']

The action type.

weight instance-attribute ¤

weight: int

The amount of request weight to reserve.

ReserveRequestWeightRequest ¤

Bases: TypedDict

A request to reserve additional request weight.

Attributes:

Name Type Description
action ReserveRequestWeightAction

The reserve request weight action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The reserve request weight action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

ReserveRequestWeightResponse ¤

Bases: TypedDict

A response to a request to reserve additional request weight.

Attributes:

Name Type Description
response ReserveRequestWeightResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

ReserveRequestWeightResponseBody ¤

Bases: TypedDict

A body of response to a request to reserve additional request weight.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

ScheduleCancelAction ¤

Bases: TypedDict

An action to schedule a cancel-all operation at a future time.

Attributes:

Name Type Description
time NotRequired[int | None]

The time at which to schedule the cancel-all operation.

type Literal['scheduleCancel']

The action type.

time instance-attribute ¤

time: NotRequired[int | None]

The time at which to schedule the cancel-all operation.

type instance-attribute ¤

type: Literal['scheduleCancel']

The action type.

ScheduleCancelRequest ¤

Bases: TypedDict

A request to schedule a cancel-all operation at a future time.

Attributes:

Name Type Description
action ScheduleCancelAction

The schedule cancel action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

The schedule cancel action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

ScheduleCancelResponse ¤

Bases: TypedDict

A response from the exchange after scheduling a cancel-all operation at a future time.

Attributes:

Name Type Description
todo str

Placeholder field - not documented in API docs.

todo instance-attribute ¤

todo: str

Placeholder field - not documented in API docs.

SetReferrerAction ¤

Bases: TypedDict

An action to set a referrer.

Attributes:

Name Type Description
code str

The referrer code.

type Literal['setReferrer']

The action type.

code instance-attribute ¤

code: str

The referrer code.

type instance-attribute ¤

type: Literal['setReferrer']

The action type.

SetReferrerRequest ¤

Bases: TypedDict

A request to set a referrer.

Attributes:

Name Type Description
action SetReferrerAction

The set referrer action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The set referrer action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

SetReferrerResponse ¤

Bases: TypedDict

A response from the exchange after setting a referrer.

Attributes:

Name Type Description
todo str

Placeholder field - not documented in API docs.

todo instance-attribute ¤

todo: str

Placeholder field - not documented in API docs.

Signature ¤

Bases: TypedDict

A signature for an action request.

Attributes:

Name Type Description
r HexStr

The r component of the signature.

s HexStr

The s component of the signature.

v HexBytes | int

The v component of the signature.

r instance-attribute ¤

r: HexStr

The r component of the signature.

s instance-attribute ¤

s: HexStr

The s component of the signature.

v instance-attribute ¤

v: HexBytes | int

The v component of the signature.

Signers ¤

Bases: TypedDict

Signers of a multi-sig.

Attributes:

Name Type Description
authorizedUsers list[str]

The addresses of the authorized users. NOTE: Must be sorted.

threshold int

The number of signatures required to authorize a transaction.

authorizedUsers instance-attribute ¤

authorizedUsers: list[str]

The addresses of the authorized users. NOTE: Must be sorted.

threshold instance-attribute ¤

threshold: int

The number of signatures required to authorize a transaction.

SpotAssetCtx ¤

Bases: TypedDict

Spot asset context.

Attributes:

Name Type Description
circulatingSupply str

The circulating supply.

coin str

The asset name.

dayNtlVlm str

The day notional volume.

markPx str

The mark price.

midPx str | None

The mid price.

prevDayPx str

The previous day price.

circulatingSupply instance-attribute ¤

circulatingSupply: str

The circulating supply.

coin instance-attribute ¤

coin: str

The asset name.

dayNtlVlm instance-attribute ¤

dayNtlVlm: str

The day notional volume.

markPx instance-attribute ¤

markPx: str

The mark price.

midPx instance-attribute ¤

midPx: str | None

The mid price.

prevDayPx instance-attribute ¤

prevDayPx: str

The previous day price.

SpotAssetMeta ¤

Bases: TypedDict

Spot asset metadata.

Attributes:

Name Type Description
index int

The index of the asset.

isCanonical bool

Whether the asset is canonical.

name str

The name of the spot asset.

tokens tuple[int, int]

The token IDs that make up the asset.

index instance-attribute ¤

index: int

The index of the asset.

isCanonical instance-attribute ¤

isCanonical: bool

Whether the asset is canonical.

name instance-attribute ¤

name: str

The name of the spot asset.

tokens instance-attribute ¤

tokens: tuple[int, int]

The token IDs that make up the asset.

SpotBalance ¤

Bases: TypedDict

A user's spot balance for a given coin.

Attributes:

Name Type Description
coin str

The asset name.

entryNtl str

The entry notional value.

hold str

The amount on hold.

token int

The token ID.

total str

The total balance.

coin instance-attribute ¤

coin: str

The asset name.

entryNtl instance-attribute ¤

entryNtl: str

The entry notional value.

hold instance-attribute ¤

hold: str

The amount on hold.

token instance-attribute ¤

token: int

The token ID.

total instance-attribute ¤

total: str

The total balance.

SpotDeployAuctionStatusRequest ¤

Bases: TypedDict

A request to retrieve spot deploy auction status.

Attributes:

Name Type Description
type Literal['spotDeployState']

The spotDeployState request type.

user str

The user to get the spot deploy auction status for.

type instance-attribute ¤

type: Literal['spotDeployState']

The spotDeployState request type.

user instance-attribute ¤

user: str

The user to get the spot deploy auction status for.

SpotDeployAuctionStatusResponse ¤

Bases: TypedDict

A response to a spot deploy auction status request.

Attributes:

Name Type Description
gasAuction GasAuction

The gas auction information.

states list[SpotDeployState]

The list of spot deploy states.

gasAuction instance-attribute ¤

gasAuction: GasAuction

The gas auction information.

states instance-attribute ¤

The list of spot deploy states.

SpotDeploySpec ¤

Bases: TypedDict

A spot deploy spec.

Attributes:

Name Type Description
name str

The name of the spot deploy.

szDecimals int

The number of decimals for the size.

weiDecimals int

The number of decimals for wei.

name instance-attribute ¤

name: str

The name of the spot deploy.

szDecimals instance-attribute ¤

szDecimals: int

The number of decimals for the size.

weiDecimals instance-attribute ¤

weiDecimals: int

The number of decimals for wei.

SpotDeployState ¤

Bases: TypedDict

A spot deploy state.

Attributes:

Name Type Description
existingTokenGenesisBalances list[list[int | str]]

The existing token genesis balances.

fullName str

The full name of the token.

hyperliquidityGenesisBalance str

The hyperliquidity genesis balance.

maxSupply int

The maximum supply.

spec SpotDeploySpec

The spot deploy specification.

spots list[int]

The list of spot asset IDs.

token int

The token ID.

totalGenesisBalanceWei str

The total genesis balance in wei.

userGenesisBalances list[list[str]]

The user genesis balances.

existingTokenGenesisBalances instance-attribute ¤

existingTokenGenesisBalances: list[list[int | str]]

The existing token genesis balances.

fullName instance-attribute ¤

fullName: str

The full name of the token.

hyperliquidityGenesisBalance instance-attribute ¤

hyperliquidityGenesisBalance: str

The hyperliquidity genesis balance.

maxSupply instance-attribute ¤

maxSupply: int

The maximum supply.

spec instance-attribute ¤

The spot deploy specification.

spots instance-attribute ¤

spots: list[int]

The list of spot asset IDs.

token instance-attribute ¤

token: int

The token ID.

totalGenesisBalanceWei instance-attribute ¤

totalGenesisBalanceWei: str

The total genesis balance in wei.

userGenesisBalances instance-attribute ¤

userGenesisBalances: list[list[str]]

The user genesis balances.

SpotMeta ¤

Bases: TypedDict

Spot metadata.

Attributes:

Name Type Description
tokens list[SpotTokenMeta]

The list of spot token metadata.

universe list[SpotAssetMeta]

The list of spot asset metadata.

tokens instance-attribute ¤

The list of spot token metadata.

universe instance-attribute ¤

universe: list[SpotAssetMeta]

The list of spot asset metadata.

SpotMetaAndAssetCtxsRequest ¤

Bases: TypedDict

A request to retrieve spot metadata and asset context.

SpotMetaRequest ¤

Bases: TypedDict

A request to retrieve spot metadata.

SpotSendAction ¤

Bases: TypedDict

An action to send a spot asset to another address.

Attributes:

Name Type Description
amount str

The amount to send.

destination str

The destination address.

hyperliquidChain str

The hyperliquid chain identifier.

signatureChainId str

The signature chain ID.

time int

The timestamp.

token str

The token to send.

type Literal['spotSend']

The action type.

amount instance-attribute ¤

amount: str

The amount to send.

destination instance-attribute ¤

destination: str

The destination address.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

time instance-attribute ¤

time: int

The timestamp.

token instance-attribute ¤

token: str

The token to send.

type instance-attribute ¤

type: Literal['spotSend']

The action type.

SpotSendRequest ¤

Bases: TypedDict

A request to send a spot asset to another address.

Attributes:

Name Type Description
action SpotSendAction

The spot send action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The spot send action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

SpotSendResponse ¤

Bases: TypedDict

A response from the exchange after sending a spot asset to another address.

Attributes:

Name Type Description
response SpotSendResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

SpotSendResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after sending a spot asset to another address.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

SpotTokenMeta ¤

Bases: TypedDict

Spot token metadata.

Attributes:

Name Type Description
evmContract None

The EVM contract address.

fullName None | str

The full name of the token.

index int

The index of the token.

isCanonical bool

Whether the token is canonical.

name str

The name of the spot token.

szDecimals int

The number of decimals for the size.

tokenId str

The token ID.

weiDecimals int

The number of decimals for wei.

evmContract instance-attribute ¤

evmContract: None

The EVM contract address.

fullName instance-attribute ¤

fullName: None | str

The full name of the token.

index instance-attribute ¤

index: int

The index of the token.

isCanonical instance-attribute ¤

isCanonical: bool

Whether the token is canonical.

name instance-attribute ¤

name: str

The name of the spot token.

szDecimals instance-attribute ¤

szDecimals: int

The number of decimals for the size.

tokenId instance-attribute ¤

tokenId: str

The token ID.

weiDecimals instance-attribute ¤

weiDecimals: int

The number of decimals for wei.

SpotUserState ¤

Bases: TypedDict

A user's spot balances.

Attributes:

Name Type Description
balances list[SpotBalance]

The list of spot balances.

balances instance-attribute ¤

balances: list[SpotBalance]

The list of spot balances.

SpotUserStateRequest ¤

Bases: TypedDict

A request to retrieve a user's spot balances.

Attributes:

Name Type Description
type Literal['spotClearinghouseState']

The spotClearinghouseState request type.

user str

The user to get the spot balances for.

type instance-attribute ¤

type: Literal['spotClearinghouseState']

The spotClearinghouseState request type.

user instance-attribute ¤

user: str

The user to get the spot balances for.

StakingDiscountTier ¤

Bases: TypedDict

A staking discount tier.

Attributes:

Name Type Description
bpsOfMaxSupply str

The basis points of the max supply of the staking discount tier.

discount str

The discount of the staking discount tier.

bpsOfMaxSupply instance-attribute ¤

bpsOfMaxSupply: str

The basis points of the max supply of the staking discount tier.

discount instance-attribute ¤

discount: str

The discount of the staking discount tier.

Bases: TypedDict

A staking link.

Attributes:

Name Type Description
stakingUser str

The staking user address.

type Literal['tradingUser']

The type of staking link.

stakingUser instance-attribute ¤

stakingUser: str

The staking user address.

type instance-attribute ¤

type: Literal['tradingUser']

The type of staking link.

SubAccount ¤

Bases: TypedDict

A subaccount.

Attributes:

Name Type Description
clearingHouseState UserState

The clearing house state of the subaccount.

master str

The master user.

name str

The name of the subaccount.

spotState SpotUserState

The spot state of the subaccount.

subAccountUser str

The subaccount user.

clearingHouseState instance-attribute ¤

clearingHouseState: UserState

The clearing house state of the subaccount.

master instance-attribute ¤

master: str

The master user.

name instance-attribute ¤

name: str

The name of the subaccount.

spotState instance-attribute ¤

spotState: SpotUserState

The spot state of the subaccount.

subAccountUser instance-attribute ¤

subAccountUser: str

The subaccount user.

SubAccountData ¤

Bases: TypedDict

Data for a sub account.

Attributes:

Name Type Description
master str

The master user of the sub account.

master instance-attribute ¤

master: str

The master user of the sub account.

SubAccountTransferAction ¤

Bases: TypedDict

An action to transfer USDC between a user's main account and a subaccount.

Attributes:

Name Type Description
isDeposit bool

Whether this is a deposit to the subaccount.

subAccountUser str

The subaccount user address.

type Literal['subAccountTransfer']

The action type.

usd str

The USD amount to transfer.

isDeposit instance-attribute ¤

isDeposit: bool

Whether this is a deposit to the subaccount.

subAccountUser instance-attribute ¤

subAccountUser: str

The subaccount user address.

type instance-attribute ¤

type: Literal['subAccountTransfer']

The action type.

usd instance-attribute ¤

usd: str

The USD amount to transfer.

SubAccountTransferRequest ¤

Bases: TypedDict

A request to transfer USDC between a user's main account and a subaccount.

Attributes:

Name Type Description
action SubAccountTransferAction

The subaccount transfer action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The subaccount transfer action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

SubAccountTransferResponse ¤

Bases: TypedDict

A response from the exchange after transferring USDC between a user's main account and a subaccount.

Attributes:

Name Type Description
todo str

Placeholder field - not documented in API docs.

todo instance-attribute ¤

todo: str

Placeholder field - not documented in API docs.

SubAccountUserRoleResponse ¤

Bases: TypedDict

A response to a user role request for a sub account.

Attributes:

Name Type Description
data SubAccountData

The data of the sub account.

role Literal['subAccount']

The role sub account.

data instance-attribute ¤

The data of the sub account.

role instance-attribute ¤

role: Literal['subAccount']

The role sub account.

SubAccountsRequest ¤

Bases: TypedDict

A request to retrieve a user's subaccounts.

Attributes:

Name Type Description
type Literal['subAccounts']

The subAccounts request type.

user str

The user to get the subaccounts for.

type instance-attribute ¤

type: Literal['subAccounts']

The subAccounts request type.

user instance-attribute ¤

user: str

The user to get the subaccounts for.

Subscribe ¤

Bases: TypedDict

A request to subscribe to a specific data feed.

Attributes:

Name Type Description
method Literal['subscribe']

The method set to subscribe.

subscription Subscription

The subscription details.

method instance-attribute ¤

method: Literal['subscribe']

The method set to subscribe.

subscription instance-attribute ¤

subscription: Subscription

The subscription details.

SubscriptionResponseMsg ¤

Bases: TypedDict

The response from the exchange after subscribing to a data feed.

Attributes:

Name Type Description
channel Literal['subscriptionResponse']

The channel of the message set to subscriptionResponse.

data Subscribe | Unsubscribe

The subscription or unsubscription request data.

channel instance-attribute ¤

channel: Literal['subscriptionResponse']

The channel of the message set to subscriptionResponse.

data instance-attribute ¤

The subscription or unsubscription request data.

TokenDelegateAction ¤

Bases: TypedDict

An action to delegate or undelegate stake from a validator.

Attributes:

Name Type Description
hyperliquidChain str

The hyperliquid chain identifier.

isUndelegate bool

Whether this is an undelegate operation.

nonce int

The nonce for the action.

signatureChainId str

The signature chain ID.

type Literal['tokenDelegate']

The action type.

validator str

The validator address.

wei int

The amount in wei.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

isUndelegate instance-attribute ¤

isUndelegate: bool

Whether this is an undelegate operation.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

type instance-attribute ¤

type: Literal['tokenDelegate']

The action type.

validator instance-attribute ¤

validator: str

The validator address.

wei instance-attribute ¤

wei: int

The amount in wei.

TokenDelegateRequest ¤

Bases: TypedDict

A request to delegate or undelegate stake from a validator.

Attributes:

Name Type Description
action TokenDelegateAction

The token delegate action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The token delegate action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

TokenDelegateResponse ¤

Bases: TypedDict

The response from the exchange after delegating or undelegating a stake.

Attributes:

Name Type Description
response TokenDelegateResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

TokenDelegateResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after delegating or undelegating a stake.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

TokenDetailsRequest ¤

Bases: TypedDict

A request to retrieve token details.

Attributes:

Name Type Description
tokenId str

The token ID to get details for.

type Literal['tokenDetails']

The tokenDetails request type.

tokenId instance-attribute ¤

tokenId: str

The token ID to get details for.

type instance-attribute ¤

type: Literal['tokenDetails']

The tokenDetails request type.

TokenDetailsResponse ¤

Bases: TypedDict

A response to a token details request.

Attributes:

Name Type Description
circulatingSupply str

The circulating supply.

deployGas str

The deployment gas price.

deployTime str

The deployment time.

deployer str

The deployer address.

futureEmissions str

The future emissions.

genesis GenesisTokenDetails

The genesis token details.

markPx str

The mark price.

maxSupply str

The maximum supply.

midPx str

The mid price.

name str

The name of the token.

nonCirculatingUserBalances list[list[str]]

The non-circulating user balances.

prevDayPx str

The previous day price.

seededUsdc str

The seeded USDC amount.

szDecimals int

The number of decimals for the size.

totalSupply str

The total supply.

weiDecimals int

The number of decimals for wei.

circulatingSupply instance-attribute ¤

circulatingSupply: str

The circulating supply.

deployGas instance-attribute ¤

deployGas: str

The deployment gas price.

deployTime instance-attribute ¤

deployTime: str

The deployment time.

deployer instance-attribute ¤

deployer: str

The deployer address.

futureEmissions instance-attribute ¤

futureEmissions: str

The future emissions.

genesis instance-attribute ¤

The genesis token details.

markPx instance-attribute ¤

markPx: str

The mark price.

maxSupply instance-attribute ¤

maxSupply: str

The maximum supply.

midPx instance-attribute ¤

midPx: str

The mid price.

name instance-attribute ¤

name: str

The name of the token.

nonCirculatingUserBalances instance-attribute ¤

nonCirculatingUserBalances: list[list[str]]

The non-circulating user balances.

prevDayPx instance-attribute ¤

prevDayPx: str

The previous day price.

seededUsdc instance-attribute ¤

seededUsdc: str

The seeded USDC amount.

szDecimals instance-attribute ¤

szDecimals: int

The number of decimals for the size.

totalSupply instance-attribute ¤

totalSupply: str

The total supply.

weiDecimals instance-attribute ¤

weiDecimals: int

The number of decimals for wei.

TopUpIsolatedOnlyMarginAction ¤

Bases: TypedDict

An action to top up the isolated margin for a given asset.

Attributes:

Name Type Description
asset int

The asset ID.

leverage str

The leverage value.

type Literal['topUpIsolatedOnlyMargin']

The action type.

asset instance-attribute ¤

asset: int

The asset ID.

leverage instance-attribute ¤

leverage: str

The leverage value.

type instance-attribute ¤

type: Literal['topUpIsolatedOnlyMargin']

The action type.

TopUpIsolatedOnlyMarginRequest ¤

Bases: TypedDict

A request to top up the isolated margin for a given asset.

Attributes:

Name Type Description
action TopUpIsolatedOnlyMarginAction

The top up isolated margin action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

The top up isolated margin action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

TopUpIsolatedOnlyMarginResponse ¤

Bases: TypedDict

A response from the exchange after top up of the isolated margin for a given asset.

Attributes:

Name Type Description
response TopUpIsolatedOnlyMarginResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

TopUpIsolatedOnlyMarginResponseBody ¤

Bases: TypedDict

The data of a response from the exchange after top up of the isolated margin for a given asset.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

Trade ¤

Bases: TypedDict

A trade.

Attributes:

Name Type Description
coin str

The asset of the trade.

hash str

The hash of the trade.

px str

The price of the trade.

side Side

The side of the trade.

sz str

The size of the trade.

tid int

The trade ID.

time int

The timestamp of the trade.

users tuple[str, str]

The users involved in the trade (buyer and seller addresses).

coin instance-attribute ¤

coin: str

The asset of the trade.

hash instance-attribute ¤

hash: str

The hash of the trade.

px instance-attribute ¤

px: str

The price of the trade.

side instance-attribute ¤

side: Side

The side of the trade.

sz instance-attribute ¤

sz: str

The size of the trade.

tid instance-attribute ¤

tid: int

The trade ID.

time instance-attribute ¤

time: int

The timestamp of the trade.

users instance-attribute ¤

users: tuple[str, str]

The users involved in the trade (buyer and seller addresses).

TradesMsg ¤

Bases: TypedDict

A message from the exchange containing trades. Response to a :obj:TradesSubscription.

Attributes:

Name Type Description
channel Literal['trades']

The channel of the message set to trades.

data list[Trade]

List of trades.

channel instance-attribute ¤

channel: Literal['trades']

The channel of the message set to trades.

data instance-attribute ¤

data: list[Trade]

List of trades.

TradesSubscription ¤

Bases: TypedDict

Subscribe to trades.

Attributes:

Name Type Description
coin str

The asset to subscribe to.

type Literal['trades']

The subscription type.

coin instance-attribute ¤

coin: str

The asset to subscribe to.

type instance-attribute ¤

type: Literal['trades']

The subscription type.

TriggerOrderType ¤

Bases: TypedDict

Trigger price, limit vs market, and take profit/stop loss parameters for an order.

Attributes:

Name Type Description
is_market bool

Whether this is a market order.

price Decimal

The trigger price.

trigger Tpsl

The trigger type (take profit or stop loss).

type Literal['trigger']

The order type.

is_market instance-attribute ¤

is_market: bool

Whether this is a market order.

price instance-attribute ¤

price: Decimal

The trigger price.

trigger instance-attribute ¤

trigger: Tpsl

The trigger type (take profit or stop loss).

type instance-attribute ¤

type: Literal['trigger']

The order type.

TriggerOrderTypeWire ¤

Bases: TypedDict

Serialized trigger parameters for an order.

Attributes:

Name Type Description
trigger TriggerOrderTypeWireData

The trigger order data.

trigger instance-attribute ¤

The trigger order data.

TriggerOrderTypeWireData ¤

Bases: TypedDict

Serialized trigger price, limit vs market, and take profit/stop loss parameters for an order.

Attributes:

Name Type Description
isMarket bool

Whether this is a market order.

tpsl Tpsl

The trigger type (take profit or stop loss).

triggerPx str

The trigger price.

isMarket instance-attribute ¤

isMarket: bool

Whether this is a market order.

tpsl instance-attribute ¤

tpsl: Tpsl

The trigger type (take profit or stop loss).

triggerPx instance-attribute ¤

triggerPx: str

The trigger price.

TwapCancelAction ¤

Bases: TypedDict

An action to cancel a TWAP order.

Attributes:

Name Type Description
a int

The asset ID.

t int

The TWAP order ID.

type Literal['twapCancel']

The action type.

a instance-attribute ¤

a: int

The asset ID.

t instance-attribute ¤

t: int

The TWAP order ID.

type instance-attribute ¤

type: Literal['twapCancel']

The action type.

TwapCancelRequest ¤

Bases: TypedDict

A request to cancel a TWAP order.

Attributes:

Name Type Description
action TwapCancelAction

The cancel action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The cancel action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

TwapCancelResponse ¤

Bases: TypedDict

A response to a request to cancel a TWAP order.

Attributes:

Name Type Description
response TwapCancelResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

TwapCancelResponseBody ¤

Bases: TypedDict

A body of response to a request to cancel a TWAP order.

Attributes:

Name Type Description
data TwapCancelResponseDataSuccess

The cancel response data.

type Literal['twapCancel']

The response type.

data instance-attribute ¤

The cancel response data.

type instance-attribute ¤

type: Literal['twapCancel']

The response type.

TwapCancelResponseDataError ¤

Bases: TypedDict

A error status in response to canceling a TWAP order.

Attributes:

Name Type Description
status TwapCancelResponseDataErrorDetail

The error details.

status instance-attribute ¤

The error details.

TwapCancelResponseDataErrorDetail ¤

Bases: TypedDict

A error status' details in response to canceling a TWAP order.

Attributes:

Name Type Description
error str

The error message.

error instance-attribute ¤

error: str

The error message.

TwapCancelResponseDataSuccess ¤

Bases: TypedDict

A success status in response to canceling a TWAP order.

Attributes:

Name Type Description
status Literal['success']

The success status.

status instance-attribute ¤

status: Literal['success']

The success status.

TwapOrderAction ¤

Bases: TypedDict

An action to place a TWAP order.

Attributes:

Name Type Description
twap TwapWire

The TWAP order details.

type Literal['twapOrder']

The action type.

twap instance-attribute ¤

twap: TwapWire

The TWAP order details.

type instance-attribute ¤

type: Literal['twapOrder']

The action type.

TwapOrderData ¤

Bases: TypedDict

A status in response to placing a TWAP order.

Attributes:

Name Type Description
status TwapOrderDataStatusRunning | TwapOrderDataStatusError

The status of the TWAP order.

status instance-attribute ¤

The status of the TWAP order.

TwapOrderDataStatusError ¤

Bases: TypedDict

A error status in response to placing a TWAP order.

Attributes:

Name Type Description
error str

The error message.

error instance-attribute ¤

error: str

The error message.

TwapOrderDataStatusRunning ¤

Bases: TypedDict

A running status in response to placing a TWAP order.

Attributes:

Name Type Description
running TwapOrderDataStatusRunningData

The running status data.

running instance-attribute ¤

The running status data.

TwapOrderDataStatusRunningData ¤

Bases: TypedDict

A twap id of in response to placing a TWAP order.

Attributes:

Name Type Description
twapId int

The TWAP order ID.

twapId instance-attribute ¤

twapId: int

The TWAP order ID.

TwapOrderRequest ¤

Bases: TypedDict

A request to place a TWAP order.

Attributes:

Name Type Description
action TwapOrderAction

The TWAP order action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The TWAP order action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

TwapOrderResponse ¤

Bases: TypedDict

A response to a request to place a TWAP order.

Attributes:

Name Type Description
response TwapOrderResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

TwapOrderResponseBody ¤

Bases: TypedDict

A body of response to a request to place a TWAP order.

Attributes:

Name Type Description
data TwapOrderData

The TWAP order data.

type Literal['twapOrder']

The response type.

data instance-attribute ¤

The TWAP order data.

type instance-attribute ¤

type: Literal['twapOrder']

The response type.

TwapState ¤

Bases: TypedDict

A user TWAP state.

Attributes:

Name Type Description
coin str

The asset for the TWAP order.

executedNtl float

The executed notional value of the TWAP order.

executedSz float

The executed size of the TWAP order.

minutes int

The duration of the TWAP order in minutes.

randomize bool

Whether the TWAP order is randomized.

reduceOnly bool

Whether the TWAP order is reduce-only.

side str

The side of the TWAP order.

sz float

The size of the TWAP order.

timestamp int

The timestamp when the TWAP order was created.

user str

The user address.

coin instance-attribute ¤

coin: str

The asset for the TWAP order.

executedNtl instance-attribute ¤

executedNtl: float

The executed notional value of the TWAP order.

executedSz instance-attribute ¤

executedSz: float

The executed size of the TWAP order.

minutes instance-attribute ¤

minutes: int

The duration of the TWAP order in minutes.

randomize instance-attribute ¤

randomize: bool

Whether the TWAP order is randomized.

reduceOnly instance-attribute ¤

reduceOnly: bool

Whether the TWAP order is reduce-only.

side instance-attribute ¤

side: str

The side of the TWAP order.

sz instance-attribute ¤

sz: float

The size of the TWAP order.

timestamp instance-attribute ¤

timestamp: int

The timestamp when the TWAP order was created.

user instance-attribute ¤

user: str

The user address.

TwapStatus ¤

Bases: TypedDict

A user TWAP status.

Attributes:

Name Type Description
description str

The description of the TWAP status.

status Literal['activated', 'terminated', 'finished', 'error']

The status of the TWAP order.

description instance-attribute ¤

description: str

The description of the TWAP status.

status instance-attribute ¤

status: Literal[
    "activated", "terminated", "finished", "error"
]

The status of the TWAP order.

TwapWire ¤

Bases: TypedDict

A wire representation of a twap order.

Attributes:

Name Type Description
a int

The asset ID.

b bool

Whether this is a buy order.

m int

The duration in minutes.

r bool

Whether this is a reduce-only order.

s str

The size of the TWAP order.

t bool

Whether the TWAP order is randomized.

a instance-attribute ¤

a: int

The asset ID.

b instance-attribute ¤

b: bool

Whether this is a buy order.

m instance-attribute ¤

m: int

The duration in minutes.

r instance-attribute ¤

r: bool

Whether this is a reduce-only order.

s instance-attribute ¤

s: str

The size of the TWAP order.

t instance-attribute ¤

t: bool

Whether the TWAP order is randomized.

Unsubscribe ¤

Bases: TypedDict

A request to unsubscribe from a specific data feed.

Attributes:

Name Type Description
method Literal['unsubscribe']

The method set to unsubscribe.

subscription Subscription

The subscription details.

method instance-attribute ¤

method: Literal['unsubscribe']

The method set to unsubscribe.

subscription instance-attribute ¤

subscription: Subscription

The subscription details.

UpdateIsolatedMarginAction ¤

Bases: TypedDict

An action to update the isolated margin for a given asset.

Attributes:

Name Type Description
asset int

The asset ID.

isBuy bool

Whether this is for a buy position.

ntli int

The notional value in USD.

type Literal['updateIsolatedMargin']

The action type.

asset instance-attribute ¤

asset: int

The asset ID.

isBuy instance-attribute ¤

isBuy: bool

Whether this is for a buy position.

ntli instance-attribute ¤

ntli: int

The notional value in USD.

type instance-attribute ¤

type: Literal['updateIsolatedMargin']

The action type.

UpdateIsolatedMarginRequest ¤

Bases: TypedDict

A request to update the isolated margin for a given asset.

Attributes:

Name Type Description
action UpdateIsolatedMarginAction

The update isolated margin action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

The update isolated margin action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

UpdateIsolatedMarginResponse ¤

Bases: TypedDict

A response from the exchange after successfully updating the isolated margin for a given asset.

Attributes:

Name Type Description
response UpdateIsolatedMarginResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

UpdateIsolatedMarginResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after successfully updating the isolated margin for a given asset.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

UpdateLeverageAction ¤

Bases: TypedDict

An action to update the leverage for a given asset.

Attributes:

Name Type Description
asset int

The asset ID.

isCross bool

Whether to use cross margin.

leverage int

The leverage value.

type Literal['updateLeverage']

The action type.

asset instance-attribute ¤

asset: int

The asset ID.

isCross instance-attribute ¤

isCross: bool

Whether to use cross margin.

leverage instance-attribute ¤

leverage: int

The leverage value.

type instance-attribute ¤

type: Literal['updateLeverage']

The action type.

UpdateLeverageRequest ¤

Bases: TypedDict

A request to update the leverage for a given asset.

Attributes:

Name Type Description
action UpdateLeverageAction

The update leverage action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

vaultAddress str | None

The vault address if trading on behalf of a vault.

action instance-attribute ¤

The update leverage action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

vaultAddress instance-attribute ¤

vaultAddress: str | None

The vault address if trading on behalf of a vault.

UpdateLeverageResponse ¤

Bases: TypedDict

A response from the exchange after successfully updating the leverage for a given asset.

Attributes:

Name Type Description
response UpdateLeverageResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

UpdateLeverageResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after successfully updating the leverage for a given asset.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

UsdClassTransferAction ¤

Bases: TypedDict

An action to transfer USDC from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
amount str

The amount to transfer.

hyperliquidChain str

The hyperliquid chain identifier.

nonce int

The nonce for the action.

signatureChainId str

The signature chain ID.

toPerp bool

Whether to transfer to perpetuals or from perpetuals.

type Literal['usdClassTransfer']

The action type.

amount instance-attribute ¤

amount: str

The amount to transfer.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

toPerp instance-attribute ¤

toPerp: bool

Whether to transfer to perpetuals or from perpetuals.

type instance-attribute ¤

type: Literal['usdClassTransfer']

The action type.

UsdClassTransferRequest ¤

Bases: TypedDict

A request to transfer USDC from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
action UsdClassTransferAction

The USD class transfer action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The USD class transfer action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

UsdClassTransferResponse ¤

Bases: TypedDict

A response from the exchange after transferring USDC from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
response UsdClassTransferResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

UsdClassTransferResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after transferring USDC from a user's spot wallet to their perp wallet and vice versa.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

UsdSendAction ¤

Bases: TypedDict

An action to send USDC to another address.

Attributes:

Name Type Description
amount str

The amount to send.

destination str

The destination address.

hyperliquidChain str

The hyperliquid chain identifier.

signatureChainId str

The signature chain ID.

time int

The timestamp.

type Literal['usdSend']

The action type.

amount instance-attribute ¤

amount: str

The amount to send.

destination instance-attribute ¤

destination: str

The destination address.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

time instance-attribute ¤

time: int

The timestamp.

type instance-attribute ¤

type: Literal['usdSend']

The action type.

UsdSendRequest ¤

Bases: TypedDict

A request to send USDC to another address.

Attributes:

Name Type Description
action UsdSendAction

The USD send action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

action: UsdSendAction

The USD send action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

UsdSendResponse ¤

Bases: TypedDict

A response from the exchange after sending USDC to another address.

Attributes:

Name Type Description
response UsdSendResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

UsdSendResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after sending USDC to another address.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

UserAccountClassTransferDelta ¤

Bases: TypedDict

The delta of an account class transfer in a user's non-funding ledger.

Attributes:

Name Type Description
toPerp bool

Whether the transfer is to perpetuals.

type Literal['accountClassTransfer']

The type of delta.

usdc str

The USDC amount transferred.

toPerp instance-attribute ¤

toPerp: bool

Whether the transfer is to perpetuals.

type instance-attribute ¤

type: Literal['accountClassTransfer']

The type of delta.

usdc instance-attribute ¤

usdc: str

The USDC amount transferred.

UserDepositDelta ¤

Bases: TypedDict

The delta of a deposit in a user's non-funding ledger.

Attributes:

Name Type Description
type Literal['deposit']

The type of delta.

usdc str

The USDC amount deposited.

type instance-attribute ¤

type: Literal['deposit']

The type of delta.

usdc instance-attribute ¤

usdc: str

The USDC amount deposited.

UserEventsMsg ¤

Bases: TypedDict

A message from the exchange containing user events. Response to a :obj:UserEventsSubscription.

Attributes:

Name Type Description
channel Literal['user']

The channel of the message set to user.

data UserEvent

The user event data.

channel instance-attribute ¤

channel: Literal['user']

The channel of the message set to user.

data instance-attribute ¤

data: UserEvent

The user event data.

UserEventsSubscription ¤

Bases: TypedDict

Subscribe to user events.

Attributes:

Name Type Description
type Literal['userEvents']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['userEvents']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

UserFeesRequest ¤

Bases: TypedDict

A request to retrieve a user's fees.

Attributes:

Name Type Description
type Literal['userFees']

The userFees request type.

user str

The user to get the fees for.

type instance-attribute ¤

type: Literal['userFees']

The userFees request type.

user instance-attribute ¤

user: str

The user to get the fees for.

UserFeesResponse ¤

Bases: TypedDict

A response to a user's fees request.

Attributes:

Name Type Description
activeReferralDiscount str

The active referral discount amount.

activeStakingDiscount StakingDiscountTier

The active staking discount tier.

dailyUserVlm list[DailyUserVlm]

The daily user VLM data.

feeSchedule FeeSchedule

The fee schedule information.

feeTrialReward str

The fee trial reward amount.

nextTrialAvailableTimestamp None

The timestamp when the next trial becomes available.

stakingLink StakingLink | None

The staking link information.

trial None

The trial information.

userAddRate str

The user's add liquidity fee rate.

userCrossRate str

The user's cross trading fee rate.

userSpotAddRate str

The user's spot add liquidity fee rate.

userSpotCrossRate str

The user's spot cross trading fee rate.

activeReferralDiscount instance-attribute ¤

activeReferralDiscount: str

The active referral discount amount.

activeStakingDiscount instance-attribute ¤

activeStakingDiscount: StakingDiscountTier

The active staking discount tier.

dailyUserVlm instance-attribute ¤

dailyUserVlm: list[DailyUserVlm]

The daily user VLM data.

feeSchedule instance-attribute ¤

feeSchedule: FeeSchedule

The fee schedule information.

feeTrialReward instance-attribute ¤

feeTrialReward: str

The fee trial reward amount.

nextTrialAvailableTimestamp instance-attribute ¤

nextTrialAvailableTimestamp: None

The timestamp when the next trial becomes available.

stakingLink: StakingLink | None

The staking link information.

trial instance-attribute ¤

trial: None

The trial information.

userAddRate instance-attribute ¤

userAddRate: str

The user's add liquidity fee rate.

userCrossRate instance-attribute ¤

userCrossRate: str

The user's cross trading fee rate.

userSpotAddRate instance-attribute ¤

userSpotAddRate: str

The user's spot add liquidity fee rate.

userSpotCrossRate instance-attribute ¤

userSpotCrossRate: str

The user's spot cross trading fee rate.

UserFill ¤

Bases: TypedDict

A user fill.

Attributes:

Name Type Description
builderFee NotRequired[str]

The builder fee of the fill.

closedPnl str

The closed PnL of the fill.

coin str

The asset of the fill.

crossed bool

Whether the fill was crossed.

dir FillDirection

The direction of the fill.

fee str

The fee of the fill.

feeToken str

The fee token of the fill.

hash str

The hash of the fill.

liquidation NotRequired[FIXME]

The liquidation of the fill.

oid int

The order ID of the fill.

px str

The price of the fill.

side Side

The side of the fill.

startPosition str

The start position of the fill.

sz str

The size of the fill.

tid int

The transaction ID of the fill.

time int

The timestamp of the fill.

builderFee instance-attribute ¤

builderFee: NotRequired[str]

The builder fee of the fill.

closedPnl instance-attribute ¤

closedPnl: str

The closed PnL of the fill.

coin instance-attribute ¤

coin: str

The asset of the fill.

crossed instance-attribute ¤

crossed: bool

Whether the fill was crossed.

dir instance-attribute ¤

The direction of the fill.

fee instance-attribute ¤

fee: str

The fee of the fill.

feeToken instance-attribute ¤

feeToken: str

The fee token of the fill.

hash instance-attribute ¤

hash: str

The hash of the fill.

liquidation instance-attribute ¤

liquidation: NotRequired[FIXME]

The liquidation of the fill.

oid instance-attribute ¤

oid: int

The order ID of the fill.

px instance-attribute ¤

px: str

The price of the fill.

side instance-attribute ¤

side: Side

The side of the fill.

startPosition instance-attribute ¤

startPosition: str

The start position of the fill.

sz instance-attribute ¤

sz: str

The size of the fill.

tid instance-attribute ¤

tid: int

The transaction ID of the fill.

time instance-attribute ¤

time: int

The timestamp of the fill.

UserFillsByTimeRequest ¤

Bases: TypedDict

A request to retrieve a user's fills by time.

Attributes:

Name Type Description
aggregateByTime NotRequired[bool | None]

Whether to aggregate the fills by time.

endTime NotRequired[int | None]

The end time of the fills.

startTime int

The start time of the fills.

type Literal['userFillsByTime']

The userFillsByTime request type.

user str

The user to get the fills for.

aggregateByTime instance-attribute ¤

aggregateByTime: NotRequired[bool | None]

Whether to aggregate the fills by time.

endTime instance-attribute ¤

endTime: NotRequired[int | None]

The end time of the fills.

startTime instance-attribute ¤

startTime: int

The start time of the fills.

type instance-attribute ¤

type: Literal['userFillsByTime']

The userFillsByTime request type.

user instance-attribute ¤

user: str

The user to get the fills for.

UserFillsData ¤

Bases: TypedDict

The payload of a message from the exchange containing user fills. Response to a :obj:UserFillsSubscription.

Attributes:

Name Type Description
fills list[UserFill]

List of user fills.

isSnapshot NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

user str

The user address.

fills instance-attribute ¤

fills: list[UserFill]

List of user fills.

isSnapshot instance-attribute ¤

isSnapshot: NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

user instance-attribute ¤

user: str

The user address.

UserFillsEvent ¤

Bases: TypedDict

The payload of a message from the exchange containing user fills. Response to a :obj:UserFillsSubscription.

Attributes:

Name Type Description
fills list[UserFill]

List of user fills.

fills instance-attribute ¤

fills: list[UserFill]

List of user fills.

UserFillsMsg ¤

Bases: TypedDict

A message from the exchange containing user fills. Response to a :obj:UserFillsSubscription.

Attributes:

Name Type Description
channel Literal['userFills']

The channel of the message set to userFills.

data UserFillsData

The user fills data.

channel instance-attribute ¤

channel: Literal['userFills']

The channel of the message set to userFills.

data instance-attribute ¤

The user fills data.

UserFillsRequest ¤

Bases: TypedDict

A request to retrieve a user's fills.

Attributes:

Name Type Description
type Literal['userFills']

The userFills request type.

user str

The user to get the fills for.

type instance-attribute ¤

type: Literal['userFills']

The userFills request type.

user instance-attribute ¤

user: str

The user to get the fills for.

UserFillsSubscription ¤

Bases: TypedDict

Subscribe to user fills.

Attributes:

Name Type Description
aggregateByTime NotRequired[bool]

Whether to aggregate fills by time.

type Literal['userFills']

The subscription type.

user str

The user address to subscribe to.

aggregateByTime instance-attribute ¤

aggregateByTime: NotRequired[bool]

Whether to aggregate fills by time.

type instance-attribute ¤

type: Literal['userFills']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

UserFunding ¤

Bases: TypedDict

An entry in a user's funding history.

Attributes:

Name Type Description
delta UserFundingDelta

The funding delta data.

hash str

The hash of the funding entry.

time int

The timestamp of the funding entry.

delta instance-attribute ¤

The funding delta data.

hash instance-attribute ¤

hash: str

The hash of the funding entry.

time instance-attribute ¤

time: int

The timestamp of the funding entry.

UserFundingData ¤

Bases: TypedDict

A user funding.

UserFundingDelta ¤

Bases: _UserFundingDeltaBase

The delta of an entry in a user's funding history.

Attributes:

Name Type Description
coin str

The asset of the funding.

fundingRate str

The funding rate.

nSamples None

The number of samples.

szi str

The size.

type Literal['funding']

The type of funding delta.

usdc str

The USDC amount.

coin instance-attribute ¤

coin: str

The asset of the funding.

fundingRate instance-attribute ¤

fundingRate: str

The funding rate.

nSamples instance-attribute ¤

nSamples: None

The number of samples.

szi instance-attribute ¤

szi: str

The size.

type instance-attribute ¤

type: Literal['funding']

The type of funding delta.

usdc instance-attribute ¤

usdc: str

The USDC amount.

UserFundingEvent ¤

Bases: TypedDict

The payload of a message from the exchange containing a user funding. Response to a :obj:UserFundingsSubscription.

Attributes:

Name Type Description
funding UserFundingData

The user funding data.

funding instance-attribute ¤

funding: UserFundingData

The user funding data.

UserFundingRequest ¤

Bases: TypedDict

A request to retrieve a user's funding history.

Attributes:

Name Type Description
endTime NotRequired[int]

The end time for the funding history.

startTime int

The start time for the funding history.

type Literal['userFunding']

The userFunding request type.

user str

The user to get the funding history for.

endTime instance-attribute ¤

endTime: NotRequired[int]

The end time for the funding history.

startTime instance-attribute ¤

startTime: int

The start time for the funding history.

type instance-attribute ¤

type: Literal['userFunding']

The userFunding request type.

user instance-attribute ¤

user: str

The user to get the funding history for.

UserFundingsData ¤

Bases: TypedDict

The payload of a message from the exchange containing user fundings. Response to a :obj:UserFundingsSubscription.

Attributes:

Name Type Description
fundings list[WsUserFundingDelta]

List of user funding deltas.

isSnapshot NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

user str

The user address.

fundings instance-attribute ¤

List of user funding deltas.

isSnapshot instance-attribute ¤

isSnapshot: NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

user instance-attribute ¤

user: str

The user address.

UserFundingsMsg ¤

Bases: TypedDict

A message from the exchange containing user fundings. Response to a :obj:UserFundingsSubscription.

Attributes:

Name Type Description
channel Literal['userFundings']

The channel of the message set to userFundings.

data UserFundingsData

The user fundings data.

channel instance-attribute ¤

channel: Literal['userFundings']

The channel of the message set to userFundings.

data instance-attribute ¤

The user fundings data.

UserFundingsSubscription ¤

Bases: TypedDict

Subscribe to user fundings.

Attributes:

Name Type Description
type Literal['userFundings']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['userFundings']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

UserLiquidation ¤

Bases: TypedDict

A user liquidation.

Attributes:

Name Type Description
lid int

The liquidation ID.

liquidated_account_value str

The liquidated account value.

liquidated_ntl_pos str

The liquidated notional position.

liquidated_user str

The liquidated user address.

liquidator str

The liquidator address.

lid instance-attribute ¤

lid: int

The liquidation ID.

liquidated_account_value instance-attribute ¤

liquidated_account_value: str

The liquidated account value.

liquidated_ntl_pos instance-attribute ¤

liquidated_ntl_pos: str

The liquidated notional position.

liquidated_user instance-attribute ¤

liquidated_user: str

The liquidated user address.

liquidator instance-attribute ¤

liquidator: str

The liquidator address.

UserLiquidationEvent ¤

Bases: TypedDict

The payload of a message from the exchange containing a user liquidation. Response to a :obj:UserLiquidationsSubscription.

Attributes:

Name Type Description
liquidation UserLiquidation

The user liquidation data.

liquidation instance-attribute ¤

liquidation: UserLiquidation

The user liquidation data.

UserNonFundingLedgerUpdate ¤

Bases: TypedDict

An entry in a user's non-funding ledger.

Attributes:

Name Type Description
delta UserAccountClassTransferDelta | UserDepositDelta | UserWithdrawDelta | UserSpotTransferDelta | UserSpotGenesisDelta | UserVaultCreateDelta

The delta data for the ledger update.

hash str

The hash of the ledger update.

time int

The timestamp of the ledger update.

delta instance-attribute ¤

The delta data for the ledger update.

hash instance-attribute ¤

hash: str

The hash of the ledger update.

time instance-attribute ¤

time: int

The timestamp of the ledger update.

UserNonFundingLedgerUpdatesData ¤

Bases: TypedDict

The payload of a message from the exchange containing user non-funding ledger updates. Response to a :obj:UserNonFundingLedgerUpdatesSubscription.

Attributes:

Name Type Description
isSnapshot NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

nonFundingLedgerUpdates list[UserNonFundingLedgerUpdate]

List of non-funding ledger updates.

user str

The user address.

isSnapshot instance-attribute ¤

isSnapshot: NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

nonFundingLedgerUpdates instance-attribute ¤

nonFundingLedgerUpdates: list[UserNonFundingLedgerUpdate]

List of non-funding ledger updates.

user instance-attribute ¤

user: str

The user address.

UserNonFundingLedgerUpdatesMsg ¤

Bases: TypedDict

A message from the exchange containing user non-funding ledger updates. Response to a :obj:UserNonFundingLedgerUpdatesSubscription.

Attributes:

Name Type Description
channel Literal['userNonFundingLedgerUpdates']

The channel of the message set to userNonFundingLedgerUpdates.

data UserNonFundingLedgerUpdatesData

The user non-funding ledger updates data.

channel instance-attribute ¤

channel: Literal['userNonFundingLedgerUpdates']

The channel of the message set to userNonFundingLedgerUpdates.

data instance-attribute ¤

The user non-funding ledger updates data.

UserNonFundingLedgerUpdatesRequest ¤

Bases: TypedDict

A request to retrieve a user's non-funding ledger.

Attributes:

Name Type Description
endTime NotRequired[int]

The end time for the ledger updates.

startTime int

The start time for the ledger updates.

type Literal['userNonFundingLedgerUpdates']

The userNonFundingLedgerUpdates request type.

user str

The user to get the non-funding ledger for.

endTime instance-attribute ¤

endTime: NotRequired[int]

The end time for the ledger updates.

startTime instance-attribute ¤

startTime: int

The start time for the ledger updates.

type instance-attribute ¤

type: Literal['userNonFundingLedgerUpdates']

The userNonFundingLedgerUpdates request type.

user instance-attribute ¤

user: str

The user to get the non-funding ledger for.

UserNonFundingLedgerUpdatesSubscription ¤

Bases: TypedDict

Subscribe to user non-funding ledger updates.

Attributes:

Name Type Description
type Literal['userNonFundingLedgerUpdates']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['userNonFundingLedgerUpdates']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

UserRateLimitRequest ¤

Bases: TypedDict

A request to retrieve a user's rate limit.

Attributes:

Name Type Description
type Literal['userRateLimit']

The userRateLimit request type.

user str

The user to get the rate limit for.

type instance-attribute ¤

type: Literal['userRateLimit']

The userRateLimit request type.

user instance-attribute ¤

user: str

The user to get the rate limit for.

UserRateLimitResponse ¤

Bases: TypedDict

A user's rate limit as a response to a user rate limit request.

Attributes:

Name Type Description
cumVlm str

The cumulative volume of the user.

nRequestsCap int

The number of requests the user is allowed to make.

nRequestsUsed int

The number of requests the user has made.

cumVlm instance-attribute ¤

cumVlm: str

The cumulative volume of the user.

nRequestsCap instance-attribute ¤

nRequestsCap: int

The number of requests the user is allowed to make.

nRequestsUsed instance-attribute ¤

nRequestsUsed: int

The number of requests the user has made.

UserRoleRequest ¤

Bases: TypedDict

A request to retrieve a user's role.

Attributes:

Name Type Description
type Literal['userRole']

The userRole request type.

user str

The user to get the role for.

type instance-attribute ¤

type: Literal['userRole']

The userRole request type.

user instance-attribute ¤

user: str

The user to get the role for.

UserSpotGenesisDelta ¤

Bases: TypedDict

The delta of a spot genesis in a user's non-funding ledger.

Attributes:

Name Type Description
amount str

The amount of the token.

token str

The token in the genesis.

type Literal['spotGenesis']

The type of delta.

amount instance-attribute ¤

amount: str

The amount of the token.

token instance-attribute ¤

token: str

The token in the genesis.

type instance-attribute ¤

type: Literal['spotGenesis']

The type of delta.

UserSpotTransferDelta ¤

Bases: TypedDict

The delta of a spot transfer in a user's non-funding ledger.

Attributes:

Name Type Description
amount str

The amount transferred.

destination str

The destination address.

fee str

The fee amount.

nativeTokenFee str

The native token fee.

nonce int

The nonce of the transfer.

token str

The token being transferred.

type Literal['spotTransfer']

The type of delta.

usdcValue str

The USDC value of the transfer.

user str

The user making the transfer.

amount instance-attribute ¤

amount: str

The amount transferred.

destination instance-attribute ¤

destination: str

The destination address.

fee instance-attribute ¤

fee: str

The fee amount.

nativeTokenFee instance-attribute ¤

nativeTokenFee: str

The native token fee.

nonce instance-attribute ¤

nonce: int

The nonce of the transfer.

token instance-attribute ¤

token: str

The token being transferred.

type instance-attribute ¤

type: Literal['spotTransfer']

The type of delta.

usdcValue instance-attribute ¤

usdcValue: str

The USDC value of the transfer.

user instance-attribute ¤

user: str

The user making the transfer.

UserState ¤

Bases: TypedDict

A user's open positions and margin summary for perpetuals trading.

Attributes:

Name Type Description
assetPositions list[AssetPosition]

The list of asset positions.

crossMaintenanceMarginUsed str

The cross maintenance margin used.

crossMarginSummary MarginSummary

The cross margin summary.

marginSummary MarginSummary

The overall margin summary.

time int

The timestamp of the state.

withdrawable str

The withdrawable amount.

assetPositions instance-attribute ¤

assetPositions: list[AssetPosition]

The list of asset positions.

crossMaintenanceMarginUsed instance-attribute ¤

crossMaintenanceMarginUsed: str

The cross maintenance margin used.

crossMarginSummary instance-attribute ¤

crossMarginSummary: MarginSummary

The cross margin summary.

marginSummary instance-attribute ¤

marginSummary: MarginSummary

The overall margin summary.

time instance-attribute ¤

time: int

The timestamp of the state.

withdrawable instance-attribute ¤

withdrawable: str

The withdrawable amount.

UserStateRequest ¤

Bases: TypedDict

A request to retrieve a user's open positions and margin summary for perpetuals trading.

Attributes:

Name Type Description
type Literal['clearinghouseState']

The clearinghouseState request type.

user str

The user to get the state for.

type instance-attribute ¤

type: Literal['clearinghouseState']

The clearinghouseState request type.

user instance-attribute ¤

user: str

The user to get the state for.

UserTwapHistoryData ¤

Bases: TypedDict

The payload of a message from the exchange containing user TWAP history. Response to an :obj:UserTwapHistorySubscription.

Attributes:

Name Type Description
history list[UserTwapHistoryItem]

List of TWAP history items.

isSnapshot NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

user str

The user address.

history instance-attribute ¤

List of TWAP history items.

isSnapshot instance-attribute ¤

isSnapshot: NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

user instance-attribute ¤

user: str

The user address.

UserTwapHistoryItem ¤

Bases: TypedDict

A user TWAP history item.

Attributes:

Name Type Description
state TwapState

The state of the TWAP order.

status TwapStatus

The status of the TWAP order.

time int

The timestamp of the TWAP history item.

state instance-attribute ¤

state: TwapState

The state of the TWAP order.

status instance-attribute ¤

status: TwapStatus

The status of the TWAP order.

time instance-attribute ¤

time: int

The timestamp of the TWAP history item.

UserTwapHistoryMsg ¤

Bases: TypedDict

A message from the exchange containing user TWAP history. Response to an :obj:UserTwapHistorySubscription.

Attributes:

Name Type Description
channel Literal['userTwapHistory']

The channel of the message set to userTwapHistory.

data UserTwapHistoryData

The user TWAP history data.

channel instance-attribute ¤

channel: Literal['userTwapHistory']

The channel of the message set to userTwapHistory.

data instance-attribute ¤

The user TWAP history data.

UserTwapHistorySubscription ¤

Bases: TypedDict

Subscribe to user TWAP history.

Attributes:

Name Type Description
type Literal['userTwapHistory']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['userTwapHistory']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

UserTwapSliceFill ¤

Bases: TypedDict

A user's TWAP slice fill.

Attributes:

Name Type Description
fill UserFill

The fill of the TWAP slice.

twapId int

The TWAP ID of the TWAP slice.

fill instance-attribute ¤

fill: UserFill

The fill of the TWAP slice.

twapId instance-attribute ¤

twapId: int

The TWAP ID of the TWAP slice.

UserTwapSliceFillsData ¤

Bases: TypedDict

The payload of a message from the exchange containing user TWAP slice fills. Response to an :obj:UserTwapSliceFillsSubscription.

Attributes:

Name Type Description
isSnapshot NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

twapSliceFills list[UserTwapSliceFill]

List of TWAP slice fills.

user str

The user address.

isSnapshot instance-attribute ¤

isSnapshot: NotRequired[bool]

Whether this is a snapshot message (only present in the first message).

twapSliceFills instance-attribute ¤

twapSliceFills: list[UserTwapSliceFill]

List of TWAP slice fills.

user instance-attribute ¤

user: str

The user address.

UserTwapSliceFillsMsg ¤

Bases: TypedDict

A message from the exchange containing user TWAP slice fills. Response to an :obj:UserTwapSliceFillsSubscription.

Attributes:

Name Type Description
channel Literal['userTwapSliceFills']

The channel of the message set to userTwapSliceFills.

data UserTwapSliceFillsData

The user TWAP slice fills data.

channel instance-attribute ¤

channel: Literal['userTwapSliceFills']

The channel of the message set to userTwapSliceFills.

data instance-attribute ¤

The user TWAP slice fills data.

UserTwapSliceFillsRequest ¤

Bases: TypedDict

A request to retrieve a user's TWAP slice fills.

Attributes:

Name Type Description
type Literal['userTwapSliceFills']

The userTwapSliceFills request type.

user str

The user to get the TWAP slice fills for.

type instance-attribute ¤

type: Literal['userTwapSliceFills']

The userTwapSliceFills request type.

user instance-attribute ¤

user: str

The user to get the TWAP slice fills for.

UserTwapSliceFillsSubscription ¤

Bases: TypedDict

Subscribe to user TWAP slice fills.

Attributes:

Name Type Description
type Literal['userTwapSliceFills']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['userTwapSliceFills']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

UserUserRoleResponse ¤

Bases: TypedDict

A response to a user role request for a user.

Attributes:

Name Type Description
role Literal['user']

The role user.

role instance-attribute ¤

role: Literal['user']

The role user.

UserVaultCreateDelta ¤

Bases: TypedDict

The delta of a vault create in a user's non-funding ledger.

Attributes:

Name Type Description
fee str

The fee amount.

type Literal['vaultCreate']

The type of delta.

usdc str

The USDC amount.

vault str

The vault address.

fee instance-attribute ¤

fee: str

The fee amount.

type instance-attribute ¤

type: Literal['vaultCreate']

The type of delta.

usdc instance-attribute ¤

usdc: str

The USDC amount.

vault instance-attribute ¤

vault: str

The vault address.

UserVaultEquitiesRequest ¤

Bases: TypedDict

A request to retrieve a user's vault equities.

Attributes:

Name Type Description
type Literal['userVaultEquities']

The userVaultEquities request type.

user str

The user to get the vault equities for.

type instance-attribute ¤

type: Literal['userVaultEquities']

The userVaultEquities request type.

user instance-attribute ¤

user: str

The user to get the vault equities for.

UserVaultEquity ¤

Bases: TypedDict

A user's vault equity.

Attributes:

Name Type Description
equity str

The equity of the vault equity.

lockedUntilTimestamp NotRequired[int]

The timestamp of until when the vault equity is locked.

vaultAddress str

The vault address of the vault equity.

equity instance-attribute ¤

equity: str

The equity of the vault equity.

lockedUntilTimestamp instance-attribute ¤

lockedUntilTimestamp: NotRequired[int]

The timestamp of until when the vault equity is locked.

vaultAddress instance-attribute ¤

vaultAddress: str

The vault address of the vault equity.

UserWithdrawDelta ¤

Bases: TypedDict

The delta of a withdrawal in a user's non-funding ledger.

Attributes:

Name Type Description
fee str

The fee amount.

nonce int

The nonce of the withdrawal.

type Literal['withdraw']

The type of delta.

usdc str

The USDC amount withdrawn.

fee instance-attribute ¤

fee: str

The fee amount.

nonce instance-attribute ¤

nonce: int

The nonce of the withdrawal.

type instance-attribute ¤

type: Literal['withdraw']

The type of delta.

usdc instance-attribute ¤

usdc: str

The USDC amount withdrawn.

VaultDetailsRequest ¤

Bases: TypedDict

A request to retrieve vault details.

Attributes:

Name Type Description
type Literal['vaultDetails']

The vaultDetails request type.

user NotRequired[str]

The user to get the vault details for.

vaultAddress str

The vault address to get the details for.

type instance-attribute ¤

type: Literal['vaultDetails']

The vaultDetails request type.

user instance-attribute ¤

The user to get the vault details for.

vaultAddress instance-attribute ¤

vaultAddress: str

The vault address to get the details for.

VaultDetailsResponse ¤

Bases: TypedDict

A response from the exchange after retrieving vault details.

Attributes:

Name Type Description
allowDeposits bool

Whether the vault allows deposits.

alwaysCloseOnWithdraw bool

Whether the vault always closes on withdraw.

apr float

The APR of the vault.

description str

The description of the vault.

followerState FIXME | None

The follower state of the vault.

followers list[VaultFollower]

The followers of the vault.

isClosed bool

Whether the vault is closed.

leader str

The leader of the vault.

leaderCommission float

The leader commission of the vault.

leaderFraction float

The leader fraction of the vault.

maxDistributable float

The max distributable of the vault.

maxWithdrawable float

The max withdrawable of the vault.

name str

The name of the vault.

portfolio list[list[Literal['day', 'week', 'month', 'allTime'] | VaultPortfolioItem]]

The portfolio of the vault. Inner list is always [period: Literal["day", "week", "month", "allTime"], portfolio_item: VaultPortfolioItem]

relationship FIXME | None

The relationship of the vault.

vaultAddress str

The vault address of the vault.

allowDeposits instance-attribute ¤

allowDeposits: bool

Whether the vault allows deposits.

alwaysCloseOnWithdraw instance-attribute ¤

alwaysCloseOnWithdraw: bool

Whether the vault always closes on withdraw.

apr instance-attribute ¤

apr: float

The APR of the vault.

description instance-attribute ¤

description: str

The description of the vault.

followerState instance-attribute ¤

followerState: FIXME | None

The follower state of the vault.

followers instance-attribute ¤

followers: list[VaultFollower]

The followers of the vault.

isClosed instance-attribute ¤

isClosed: bool

Whether the vault is closed.

leader instance-attribute ¤

leader: str

The leader of the vault.

leaderCommission instance-attribute ¤

leaderCommission: float

The leader commission of the vault.

leaderFraction instance-attribute ¤

leaderFraction: float

The leader fraction of the vault.

maxDistributable instance-attribute ¤

maxDistributable: float

The max distributable of the vault.

maxWithdrawable instance-attribute ¤

maxWithdrawable: float

The max withdrawable of the vault.

name instance-attribute ¤

name: str

The name of the vault.

portfolio instance-attribute ¤

portfolio: list[
    list[
        Literal["day", "week", "month", "allTime"]
        | VaultPortfolioItem
    ]
]

The portfolio of the vault. Inner list is always [period: Literal["day", "week", "month", "allTime"], portfolio_item: VaultPortfolioItem]

relationship instance-attribute ¤

relationship: FIXME | None

The relationship of the vault.

vaultAddress instance-attribute ¤

vaultAddress: str

The vault address of the vault.

VaultFollower ¤

Bases: TypedDict

A vault follower.

Attributes:

Name Type Description
allTimePnl str

The all time PNL of the vault follower.

daysFollowing int

The number of days the vault follower has been following the vault.

lockupUntil int

The timestamp of the lockup until of the vault follower.

pnl str

The PNL of the vault follower.

user str

The user of the vault follower.

vaultEntryTime int

The timestamp of the vault entry time of the vault follower.

vaultEquity str

The vault equity of the vault follower.

allTimePnl instance-attribute ¤

allTimePnl: str

The all time PNL of the vault follower.

daysFollowing instance-attribute ¤

daysFollowing: int

The number of days the vault follower has been following the vault.

lockupUntil instance-attribute ¤

lockupUntil: int

The timestamp of the lockup until of the vault follower.

pnl instance-attribute ¤

pnl: str

The PNL of the vault follower.

user instance-attribute ¤

user: str

The user of the vault follower.

vaultEntryTime instance-attribute ¤

vaultEntryTime: int

The timestamp of the vault entry time of the vault follower.

vaultEquity instance-attribute ¤

vaultEquity: str

The vault equity of the vault follower.

VaultPortfolioItem ¤

Bases: TypedDict

A portfolio item.

Attributes:

Name Type Description
accountValueHistory list[list[int | str]]

The account value history of the vault. Inner list is always [timestamp: int, value: str]

pnlHistory list[list[int | str]]

The PNL history of the vault. Inner list is always [timestamp: int, value: str]

vlm str

The VLM (volume) of the vault.

accountValueHistory instance-attribute ¤

accountValueHistory: list[list[int | str]]

The account value history of the vault. Inner list is always [timestamp: int, value: str]

pnlHistory instance-attribute ¤

pnlHistory: list[list[int | str]]

The PNL history of the vault. Inner list is always [timestamp: int, value: str]

vlm instance-attribute ¤

vlm: str

The VLM (volume) of the vault.

VaultRelationship ¤

Bases: TypedDict

A vault relationship.

Attributes:

Name Type Description
type Literal['normal', 'leader', 'follower']

The type of the vault relationship.

type instance-attribute ¤

type: Literal['normal', 'leader', 'follower']

The type of the vault relationship.

VaultTransferAction ¤

Bases: TypedDict

An action to add or remove USDC from a vault.

Attributes:

Name Type Description
isDeposit bool

Whether this is a deposit or withdrawal.

type Literal['vaultTransfer']

The action type.

usd int

The USD amount.

vaultAddress str

The vault address.

isDeposit instance-attribute ¤

isDeposit: bool

Whether this is a deposit or withdrawal.

type instance-attribute ¤

type: Literal['vaultTransfer']

The action type.

usd instance-attribute ¤

usd: int

The USD amount.

vaultAddress instance-attribute ¤

vaultAddress: str

The vault address.

VaultTransferRequest ¤

Bases: TypedDict

A request to add or remove USDC from a vault.

Attributes:

Name Type Description
action VaultTransferAction

The vault transfer action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The vault transfer action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

VaultTransferResponse ¤

Bases: TypedDict

A response from the exchange after adding or removing USDC from a vault.

Attributes:

Name Type Description
response VaultTransferResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

VaultTransferResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after adding or removing USDC from a vault.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

VaultUserRoleResponse ¤

Bases: TypedDict

A response to a user role request for a vault.

Attributes:

Name Type Description
role Literal['vault']

The role vault.

role instance-attribute ¤

role: Literal['vault']

The role vault.

VipTier ¤

Bases: TypedDict

A VIP tier.

Attributes:

Name Type Description
add str

The add of the VIP tier.

cross str

The cross of the VIP tier.

ntlCutoff str

The notional cutoff of the VIP tier.

spotAdd str

The spot add of the VIP tier.

spotCross str

The spot cross of the VIP tier.

add instance-attribute ¤

add: str

The add of the VIP tier.

cross instance-attribute ¤

cross: str

The cross of the VIP tier.

ntlCutoff instance-attribute ¤

ntlCutoff: str

The notional cutoff of the VIP tier.

spotAdd instance-attribute ¤

spotAdd: str

The spot add of the VIP tier.

spotCross instance-attribute ¤

spotCross: str

The spot cross of the VIP tier.

WebData2Data ¤

Bases: TypedDict

The payload of a message from the exchange containing web data 2.

Attributes:

Name Type Description
agentAddress str

The agent address.

agentValidUntil int

The timestamp until which the agent is valid.

assetCtxs list[AssetCtx]

List of asset contexts for perpetual assets.

clearingHouseState UserState

The user's clearing house state containing positions and margin info.

cumLedger str

The cumulative ledger value.

isVault bool

Whether the user is a vault.

leadingVaults list[FIXME]

List of leading vaults.

meta Meta

The perpetual metadata.

openOrders list[FIXME]

List of open orders.

serverTime int

The server timestamp.

spotAssetCtxs list[SpotAssetCtx]

List of spot asset contexts.

spotState SpotUserState

The user's spot state.

totalVaultEquity str

The total vault equity.

twapStates list[FIXME]

List of TWAP states.

user str

The user address.

agentAddress instance-attribute ¤

agentAddress: str

The agent address.

agentValidUntil instance-attribute ¤

agentValidUntil: int

The timestamp until which the agent is valid.

assetCtxs instance-attribute ¤

assetCtxs: list[AssetCtx]

List of asset contexts for perpetual assets.

clearingHouseState instance-attribute ¤

clearingHouseState: UserState

The user's clearing house state containing positions and margin info.

cumLedger instance-attribute ¤

cumLedger: str

The cumulative ledger value.

isVault instance-attribute ¤

isVault: bool

Whether the user is a vault.

leadingVaults instance-attribute ¤

leadingVaults: list[FIXME]

List of leading vaults.

meta instance-attribute ¤

meta: Meta

The perpetual metadata.

openOrders instance-attribute ¤

openOrders: list[FIXME]

List of open orders.

serverTime instance-attribute ¤

serverTime: int

The server timestamp.

spotAssetCtxs instance-attribute ¤

spotAssetCtxs: list[SpotAssetCtx]

List of spot asset contexts.

spotState instance-attribute ¤

spotState: SpotUserState

The user's spot state.

totalVaultEquity instance-attribute ¤

totalVaultEquity: str

The total vault equity.

twapStates instance-attribute ¤

twapStates: list[FIXME]

List of TWAP states.

user instance-attribute ¤

user: str

The user address.

WebData2Msg ¤

Bases: TypedDict

A message from the exchange containing web data 2. Response to a :obj:WebData2Subscription.

Attributes:

Name Type Description
channel Literal['webData2']

The channel of the message set to webData2.

data WebData2Data

The web data 2 payload.

channel instance-attribute ¤

channel: Literal['webData2']

The channel of the message set to webData2.

data instance-attribute ¤

The web data 2 payload.

WebData2Subscription ¤

Bases: TypedDict

Subscribe to web data 2.

Attributes:

Name Type Description
type Literal['webData2']

The subscription type.

user str

The user address to subscribe to.

type instance-attribute ¤

type: Literal['webData2']

The subscription type.

user instance-attribute ¤

user: str

The user address to subscribe to.

WithdrawAction ¤

Bases: TypedDict

An action to withdraw USDC via Arbitrum.

Attributes:

Name Type Description
amount str

The amount to withdraw.

destination str

The destination address.

hyperliquidChain str

The hyperliquid chain identifier.

signatureChainId str

The signature chain ID.

time int

The timestamp.

type Literal['withdraw3']

The action type.

amount instance-attribute ¤

amount: str

The amount to withdraw.

destination instance-attribute ¤

destination: str

The destination address.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

time instance-attribute ¤

time: int

The timestamp.

type instance-attribute ¤

type: Literal['withdraw3']

The action type.

WithdrawRequest ¤

Bases: TypedDict

A request to withdraw USDC via Arbitrum.

Attributes:

Name Type Description
action WithdrawAction

The withdraw action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The withdraw action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

WithdrawResponse ¤

Bases: TypedDict

A response from the exchange after withdrawing USDC via Arbitrum.

Attributes:

Name Type Description
response WithdrawResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

WithdrawResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after withdrawing USDC via Arbitrum.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

WithdrawStakingAction ¤

Bases: TypedDict

An action to withdraw a token from staking.

Attributes:

Name Type Description
hyperliquidChain str

The hyperliquid chain identifier.

nonce int

The nonce for the action.

signatureChainId str

The signature chain ID.

type Literal['cWithdraw']

The action type.

wei int

The amount in wei.

hyperliquidChain instance-attribute ¤

hyperliquidChain: str

The hyperliquid chain identifier.

nonce instance-attribute ¤

nonce: int

The nonce for the action.

signatureChainId instance-attribute ¤

signatureChainId: str

The signature chain ID.

type instance-attribute ¤

type: Literal['cWithdraw']

The action type.

wei instance-attribute ¤

wei: int

The amount in wei.

WithdrawStakingRequest ¤

Bases: TypedDict

A request to withdraw a token from staking.

Attributes:

Name Type Description
action WithdrawStakingAction

The withdraw staking action.

nonce int

The nonce for the request.

signature Signature

The signature for the request.

action instance-attribute ¤

The withdraw staking action.

nonce instance-attribute ¤

nonce: int

The nonce for the request.

signature instance-attribute ¤

signature: Signature

The signature for the request.

WithdrawStakingResponse ¤

Bases: TypedDict

A response from the exchange after withdrawing a token from staking.

Attributes:

Name Type Description
response WithdrawStakingResponseBody

The response body.

status Literal['ok']

The response status.

response instance-attribute ¤

The response body.

status instance-attribute ¤

status: Literal['ok']

The response status.

WithdrawStakingResponseBody ¤

Bases: TypedDict

The body of a response from the exchange after withdrawing a token from staking.

Attributes:

Name Type Description
type Literal['default']

The response type.

type instance-attribute ¤

type: Literal['default']

The response type.

WsSpotAssetCtx ¤

Bases: SpotAssetCtx

Spot asset context with additional fields only present in the WebSocket version.

Attributes:

Name Type Description
circulatingSupply str

The circulating supply.

coin str

The asset name.

dayBaseVlm str

The day base volume of the asset.

dayNtlVlm str

The day notional volume.

markPx str

The mark price.

midPx str | None

The mid price.

prevDayPx str

The previous day price.

totalSupply str

The total supply of the asset.

circulatingSupply instance-attribute ¤

circulatingSupply: str

The circulating supply.

coin instance-attribute ¤

coin: str

The asset name.

dayBaseVlm instance-attribute ¤

dayBaseVlm: str

The day base volume of the asset.

dayNtlVlm instance-attribute ¤

dayNtlVlm: str

The day notional volume.

markPx instance-attribute ¤

markPx: str

The mark price.

midPx instance-attribute ¤

midPx: str | None

The mid price.

prevDayPx instance-attribute ¤

prevDayPx: str

The previous day price.

totalSupply instance-attribute ¤

totalSupply: str

The total supply of the asset.

WsUserFundingDelta ¤

Bases: _UserFundingDeltaBase

A user funding delta as present in the WebSocket version.

Attributes:

Name Type Description
coin str

The asset of the funding.

fundingRate str

The funding rate.

nSamples None

The number of samples.

szi str

The size.

time int

The timestamp of the funding delta.

usdc str

The USDC amount.

coin instance-attribute ¤

coin: str

The asset of the funding.

fundingRate instance-attribute ¤

fundingRate: str

The funding rate.

nSamples instance-attribute ¤

nSamples: None

The number of samples.

szi instance-attribute ¤

szi: str

The size.

time instance-attribute ¤

time: int

The timestamp of the funding delta.

usdc instance-attribute ¤

usdc: str

The USDC amount.

is_error_status ¤

Type guard to check if an order status is an error.

is_filled_status ¤

Type guard to check if an order status is filled.

is_resting_status ¤

Type guard to check if an order status is resting.