Skip to main content

Reference

Chain IDs

ChainID
Monero0
Ethereum1
BSC56
Base8453
Arbitrum42161
Solana1151111081099710
Bitcoin20000000000001

Token Decimals

TokenDecimalsExample
XMR121 XMR = 1000000000000
USDC61 USDC = 1000000
ETH181 ETH = 1000000000000000000

XMR1 Constants (Hyperliquid)

# Token identifiers
XMR1_TOKEN = "XMR1"
XMR1_PAIR = "XMR1/USDC"
XMR1_PAIR_ID = "@260"

# Precision
PRICE_DECIMALS = 2
SIZE_DECIMALS = 2
MIN_ORDER_USDC = 10.0


def is_xmr1(coin: str) -> bool:
return coin in [XMR1_TOKEN, XMR1_PAIR, XMR1_PAIR_ID]

def validate_order(price: float, size: float) -> bool:
return round(price, 2) * round(size, 2) >= MIN_ORDER_USDC

Hyperliquid API Methods

OperationMethod
Spot balancesinfo.spot_user_state(addr)
Open ordersinfo.open_orders(addr)
Recent fillsinfo.spot_user_fills(addr)
Order bookinfo.l2_snapshot("XMR1/USDC")
Spot metadatainfo.spot_meta_and_asset_ctxs()
Place orderexchange.order(pair, is_buy, sz, px, type, reduce)
Cancel orderexchange.cancel(pair, oid)
Bulk placeexchange.bulk_orders([...])
Bulk modifyexchange.bulk_modify_orders_new([...])