View Source Hyperliquid.Api.Exchange.SpotDeploy (hyperliquid v0.3.0)
Deploy and manage HIP-1 and HIP-2 spot tokens.
Sub-action functions:
| Function | SDK key | Purpose |
|---|---|---|
register_token2/2 | registerToken2 | Register a new spot token |
user_genesis/2 | userGenesis | Set user genesis allocations |
genesis/2 | genesis | Configure token supply and hyperliquidity |
register_spot/3 | registerSpot | Register a base/quote trading pair |
register_hyperliquidity/2 | registerHyperliquidity | Seed liquidity (HIP-2) |
set_deployer_trading_fee_share/3 | setDeployerTradingFeeShare | Set deployer fee share (0–100%) |
enable_quote_token/2 | enableQuoteToken | Convert a token to a quote token |
enable_aligned_quote_token/2 | enableAlignedQuoteToken | Enable aligned quote token status |
See: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/deploying-hip-1-and-hip-2-assets
Typical deployment sequence
# 1. Register the token
{:ok, _} = SpotDeploy.register_token2(%{
spec: %{name: "MYTOKEN", sz_decimals: 2, wei_decimals: 8},
max_gas: 1_000_000,
full_name: "My Token" # optional
})
# 2. Set user genesis allocations (tuples: {address, amount_in_wei})
{:ok, _} = SpotDeploy.user_genesis(%{
token: 42,
user_and_wei: [{"0xabc...", "1000000000"}],
existing_token_and_wei: []
})
# 3. Finalize genesis (max supply)
{:ok, _} = SpotDeploy.genesis(%{token: 42, max_supply: "1000000000"})
# 4. Register spot pair (base token, quote token index)
{:ok, _} = SpotDeploy.register_spot(42, 0)
# 5. Seed hyperliquidity (HIP-2)
{:ok, _} = SpotDeploy.register_hyperliquidity(%{
spot: 10,
start_px: "1.0",
order_sz: "100",
n_orders: 10
})
# 6. Set deployer fee share
{:ok, _} = SpotDeploy.set_deployer_trading_fee_share(42, "50")
Summary
Functions
Enable aligned quote token status for a token.
Convert a token to a quote token.
Finalize token genesis (max supply and hyperliquidity settings).
Register hyperliquidity seeding configuration for a spot pair (HIP-2).
Register a spot trading pair (HIP-1 step 3).
Register a new spot token (HIP-1 step 1).
Set the deployer's trading fee share for a token (0–100%).
Set user genesis balance allocations for a deployed token (HIP-1 step 2).
Functions
Enable aligned quote token status for a token.
Parameters
token: Token integer ID to enable as aligned quote tokenopts: Optional keyword list (:private_key)
Convert a token to a quote token.
Parameters
token: Token integer ID to enable as quote tokenopts: Optional keyword list (:private_key)
Finalize token genesis (max supply and hyperliquidity settings).
Parameters
params: Map with::token— Token integer ID:max_supply— Maximum total supply as a decimal string:no_hyperliquidity— Optional; set totrueto set hyperliquidity balance to 0
opts: Optional keyword list (:private_key)
Register hyperliquidity seeding configuration for a spot pair (HIP-2).
Parameters
params: Map with::spot— Spot index (distinct from base token index):start_px— Starting price as a decimal string:order_sz— Order size as a decimal string (not in wei):n_orders— Total number of orders to place (integer):n_seeded_levels— Optional; number of levels to seed with USDC (integer)
opts: Optional keyword list (:private_key)
Register a spot trading pair (HIP-1 step 3).
Parameters
base_token: Base token integer IDquote_token: Quote token integer ID (usually 0 for USDC)opts: Optional keyword list (:private_key)
Register a new spot token (HIP-1 step 1).
Parameters
params: Map with::spec—%{name: String, sz_decimals: integer, wei_decimals: integer}:max_gas— Max gas in native token wei (integer):full_name— Optional full token name string
opts: Optional keyword list (:private_key)
Set user genesis balance allocations for a deployed token (HIP-1 step 2).
Parameters
params: Map with::token— Token integer ID:user_and_wei— List of{address, amount_wei_string}tuples:existing_token_and_wei— List of{token_id_integer, amount_wei_string}tuples:blacklist_users— Optional list of{address, bool}tuples(`true` = blacklist, `false` = remove from blacklist)
opts: Optional keyword list (:private_key)