Skip to main content

SpotDeploy

Enum SpotDeploy 

Source
#[non_exhaustive]
pub enum SpotDeploy {
Show 16 variants RegisterToken2 { spec: TokenSpec, max_gas: u64, full_name: Option<String>, }, UserGenesis { token: u32, user_and_wei: Vec<(Address, u128)>, existing_token_and_wei: Vec<(u32, u128)>, blacklist_users: Vec<(Address, bool)>, }, Genesis { token: u32, max_supply: u128, no_hyperliquidity: bool, }, RegisterSpot { base: u32, quote: u32, }, RegisterHyperliquidity { spot: u32, start_px: Dec, order_sz: Dec, n_orders: u32, n_seeded_levels: Option<u32>, }, SetDeployerTradingFeeShare { token: u32, share: FeeShare, }, EnableQuoteToken(u32), EnableAlignedQuoteToken(u32), DisableQuoteToken(u32), DisableAlignedQuoteToken(u32), SetTokenAnnotation { token: u32, annotation: Annotation, }, SetDeployerLabel(DexName), EnableFreezePrivilege(u32), FreezeUser { token: u32, user: Address, freeze: bool, }, RevokeFreezePrivilege(u32), RequestEvmContract { token: u32, address: Address, evm_extra_wei_decimals: i8, },
}
Expand description

{"type":"spotDeploy",<variant>:{..}}. A token is deployed in five steps sent in this order: RegisterToken2, UserGenesis (as many times as needed), Genesis, RegisterSpot and RegisterHyperliquidity. The rest are optional. Wei amounts are integers in the token’s wei decimals.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

RegisterToken2

registerToken2: claims a token index, paying the token auction up to max_gas. fullName is left out when None.

The gas paid is not refunded. max_gas is in HYPE wei, 8 decimals: 1 HYPE is 100_000_000, so 1_000_000_000_000 is 10,000 HYPE. The spec is fixed for good.

Fields

§spec: TokenSpec

The name, size decimals and wei decimals to register.

§max_gas: u64

The most to pay for the token auction (maxGas), in HYPE wei: 8 decimals.

§full_name: Option<String>

The full name (fullName); None leaves it out.

§

UserGenesis

userGenesis: wei for addresses, wei shared among the holders of existing tokens, and addresses to blacklist (true) or take off the blacklist (false). blacklistUsers is left out when empty.

Amounts are the token’s wei, the integer of whole tokens times 10^weiDecimals: with weiDecimals 8, 100_000_000 is one token. A later userGenesis for the same address replaces its amount rather than adding to it. The address 0xff..ff holds the hyperliquidity allocation. Balances are fixed for good at Genesis. Confirmed against mainnet deploys and tokenDetails.

Fields

§token: u32

The token index.

§user_and_wei: Vec<(Address, u128)>

Wei given to each address (userAndWei).

§existing_token_and_wei: Vec<(u32, u128)>

Wei shared among the holders of each existing token, by token index (existingTokenAndWei).

§blacklist_users: Vec<(Address, bool)>

Addresses to blacklist (true) or take off the blacklist (false) (blacklistUsers).

§

Genesis

genesis: the maximum supply in wei, which must equal what the user genesis steps gave out. noHyperliquidity is sent, as true, only when set.

Irreversible: the supply and every genesis balance are final. maxSupply is the token’s wei, whole tokens times 10^weiDecimals.

Fields

§token: u32

The token index.

§max_supply: u128

The maximum supply in wei (maxSupply), sent as a string.

§no_hyperliquidity: bool

true deploys without hyperliquidity (noHyperliquidity).

§

RegisterSpot

registerSpot: the pair of a base and a quote token. Between two existing tokens it pays the spot pair auction.

Fields

§base: u32

The base token index, sent first in tokens.

§quote: u32

The quote token index, sent second in tokens.

§

RegisterHyperliquidity

registerHyperliquidity: the pair index (not the token’s), the starting price, each order’s size in tokens (not wei), the number of orders (0 after a genesis with no hyperliquidity) and the number of levels seeded with USDC. nSeededLevels is left out when None.

Irreversible. startPx is the lowest level’s price in the quote token per whole token; each level above is 0.3% higher. orderSz is whole tokens per level, and nOrders times orderSz must be the 0xff..ff genesis balance. Confirmed against mainnet deploys and their books.

Fields

§spot: u32

The spot pair index.

§start_px: Dec

The starting price (startPx).

§order_sz: Dec

Each order’s size in tokens, not wei (orderSz).

§n_orders: u32

The number of orders (nOrders).

§n_seeded_levels: Option<u32>

The number of levels seeded with USDC (nSeededLevels); None leaves it out.

§

SetDeployerTradingFeeShare

