Authentication
Configure MMT, BULK, Hyperliquid, and HyperLink credentials for private data and live execution.
Public market data does not require authentication. Add credentials only when you need MMT data, private account state, or live execution.
Commands
mlab auth status
mlab auth set <provider>
mlab auth remove <provider>| Provider | Command | Required for |
|---|---|---|
| MMT | mlab auth set mmt | MMT market data |
| BULK | mlab auth set bulk | BULK account data and execution |
| Hyperliquid | mlab auth set hyperliquid | Hyperliquid account data and execution |
| HyperLink | mlab auth set hyperlink | HyperLink mainnet Spot and perpetual execution |
MMT
Get an API key from mmt.gg, then store it:
mlab auth set mmt
mlab auth statusFor CI or an ephemeral environment, use an environment variable instead:
MMT_API_KEY=<key> mlab health --provider mmtRemove the stored key:
mlab auth remove mmtMMT provides market data only. It is not an execution venue.
BULK
Authorize a BULK mainnet trading agent:
mlab auth set bulkMarket Lab generates the agent locally and asks for the main wallet private key through a hidden prompt. The main key approves the agent and is not stored.
If registration is interrupted, run the same command again. Market Lab reuses the pending agent:
mlab auth set bulkAuthorize the same local agent on public testnet separately:
mlab auth set bulk --testnetUse --reauthorize with the network you need to replace:
mlab auth set bulk --reauthorize
mlab auth set bulk --testnet --reauthorizeRevoke the agent and remove its local credential:
mlab auth remove bulkBULK uses mainnet by default. Authentication uses bulk, while market data and execution use bulkf:
mlab trade long BTC --venue bulkf --margin 100 --leverage 5 --dry-runAdd --testnet to use the public testnet. Mainnet and testnet account state are independent.
Hyperliquid
Authorize Hyperliquid:
mlab auth set hyperliquidOne hidden prompt approves separate mainnet and testnet API agents for the same master account. The master private key is not stored.
The credential is shared by Hyperliquid Spot, core perpetuals, HIP-3 DEXs, and outcome markets. Mainnet is the default. Add --testnet when needed.
Replace both agents:
mlab auth set hyperliquid --reauthorizeRemove the credential:
mlab auth remove hyperliquidHyperLink
HyperLink is a separate mainnet execution provider for Hyperliquid Spot, core perpetuals, and HIP-3 perpetuals. It requires its own API-wallet approval:
mlab auth set hyperlinkThe main wallet private key is used only to approve the HyperLink agent and is not stored.
Replace the agent:
mlab auth set hyperlink --reauthorizeRemove it:
mlab auth remove hyperlinkThe same credential is used by hyperlink for Spot and hyperlinkf for core or HIP-3 perpetuals. HyperLink has no public testnet, so neither venue accepts --testnet. Live trading access may require approval from HyperLink. See the HyperLink API documentation.
Named Subaccounts
Configure the main account first, then create a named execution subaccount:
mlab auth set hyperliquid --subaccount trading-2
mlab auth set bulk --subaccount trading-2
mlab auth set bulk --subaccount trading-2 --testnetHyperliquid creates the same name on mainnet and testnet. BULK creates the name only on the selected network. The main wallet key is requested only to create the subaccount and is not stored.
main remains the default account. Named subaccounts are currently available for BULK and Hyperliquid execution only through Python Scripting V2. HyperLink does not support Market Lab named subaccounts. CLI trades, bots, strategies, and JavaScript Scripting V1 continue using the main account.
Credential Files
Credentials are stored under:
~/.market-lab/credentials/The directory is owner-only (0700) and credential files are owner-only (0600). Market Lab rejects symlinked, foreign-owned, or broadly readable credential files.
Delegated agent keys are stored unencrypted so mlabd can restart unattended on a VPS. Root and processes running as the same operating-system user can read them. Protect the machine and revoke agents if it is compromised.
Never put an API key or private key in marketlab.toml, a script, or a command-line argument.
SSH Targets
Credentials belong to the installation handling the command. Configure an SSH target through an interactive session:
ssh -t user@SERVER_IP mlab auth set hyperliquidMarket Lab does not copy credentials between machines. See SSH Transport.