Reference
Chain IDs
| Chain | ID |
|---|---|
| Monero | 0 |
| Ethereum | 1 |
| BSC | 56 |
| Base | 8453 |
| Arbitrum | 42161 |
| Solana | 1151111081099710 |
| Bitcoin | 20000000000001 |
Token Decimals
| Token | Decimals | Example |
|---|---|---|
| XMR | 12 | 1 XMR = 1000000000000 |
| USDC | 6 | 1 USDC = 1000000 |
| ETH | 18 | 1 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
| Operation | Method |
|---|---|
| Spot balances | info.spot_user_state(addr) |
| Open orders | info.open_orders(addr) |
| Recent fills | info.spot_user_fills(addr) |
| Order book | info.l2_snapshot("XMR1/USDC") |
| Spot metadata | info.spot_meta_and_asset_ctxs() |
| Place order | exchange.order(pair, is_buy, sz, px, type, reduce) |
| Cancel order | exchange.cancel(pair, oid) |
| Bulk place | exchange.bulk_orders([...]) |
| Bulk modify | exchange.bulk_modify_orders_new([...]) |