Integration
How to connect a client to MetaFlux. Pick the path that matches your starting point.
Starting points
| If you're starting from… | Go to |
|---|---|
| Nothing — just want to try it | Quickstart |
| A working key, now placing real orders | Placing orders |
| An existing HL bot / tool | Migrating from HL |
| Greenfield TypeScript / browser | TypeScript SDK |
| Greenfield Rust service | Rust SDK |
| Anything else (Python, Go, …) | Typed-data signing — implement the EIP-712 typed-data signature yourself |
Topics
- Quickstart — 5-minute end-to-end (deposit → trade → withdraw)
- Placing orders — the canonical order guide: one order, batches, spot, cancels, and which order actions to skip
- Typed-data signing — the EIP-712 signing scheme, end-to-end with working examples
- Signing walkthrough — pointer to typed-data signing (kept for older links)
- Agent wallets howto — concrete code for the hot-key pattern
- Idempotency — nonce strategy + safe retry
- Error handling — admission vs commit vs network decision tree
- Risk-watcher pattern — automated margin top-up
- Market-maker performance — async confirm + batch quotes + cloid for a finality-decoupled quote loop
- Optimizing latency — measure the block cadence, pick the write transport, and learn where an order sits inside a block
- Migrating from HL — switch a Hyperliquid bot to the MTF-native API
SDKs
| Language | Status | Package |
|---|---|---|
| TypeScript / JavaScript | preview | @metaflux-dex/client |
| Rust | preview | metaflux-client |
For other languages (Python, Go, Java, C++ …), implement the EIP-712 typed-data signature per typed-data signing — every step is documented with worked examples. The wire is small enough that a hand-rolled client is the right call for niche stacks.
Network endpoints
See networks for the full per-network reference.
The gateway (https://api.<net>.mtf.exchange) is the single public front door.
| Path | Serves | Purpose |
|---|---|---|
POST /info · POST /exchange · GET /ws | MTF-native | Native snake_case surface |
POST /evm | EVM JSON-RPC | EVM sidechain RPC |
POST /faucet | Faucet | testnet test tap |
Production deployments terminate TLS at the gateway and front it with a CDN; the
node is intentionally not internet-facing — it sits behind the gateway. Running
the node yourself, the same native surface is served directly at
http://localhost:8080 (raw EVM RPC at http://localhost:8545).
Common patterns
- Maker bot — agent-signed, persistent quoting, risk-watcher sidecar, ALO orders for guaranteed-maker tier
- Liquidation watcher — WS subscriber on
notifications(yellow_card) +account_state; fires top-ups before T1 - TWAP wrapper — submits
twap_order, watchesuser_twap_slice_fills+user_twap_historyfor slice telemetry, optional manual cancel mid-run - Vault manager —
VaultDeployonce, then agent-signed Orders for the vault address as you re-balance - Institutional custody — multi-sig master + per-host agents + multi-sig wrapping for high-value flows