Types¤
hl.types
¤
Classes:
Name | Description |
---|---|
ActiveAssetCtxMsg |
A message from the exchange containing active perpetual asset context. Response to an |
ActiveAssetCtxSubscription |
Subscribe to active asset context. |
ActiveAssetData |
The payload of a message from the exchange containing active asset data. Response to an :obj: |
ActiveAssetDataMsg |
A message from the exchange containing active asset data. Response to an :obj: |
ActiveAssetDataSubscription |
Subscribe to active asset data. |
ActiveSpotAssetCtxMsg |
A message from the exchange containing active spot asset context. Response to an :obj: |
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: |
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: |
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: |
BestBidOfferMsg |
A message from the exchange containing best bid offer data. Response to an :obj: |
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: |
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: |
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: |
Notification |
A notification. |
NotificationMsg |
A message from the exchange containing a notification. Response to a :obj: |
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 |
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: |
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: |
PostMsg |
A message from the exchange containing the response to a :obj: |
PostRequest |
A request to send to the websocket API via the |
PostRequestExchange |
A request to send to the websocket API via the |
PostRequestInfo |
A request to send to the websocket API via the |
PostResponseExchange |
The value of a response from the exchange after sending a /exchange :obj: |
PostResponseInfo |
The value of a response from the exchange after sending a /info :obj: |
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 |
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 |
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: |
UserFillsEvent |
The payload of a message from the exchange containing user fills. Response to a :obj: |
UserFillsMsg |
A message from the exchange containing user fills. Response to a :obj: |
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: |
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: |
UserFundingsMsg |
A message from the exchange containing user fundings. Response to a :obj: |
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: |
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: |
UserNonFundingLedgerUpdatesMsg |
A message from the exchange containing user non-funding ledger updates. Response to a :obj: |
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: |
UserTwapHistoryItem |
A user TWAP history item. |
UserTwapHistoryMsg |
A message from the exchange containing user TWAP history. Response to an :obj: |
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: |
UserTwapSliceFillsMsg |
A message from the exchange containing user TWAP slice fills. Response to an :obj: |
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 |
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. |
Action
module-attribute
¤
Action: TypeAlias = (
OrderAction
| ModifyAction
| BatchModifyAction
| CancelAction
| CancelByCloidAction
| ScheduleCancelAction
| UpdateLeverageAction
| UpdateIsolatedMarginAction
| TopUpIsolatedOnlyMarginAction
| TwapOrderAction
| TwapCancelAction
| UsdSendAction
| SpotSendAction
| WithdrawAction
| UsdClassTransferAction
| PerpDexClassTransferAction
| VaultTransferAction
| ApproveAgentAction
| ApproveBuilderFeeAction
| DepositStakingAction
| WithdrawStakingAction
| TokenDelegateAction
| ReserveRequestWeightAction
| SetReferrerAction
| CreateVaultAction
| CreateSubAccountAction
| RegisterReferrerAction
| SubAccountTransferAction
| ConvertToMultiSigUserAction
| MultiSigAction
)
A union of all possible actions that can be performed on the exchange.
AllMids
module-attribute
¤
All mids for all actively traded coins mapping the coin name to the mid price.
AllMidsResponse
module-attribute
¤
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
¤
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.
ExchangeRequest
module-attribute
¤
ExchangeRequest = (
OrderRequest
| CancelRequest
| CancelByCloidRequest
| ScheduleCancelRequest
| ModifyRequest
| BatchModifyRequest
| UpdateLeverageRequest
| UpdateIsolatedMarginRequest
| TopUpIsolatedOnlyMarginRequest
| TwapOrderRequest
| TwapCancelRequest
| UsdSendRequest
| SpotSendRequest
| WithdrawRequest
| UsdClassTransferRequest
| PerpDexClassTransferRequest
| VaultTransferRequest
| ApproveAgentRequest
| ApproveBuilderFeeRequest
| DepositStakingRequest
| WithdrawStakingRequest
| TokenDelegateRequest
| ReserveRequestWeightRequest
| SetReferrerRequest
| CreateVaultRequest
| CreateSubAccountRequest
| SubAccountTransferRequest
| ConvertToMultiSigUserRequest
| MultiSigRequest
)
A union of all possible requests that can be sent to the exchange API.
ExchangeResponse
module-attribute
¤
ExchangeResponse = (
OrderResponse
| CancelResponse
| CancelByCloidResponse
| ScheduleCancelResponse
| ModifyResponse
| BatchModifyResponse
| UpdateLeverageResponse
| UpdateIsolatedMarginResponse
| TopUpIsolatedOnlyMarginResponse
| TwapOrderResponse
| TwapCancelResponse
| UsdSendResponse
| SpotSendResponse
| WithdrawResponse
| UsdClassTransferResponse
| PerpDexClassTransferResponse
| VaultTransferResponse
| ApproveAgentResponse
| ApproveBuilderFeeResponse
| DepositStakingResponse
| WithdrawStakingResponse
| TokenDelegateResponse
| ReserveRequestWeightResponse
| SetReferrerResponse
| CreateVaultResponse
| CreateSubAccountResponse
| SubAccountTransferResponse
| ConvertToMultiSigUserResponse
| MultiSigResponse
)
A union of all possible responses that can be returned from the exchange API.
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.
InfoRequest
module-attribute
¤
InfoRequest = (
AllMidsRequest
| OpenOrdersRequest
| FrontendOpenOrdersRequest
| UserFillsRequest
| UserFillsByTimeRequest
| UserTwapSliceFillsRequest
| UserRateLimitRequest
| OrderStatusRequest
| HistoricalOrdersRequest
| SubAccountsRequest
| L2BookRequest
| CandleSnapshotRequest
| MaxBuilderFeeRequest
| VaultDetailsRequest
| UserVaultEquitiesRequest
| UserRoleRequest
| PortfolioRequest
| ReferralRequest
| UserFeesRequest
| DelegationsRequest
| DelegatorSummaryRequest
| DelegatorHistoryRequest
| DelegatorRewardsRequest
| PerpDexsRequest
| MetaRequest
| MetaAndAssetCtxsRequest
| UserStateRequest
| UserFundingRequest
| UserNonFundingLedgerUpdatesRequest
| FundingHistoryRequest
| PredictedFundingsRequest
| PerpsAtOpenInterestCapRequest
| PerpDeployAuctionStatusRequest
| SpotMetaRequest
| SpotMetaAndAssetCtxsRequest
| SpotUserStateRequest
| SpotDeployAuctionStatusRequest
| TokenDetailsRequest
)
A union of all possible requests that can be sent to the info API.
InfoResponse
module-attribute
¤
InfoResponse = (
AllMidsResponse
| OpenOrdersResponse
| FrontendOpenOrdersResponse
| UserFillsResponse
| UserTwapSliceFillsResponse
| UserRateLimitResponse
| OrderStatusResponse
| HistoricalOrdersResponse
| SubAccountsResponse
| L2BookResponse
| CandleSnapshotResponse
| MaxBuilderFeeResponse
| VaultDetailsResponse
| UserVaultEquitiesResponse
| UserRoleResponse
| PortfolioResponse
| ReferralResponse
| UserFeesResponse
| DelegationsResponse
| DelegatorSummaryResponse
| DelegatorHistoryResponse
| DelegatorRewardsResponse
| PerpDexsResponse
| MetaResponse
| MetaAndAssetCtxsResponse
| UserStateResponse
| UserFundingResponse
| UserNonFundingLedgerUpdatesResponse
| FundingHistoryResponse
| PredictedFundingsResponse
| PerpsAtOpenInterestCapResponse
| PerpDeployAuctionStatusResponse
| SpotMetaResponse
| SpotMetaAndAssetCtxsResponse
| SpotUserStateResponse
| SpotDeployAuctionStatusResponse
| TokenDetailsResponse
)
A union of all possible responses that can be returned from the info API.
L2BookResponse
module-attribute
¤
L2 book data as a response to an L2 book request.
MaxBuilderFeeResponse
module-attribute
¤
The max builder fee as a response to a max builder fee request.
MetaAndAssetCtxsResponse
module-attribute
¤
The perpetual metadata and asset context as a response to a meta and asset ctxs request.
MetaResponse
module-attribute
¤
Perpetual metadata as a response to a meta request.
Msg
module-attribute
¤
Msg = (
PongMsg
| SubscriptionResponseMsg
| AllMidsMsg
| NotificationMsg
| WebData2Msg
| CandleMsg
| L2BookMsg
| TradesMsg
| OrderUpdatesMsg
| UserEventsMsg
| UserFillsMsg
| UserFundingsMsg
| UserNonFundingLedgerUpdatesMsg
| ActiveAssetCtxMsg
| ActiveSpotAssetCtxMsg
| ActiveAssetDataMsg
| UserTwapSliceFillsMsg
| UserTwapHistoryMsg
| BestBidOfferMsg
| PostMsg
)
A union of all possible messages that can be received via WebSocket.
OpenOrdersResponse
module-attribute
¤
A list of open orders as a response to an open orders request.
OrderResponseDataStatus
module-attribute
¤
OrderResponseDataStatus: TypeAlias = (
OrderResponseDataStatusResting
| OrderResponseDataStatusError
| OrderResponseDataStatusFilled
)
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
¤
OrderType = LimitOrderType | TriggerOrderType
A union of order types (limit or trigger).
OrderTypeWire
module-attribute
¤
OrderTypeWire: TypeAlias = (
LimitOrderTypeWire | TriggerOrderTypeWire
)
Serialized limit or trigger parameters for an order.
PerpDexsResponse
module-attribute
¤
A response to a perp dexs request. The first item is always None, subsequent items are perp dex dicts.
PerpsAtOpenInterestCapResponse
module-attribute
¤
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
¤
ReferrerState: TypeAlias = (
NeedToCreateCodeReferrerState | ReadyReferrerState
)
A referrer state.
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
¤
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.
Subscription
module-attribute
¤
Subscription: TypeAlias = (
AllMidsSubscription
| NotificationSubscription
| WebData2Subscription
| CandleSubscription
| L2BookSubscription
| TradesSubscription
| OrderUpdatesSubscription
| UserEventsSubscription
| UserFillsSubscription
| UserFundingsSubscription
| UserNonFundingLedgerUpdatesSubscription
| ActiveAssetCtxSubscription
| ActiveAssetDataSubscription
| UserTwapSliceFillsSubscription
| UserTwapHistorySubscription
| BestBidOfferSubscription
)
A union of all possible WebSocket subscription types.
UserEvent
module-attribute
¤
UserEvent = (
UserFillsEvent
| UserFundingEvent
| UserLiquidationEvent
| NonUserCancelEvent
)
A union of all possible user events that can be received via WebSocket.
UserFillsResponse
module-attribute
¤
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
¤
UserRoleResponse: TypeAlias = (
UserUserRoleResponse
| VaultUserRoleResponse
| SubAccountUserRoleResponse
| AgentUserRoleResponse
| MissingUserRoleResponse
)
A response to a user role request.
UserStateResponse
module-attribute
¤
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 |
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
¤
data: AssetCtxData
The payload of the message containing the active asset context.
ActiveAssetCtxSubscription
¤
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. |
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 |
data |
ActiveAssetData
|
The active asset data. |
ActiveAssetDataSubscription
¤
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 |
data |
SpotAssetCtx
|
The spot asset context data. |
AgentData
¤
AgentUserRoleResponse
¤
AllMidsData
¤
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 |
data |
AllMidsData
|
The all mids data. |
AllMidsRequest
¤
AllMidsSubscription
¤
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. |
ApproveAgentRequest
¤
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. |
ApproveAgentResponseBody
¤
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. |
ApproveBuilderFeeRequest
¤
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. |
ApproveBuilderFeeResponseBody
¤
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. |
AssetCtxData
¤
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. |
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. |
onlyIsolated
instance-attribute
¤
onlyIsolated: NotRequired[bool]
Whether the asset is only available for isolated margin.
AssetPosition
¤
BatchModifyAction
¤
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. |
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. |
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. |
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. |
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 |
data |
BestBidOfferData
|
The best bid offer data. |
BestBidOfferSubscription
¤
BuilderOptions
¤
Cancel
¤
CancelAction
¤
CancelByCloid
¤
CancelByCloidAction
¤
CancelByCloidParams
¤
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. |
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. |
CancelParams
¤
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. |
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. |
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
¤
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. |
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. |
CandleMsg
¤
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. |
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. |
CandleSubscription
¤
ConvertToMultiSigUserAction
¤
ConvertToMultiSigUserRequest
¤
ConvertToMultiSigUserResponse
¤
CreateSubAccountAction
¤
CreateSubAccountRequest
¤
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. |
CreateSubAccountResponseBody
¤
CreateVaultAction
¤
CreateVaultRequest
¤
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. |
CreateVaultResponseBody
¤
CumFunding
¤
DailyUserVlm
¤
Delegation
¤
DelegationsRequest
¤
DelegatorDeltaCDeposit
¤
Bases: TypedDict
A delegator delta c deposit.
Attributes:
Name | Type | Description |
---|---|---|
cDeposit |
DelegatorDeltaCDepositData
|
The c deposit data. |
DelegatorDeltaCDepositData
¤
DelegatorDeltaDelegate
¤
Bases: TypedDict
A delegator delta.
Attributes:
Name | Type | Description |
---|---|---|
delegate |
DelegatorDeltaDelegateData
|
The delegate data. |
DelegatorDeltaDelegateData
¤
DelegatorDeltaWithdrawal
¤
Bases: TypedDict
A delegator delta withdrawal.
Attributes:
Name | Type | Description |
---|---|---|
withdrawal |
DelegatorDeltaWithdrawalData
|
The withdrawal data. |
DelegatorDeltaWithdrawalData
¤
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
¤
delta: (
DelegatorDeltaDelegate
| DelegatorDeltaWithdrawal
| DelegatorDeltaCDeposit
)
The delta data for the history item.
DelegatorHistoryRequest
¤
DelegatorReward
¤
DelegatorRewardsRequest
¤
DelegatorSummaryRequest
¤
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. |
DepositStakingAction
¤
DepositStakingRequest
¤
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. |
DepositStakingResponseBody
¤
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. |
stakingDiscountTiers
instance-attribute
¤
stakingDiscountTiers: list[StakingDiscountTier]
The staking discount tiers.
FeeTiers
¤
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. |
FrontendOpenOrdersRequest
¤
FundingHistoryItem
¤
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. |
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. |
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. |
HistoricalOrdersRequest
¤
L2Book
¤
L2BookMsg
¤
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. |
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.
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. |
nSigFigs
instance-attribute
¤
nSigFigs: NotRequired[int]
The number of significant figures to use for the L2 book.
L2Level
¤
Leverage
¤
LimitOrderType
¤
LimitOrderTypeWire
¤
Bases: TypedDict
Serialized limit parameters for an order.
Attributes:
Name | Type | Description |
---|---|---|
limit |
LimitOrderTypeWireData
|
The limit order data. |
LimitOrderTypeWireData
¤
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. |
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. |
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. |
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. |
MaxBuilderFeeRequest
¤
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. |
MetaAndAssetCtxsRequest
¤
MissingUserRoleResponse
¤
ModifyAction
¤
ModifyParams
¤
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. |
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. |
ModifyResponseResponse
¤
ModifyWire
¤
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. |
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. |
MultiSigRequest
¤
MultiSigResponse
¤
NeedToCreateCodeReferrerState
¤
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. |
NonUserCancel
¤
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. |
Notification
¤
Bases: TypedDict
A notification.
Attributes:
Name | Type | Description |
---|---|---|
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 |
data |
Notification
|
The notification data. |
NotificationSubscription
¤
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. |
OpenOrdersRequest
¤
OrderAction
¤
OrderIdData
¤
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. |
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. |
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. |
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. |
OrderResponseDataStatusError
¤
OrderResponseDataStatusFilled
¤
Bases: TypedDict
The status of a filled order.
Attributes:
Name | Type | Description |
---|---|---|
filled |
OrderResponseFill
|
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. |
OrderResponseFill
¤
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. |
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. |
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. |
isPositionTpsl
instance-attribute
¤
isPositionTpsl: bool
Whether the order is a position take profit or stop loss order.
orderType
instance-attribute
¤
orderType: Literal['Limit', 'Trigger', 'Market']
The type of the order.
OrderStatusRequest
¤
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"). |
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. |
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 |
data |
list[OrderUpdate]
|
List of order updates. |
OrderUpdatesSubscription
¤
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. |
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. |
PerpDex
¤
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. |
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. |
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. |
PerpDexClassTransferResponseBody
¤
Ping
¤
PongMsg
¤
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. |
PortfolioRequest
¤
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. |
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. |
PostMsg
¤
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 |
request |
PostRequestInfo | PostRequestExchange
|
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. |
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. |
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. |
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. |
PredictedFundingRate
¤
Bases: TypedDict
A predicted funding rate.
Attributes:
Name | Type | Description |
---|---|---|
fundingRate |
str
|
The predicted funding rate. |
nextFundingTime |
int
|
The next funding time. |
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. |
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. |
referralStates
instance-attribute
¤
referralStates: list[ReferralState]
The referral states of the referrer.
ReferralRequest
¤
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. |
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 |
ReferredBy
¤
RegisterReferrerAction
¤
RegisterReferrerRequest
¤
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. |
RegisterReferrerResponseBody
¤
ReserveRequestWeightAction
¤
ReserveRequestWeightRequest
¤
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. |
ReserveRequestWeightResponseBody
¤
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.
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. |
ScheduleCancelResponse
¤
SetReferrerAction
¤
SetReferrerRequest
¤
SetReferrerResponse
¤
Signature
¤
Signers
¤
SpotAssetCtx
¤
SpotAssetMeta
¤
SpotBalance
¤
SpotDeployAuctionStatusRequest
¤
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. |
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. |
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
¤
The existing token genesis balances.
hyperliquidityGenesisBalance
instance-attribute
¤
hyperliquidityGenesisBalance: str
The hyperliquidity genesis balance.
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. |
SpotMetaAndAssetCtxsRequest
¤
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. |
SpotSendRequest
¤
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. |
SpotSendResponseBody
¤
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. |
SpotUserState
¤
Bases: TypedDict
A user's spot balances.
Attributes:
Name | Type | Description |
---|---|---|
balances |
list[SpotBalance]
|
The list of spot balances. |
SpotUserStateRequest
¤
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. |
StakingLink
¤
Bases: TypedDict
A staking link.
Attributes:
Name | Type | Description |
---|---|---|
stakingUser |
str
|
The staking user address. |
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. |
SubAccountData
¤
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. |
SubAccountTransferRequest
¤
SubAccountTransferResponse
¤
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. |
SubAccountsRequest
¤
Subscribe
¤
Bases: TypedDict
A request to subscribe to a specific data feed.
Attributes:
Name | Type | Description |
---|---|---|
method |
Literal['subscribe']
|
The method set to |
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 |
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
¤
data: Subscribe | Unsubscribe
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. |
TokenDelegateRequest
¤
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. |
TokenDelegateResponseBody
¤
TokenDetailsRequest
¤
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. |
nonCirculatingUserBalances
instance-attribute
¤
The non-circulating user balances.
TopUpIsolatedOnlyMarginAction
¤
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
¤
action: TopUpIsolatedOnlyMarginAction
The top up isolated margin action.
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. |
TopUpIsolatedOnlyMarginResponseBody
¤
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). |
TradesMsg
¤
TradesSubscription
¤
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. |
TriggerOrderTypeWire
¤
Bases: TypedDict
Serialized trigger parameters for an order.
Attributes:
Name | Type | Description |
---|---|---|
trigger |
TriggerOrderTypeWireData
|
The trigger order data. |
TriggerOrderTypeWireData
¤
TwapCancelAction
¤
TwapCancelRequest
¤
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. |
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. |
TwapCancelResponseDataError
¤
Bases: TypedDict
A error status in response to canceling a TWAP order.
Attributes:
Name | Type | Description |
---|---|---|
status |
TwapCancelResponseDataErrorDetail
|
The error details. |
TwapCancelResponseDataErrorDetail
¤
TwapCancelResponseDataSuccess
¤
TwapOrderAction
¤
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
¤
status: (
TwapOrderDataStatusRunning | TwapOrderDataStatusError
)
The status of the TWAP order.
TwapOrderDataStatusError
¤
TwapOrderDataStatusRunning
¤
Bases: TypedDict
A running status in response to placing a TWAP order.
Attributes:
Name | Type | Description |
---|---|---|
running |
TwapOrderDataStatusRunningData
|
The running status data. |
TwapOrderDataStatusRunningData
¤
TwapOrderRequest
¤
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. |
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. |
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. |
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. |
TwapWire
¤
Unsubscribe
¤
Bases: TypedDict
A request to unsubscribe from a specific data feed.
Attributes:
Name | Type | Description |
---|---|---|
method |
Literal['unsubscribe']
|
The method set to |
subscription |
Subscription
|
The subscription details. |
UpdateIsolatedMarginAction
¤
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. |
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. |
UpdateIsolatedMarginResponseBody
¤
UpdateLeverageAction
¤
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. |
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. |
UpdateLeverageResponseBody
¤
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. |
UsdClassTransferRequest
¤
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. |
UsdClassTransferResponseBody
¤
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. |
UsdSendRequest
¤
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. |
UsdSendResponseBody
¤
UserAccountClassTransferDelta
¤
UserDepositDelta
¤
UserEventsMsg
¤
UserEventsSubscription
¤
UserFeesRequest
¤
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.
nextTrialAvailableTimestamp
instance-attribute
¤
nextTrialAvailableTimestamp: None
The timestamp when the next trial becomes available.
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. |
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.
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. |
UserFillsEvent
¤
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 |
data |
UserFillsData
|
The user fills data. |
UserFillsRequest
¤
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. |
UserFunding
¤
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. |
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. |
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. |
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. |
isSnapshot
instance-attribute
¤
isSnapshot: NotRequired[bool]
Whether this is a snapshot message (only present in the first message).
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 |
data |
UserFundingsData
|
The user fundings data. |
UserFundingsSubscription
¤
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. |
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. |
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
¤
delta: (
UserAccountClassTransferDelta
| UserDepositDelta
| UserWithdrawDelta
| UserSpotTransferDelta
| UserSpotGenesisDelta
| UserVaultCreateDelta
)
The delta data for 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.
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 |
data |
UserNonFundingLedgerUpdatesData
|
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. |
UserNonFundingLedgerUpdatesSubscription
¤
UserRateLimitRequest
¤
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. |
UserRoleRequest
¤
UserSpotGenesisDelta
¤
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. |
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.
UserStateRequest
¤
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. |
isSnapshot
instance-attribute
¤
isSnapshot: NotRequired[bool]
Whether this is a snapshot message (only present in the first message).
UserTwapHistoryItem
¤
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 |
data |
UserTwapHistoryData
|
The user TWAP history data. |
UserTwapHistorySubscription
¤
UserTwapSliceFill
¤
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.
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 |
data |
UserTwapSliceFillsData
|
The user TWAP slice fills data. |
UserTwapSliceFillsRequest
¤
UserTwapSliceFillsSubscription
¤
UserUserRoleResponse
¤
UserVaultCreateDelta
¤
UserVaultEquitiesRequest
¤
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. |
UserWithdrawDelta
¤
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. |
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. |
alwaysCloseOnWithdraw
instance-attribute
¤
alwaysCloseOnWithdraw: bool
Whether the vault always closes on withdraw.
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]
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. |
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.
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. |
VaultRelationship
¤
VaultTransferAction
¤
VaultTransferRequest
¤
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. |
VaultTransferResponseBody
¤
VaultUserRoleResponse
¤
VipTier
¤
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. |
agentValidUntil
instance-attribute
¤
agentValidUntil: int
The timestamp until which the agent is valid.
assetCtxs
instance-attribute
¤
List of asset contexts for perpetual assets.
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 |
data |
WebData2Data
|
The web data 2 payload. |
WebData2Subscription
¤
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. |
WithdrawRequest
¤
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. |
WithdrawResponseBody
¤
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. |
WithdrawStakingRequest
¤
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. |
WithdrawStakingResponseBody
¤
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. |
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. |
is_error_status
¤
is_error_status(
status: OrderResponseDataStatus,
) -> TypeGuard[OrderResponseDataStatusError]
Type guard to check if an order status is an error.
is_filled_status
¤
is_filled_status(
status: OrderResponseDataStatus,
) -> TypeGuard[OrderResponseDataStatusFilled]
Type guard to check if an order status is filled.
is_resting_status
¤
is_resting_status(
status: OrderResponseDataStatus,
) -> TypeGuard[OrderResponseDataStatusResting]
Type guard to check if an order status is resting.