Market LabDocs

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>
ProviderCommandRequired for
MMTmlab auth set mmtMMT market data
BULKmlab auth set bulkBULK account data and execution
Hyperliquidmlab auth set hyperliquidHyperliquid account data and execution
HyperLinkmlab auth set hyperlinkHyperLink mainnet Spot and perpetual execution

MMT

Get an API key from mmt.gg, then store it:

mlab auth set mmt
mlab auth status

For CI or an ephemeral environment, use an environment variable instead:

MMT_API_KEY=<key> mlab health --provider mmt

Remove the stored key:

mlab auth remove mmt

MMT provides market data only. It is not an execution venue.

BULK

Authorize a BULK mainnet trading agent:

mlab auth set bulk

Market 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 bulk

Authorize the same local agent on public testnet separately:

mlab auth set bulk --testnet

Use --reauthorize with the network you need to replace:

mlab auth set bulk --reauthorize
mlab auth set bulk --testnet --reauthorize

Revoke the agent and remove its local credential:

mlab auth remove bulk

BULK 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-run

Add --testnet to use the public testnet. Mainnet and testnet account state are independent.

Hyperliquid

Authorize Hyperliquid:

mlab auth set hyperliquid

One 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 --reauthorize

Remove the credential:

mlab auth remove hyperliquid

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 hyperlink

The main wallet private key is used only to approve the HyperLink agent and is not stored.

Replace the agent:

mlab auth set hyperlink --reauthorize

Remove it:

mlab auth remove hyperlink

The 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 --testnet

Hyperliquid 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 hyperliquid

Market Lab does not copy credentials between machines. See SSH Transport.

On this page