setDeployerTradingFeeShare, at any time after registerToken2, and again only to a strictly lower share: the venue refuses a raise and the same value. Sent as a percentage string, "5%"; spotMeta shows it as a fraction, 0.05.

Fields

§token: u32

The token index.

§share: FeeShare

The share the deployer keeps.

§

EnableQuoteToken(u32)

enableQuoteToken: lets the token quote spot pairs.

§

EnableAlignedQuoteToken(u32)

👎Deprecated since 0.1.1:

Hyperliquid’s nodes refuse this action; see the variant’s docs

enableAlignedQuoteToken: makes the token an aligned quote asset, as the docs write it.

Hyperliquid’s nodes do not take this action yet: mainnet and testnet refuse it with 422 Failed to deserialize for every shape, the answer for an action that does not exist (checked 2026-11-24 by just testnet).

§

DisableQuoteToken(u32)

disableQuoteToken.

§

DisableAlignedQuoteToken(u32)

👎Deprecated since 0.1.1:

Hyperliquid’s nodes refuse this action; see the variant’s docs

disableAlignedQuoteToken, sent after disableQuoteToken, as the docs write it.

Hyperliquid’s nodes do not take this action yet: mainnet and testnet refuse it with 422 Failed to deserialize for every shape (checked 2026-11-24 by just testnet).

§

SetTokenAnnotation

setTokenAnnotation, at any time after registerToken2, at most once a day.

Fields

§token: u32

The token index.

§annotation: Annotation

The annotation.

§

SetDeployerLabel(DexName)

setDeployerLabel: the label shown for the deployer’s tokens, set once per deployer.

§

EnableFreezePrivilege(u32)

enableFreezePrivilege: lets the deployer freeze holders of the token. In Hyperliquid’s Python SDK; not in the API docs.

§

FreezeUser

freezeUser: freezes (true) or unfreezes (false) one holder. In Hyperliquid’s Python SDK; not in the API docs.

Fields

§token: u32

The token index.

§user: Address

The holder to freeze or unfreeze.

§freeze: bool

true freezes, false unfreezes.

§

RevokeFreezePrivilege(u32)

revokeFreezePrivilege: gives the freeze privilege up. In Hyperliquid’s Python SDK; not in the API docs.

§

RequestEvmContract

requestEvmContract: asks to link the token to an ERC-20 on the HyperEVM; the contract’s deployer then sends FinalizeEvmContract. evm_extra_wei_decimals is the EVM contract’s decimals less the token’s wei decimals, from -2 to 18. Linking cannot be undone.

Fields

§token: u32

The token index.

§address: Address

The ERC-20 contract’s address on the HyperEVM.

§evm_extra_wei_decimals: i8

The EVM contract’s decimals less the token’s wei decimals (evmExtraWeiDecimals), from -2 to 18.

Implementations§

Source§

impl SpotDeploy

Source

pub fn register_hyperliquidity( spot: u32, start_px: Dec, order_sz: Dec, n_orders: u32, n_seeded_levels: Option<u32>, ) -> Result<Self, BadDeploy>

registerHyperliquidity, refusing a negative price or size.

Source

pub fn request_evm_contract( token: u32, address: Address, evm_extra_wei_decimals: i8, ) -> Result<Self, BadDeploy>

requestEvmContract, refusing extra wei decimals outside -2 to 18.

Source

pub const fn wire_name(&self) -> &'static str

The key the variant travels under.

Source

pub fn body(&self) -> Map

The body under wire_name, keys in the order the docs and the venue’s clients write them.

Trait Implementations§

Source§

impl Clone for SpotDeploy

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpotDeploy

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SpotDeploy

Source§

impl L1Action for SpotDeploy

Source§

fn action(&self) -> Map

The action’s keys and values in wire order, which is the hashed order.
Source§

fn msgpack(&self) -> Vec<u8> ⓘ

The action as msgpack bytes, the first part of the connection id’s hash.
Source§

fn wire(&self) -> String

The action as posted.
Source§

fn connection_id(&self, nonce: u64, vault: Option<Address>) -> [u8; 32]

connection_id of this action at nonce, for vault when it acts for one.
Source§

fn typed( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> TypedStruct<'static>

The phantom agent struct the key signs for this action.
Source§

fn digest( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> [u8; 32]

What the key signs for this action: the phantom agent’s digest under Domain::EXCHANGE.
Source§

fn wallet_json( &self, nonce: u64, vault: Option<Address>, network: Network, ) -> String

For a master wallet signing in the browser. It needs chain 1337.
Source§

fn body( &self, nonce: u64, signature: &Signature, vault: Option<Address>, ) -> String

The /exchange body: action, nonce, signature and vaultAddress, null when there is no vault.
Source§

impl PartialEq for SpotDeploy

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SpotDeploy

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more