@myriadmarkets/cli
v0.1.4
Published
Myriad CLI - Let agents trade prediction markets on Myriad Markets
Readme
Myriad CLI
Build AI trading agents on Myriad prediction markets in minutes.
Myriad CLI gives one interface for the full loop: discover markets, make decisions, execute trades, and claim winnings, with MCP support out of the box.
What You Can Build
- Discover live opportunities across open markets using sorting and keyword search.
- Decide with fast market inspection and portfolio context.
- Execute buys and sells.
- Claim winnings.
- Automate the full workflow through MCP tool orchestration.
Start in seconds
Install (requires Node.js and npm):
npm i -g @myriadmarkets/cliIf myriad is not found immediately after install, open a new terminal session.
Set up a signer wallet (create or import from private key or seedphrase, interactive only):
myriad wallet setupFund your wallet for trading:
myriad wallet depositFind markets:
myriad markets list --state open --order volume --sort desc --limit 5 --jsonBuy a position:
myriad trade buy --market-id 164 --outcome-id 0 --value 25 --jsonUse the --dry-run flag to preview trades without executing them.
Run as MCP server:
myriad mcpUse cases
1) Event-Driven Trader Agent
Your agent spots a news catalyst, scans markets, and stages a trade.
myriad markets list --state open --keyword election --limit 10 --json
myriad trade buy --market-id 164 --outcome-id 0 --value 25 --dry-run --jsonGo deeper:
2) Portfolio Monitor Agent
Your agent checks exposure, cash, and gas before every trading cycle.
myriad wallet balances --json
myriad wallet deposit --json
myriad portfolio --limit 20 --jsonGo deeper:
3) Winnings sweeper agent
Your agent regularly sweeps resolved positions and claims winnings.
myriad claim all --dry-run --json
myriad claim all --jsonGo deeper:
4) Multi-Agent Trading Desk (MCP)
One scout agent reads markets, another agent trades.
myriad mcpGo deeper:
MCP in One Minute
MCP client config:
{
"mcpServers": {
"myriad": {
"command": "myriad",
"args": ["mcp"]
}
}
}Safe rule for every agent:
- Use read tools first (
markets_*,portfolio,wallet_balances). - Use
dryRun: truefirst for write tools (trade_*,swap_stable,claim_*). - Execute without
dryRunonly after validation.
Command Map
Core command groups: markets -> trade -> claim -> wallet -> swap -> skills -> mcp
Skills
| Skill | Owns | | --- | --- | | myriad-market-discovery | Market scanning, filtering, and candidate selection | | myriad-trade-execution | Buy/sell execution patterns, slippage and allowance strategy | | myriad-claims | Winnings, voided claims, and claim-all workflows | | myriad-wallet-ops | Wallet onboarding, signer resolution, keychain issues | | myriad-mcp-orchestration | MCP sequencing, safety rules, and per-call override behavior |
Agent Platform Setup
Claude Code
Install skills into your project:
myriad skills install --target claudeThis copies skills to .claude/skills/ in the current directory. You can then invoke them with /myriad-market-discovery, /myriad-trade-execution, etc.
To use Myriad as an MCP server, add to your Claude Code MCP config:
{
"mcpServers": {
"myriad": {
"command": "myriad",
"args": ["mcp"]
}
}
}OpenClaw
Install skills globally:
myriad skills install --target openclawThis copies skills to ~/.openclaw/skills/ where OpenClaw auto-discovers them. Each skill requires the myriad binary on PATH.
Install Both
myriad skills installUse --force to overwrite existing skill files.
Defaults and Risk (Read Once)
- Plain ASCII tables are the default output mode.
- Pass
--jsonto output JSON instead. - In
markets list --plain, output columns are:Title,Most likely outcome (with price),Volume,Expires At,State,Market ID. - In
markets show --plain, output columns are:Title,Outcome (Price),Outcome (Price),Volume,Expires At,Market ID. - In
markets list --plain, outcome prices and volumes are USD currency-formatted;Expires Atis date-only,HITfor>= 2100-01-01, andPerpetualwhen perpetual is true. - In
portfolio --plain, rows are filtered to unclaimedopen/voided/wonpositions and shown asMarket,Outcome,Shares,Price,Current Value,Current ROI,Status,Market ID,Outcome ID. - In
wallet deposit --plain, output is instruction text lines (not an ASCII table). - If both
--jsonand--plainare passed,--jsontakes precedence. - Default chain is BNB Chain (
chainId=56). - Default API base URL is
https://api-v2.myriadprotocol.com/. - Default slippage: trades
0.05, stable swaps0.005. - On BNB Chain, buy flow can auto-swap
USDT/USD1if required spend token balance is insufficient. - Light risk note: prediction market execution is probabilistic and market conditions can change quickly; use dry-runs before writing transactions.
Configuration Layers
Myriad CLI resolves config values in this order:
- CLI flags (for example
--rpc-url,--chain-id,--allowance). - Environment variables (
MYRIAD_*) and.envin the current working directory. - Global machine config file:
$XDG_CONFIG_HOME/myriad/config.jsonwhenXDG_CONFIG_HOMEis set.- Otherwise
~/.config/myriad/config.json.
- Built-in network defaults.
Supported global config keys:
apiBaseUrl, apiKey, allowance, chainId, rpcUrl, predictionMarketAddress, predictionMarketQuerierAddress, collateralTokenAddress, usdtTokenAddress, usd1TokenAddress, pancakeRouterV2Address.
Example global config:
{
"chainId": 56,
"rpcUrl": "https://bsc-dataseed.binance.org/",
"apiBaseUrl": "https://api-v2.myriadprotocol.com/",
"apiKey": "optional-api-key",
"allowance": "UNLIMITED"
}Security note:
- Do not place private keys in global config.
- Use
myriad wallet setup(encrypted wallet file + OS keychain),MYRIAD_PRIVATE_KEY, or--private-key.
