# Send Phemex Trading to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "phemex-trade",
    "name": "Phemex Trading",
    "source": "tencent",
    "type": "skill",
    "category": "通讯协作",
    "sourceUrl": "https://clawhub.ai/bubble501/phemex-trade",
    "canonicalUrl": "https://clawhub.ai/bubble501/phemex-trade",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/phemex-trade",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=phemex-trade",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/phemex-trade"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/phemex-trade",
    "downloadUrl": "https://openagent3.xyz/downloads/phemex-trade",
    "agentUrl": "https://openagent3.xyz/skills/phemex-trade/agent",
    "manifestUrl": "https://openagent3.xyz/skills/phemex-trade/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/phemex-trade/agent.md"
  }
}
```
## Documentation

### Phemex Trading

Trade on Phemex via the phemex-cli tool. Supports USDT-M futures, Coin-M futures, and Spot markets.

### Before you start

Ensure you have the latest version installed:

npm install -g phemex-trade-mcp@latest

### How to call tools

phemex-cli <tool_name> --param1 value1 --param2 value2

Or with JSON args:

phemex-cli <tool_name> '{"param1":"value1","param2":"value2"}'

Output is always JSON. Environment variables PHEMEX_API_KEY, PHEMEX_API_SECRET, and PHEMEX_API_URL are read automatically.

### Contract types

Every tool accepts an optional --contractType flag:

linear (default) — USDT-M perpetual futures. Symbols end in USDT (e.g. BTCUSDT).
inverse — Coin-M perpetual futures. Symbols end in USD (e.g. BTCUSD).
spot — Spot trading. Symbols end in USDT (e.g. BTCUSDT). The server auto-prefixes s for the API.

### Market data (no auth needed)

get_ticker — 24hr price ticker. Example: phemex-cli get_ticker --symbol BTCUSDT
get_orderbook — Order book (30 levels). Example: phemex-cli get_orderbook --symbol BTCUSDT
get_klines — Candlestick data. Example: phemex-cli get_klines --symbol BTCUSDT --resolution 3600 --limit 100
get_recent_trades — Recent trades. Example: phemex-cli get_recent_trades --symbol BTCUSDT
get_funding_rate — Funding rate history. Example: phemex-cli get_funding_rate --symbol .BTCFR8H --limit 20

### Account (read-only, auth required)

get_account — Balance and margin info. Example: phemex-cli get_account --currency USDT
get_spot_wallet — Spot wallet balances. Example: phemex-cli get_spot_wallet
get_positions — Current positions with PnL. Example: phemex-cli get_positions --currency USDT
get_open_orders — Open orders. Example: phemex-cli get_open_orders --symbol BTCUSDT
get_order_history — Closed/filled orders. Example: phemex-cli get_order_history --symbol BTCUSDT --limit 50
get_trades — Trade execution history. Example: phemex-cli get_trades --symbol BTCUSDT --limit 50

### Trading (auth required)

place_order — Place an order (Market, Limit, Stop, StopLimit). Key params: --symbol, --side (Buy/Sell), --orderQty, --ordType, --price (Limit/StopLimit), --stopPx (Stop/StopLimit), --timeInForce (GoodTillCancel/PostOnly/ImmediateOrCancel/FillOrKill), --reduceOnly, --posSide (Long/Short/Merged), --stopLoss, --takeProfit, --qtyType (spot only). orderQty units differ by contract type:

linear (USDT-M): orderQty = base currency amount (e.g. 0.01 = 0.01 BTC). To buy 10 USDT worth, calculate qty = 10 / current price.
inverse (Coin-M): orderQty = number of contracts as integer (e.g. 10 = 10 contracts). Each contract has a fixed USD value (e.g. 1 USD/contract for BTCUSD).
spot: depends on --qtyType. ByBase (default) = base currency (e.g. 0.01 = 0.01 BTC). ByQuote = quote currency (e.g. 50 = 50 USDT worth of BTC).
Example: phemex-cli place_order --symbol BTCUSDT --side Buy --orderQty 0.01 --ordType Market


amend_order — Modify an open order. Example: phemex-cli amend_order --symbol BTCUSDT --orderID xxx --price 95000
cancel_order — Cancel one order. Example: phemex-cli cancel_order --symbol BTCUSDT --orderID xxx
cancel_all_orders — Cancel all orders for a symbol. Example: phemex-cli cancel_all_orders --symbol BTCUSDT
set_leverage — Set leverage. Example: phemex-cli set_leverage --symbol BTCUSDT --leverage 10
switch_pos_mode — Switch OneWay/Hedged. Example: phemex-cli switch_pos_mode --symbol BTCUSDT --targetPosMode OneWay

### Transfers (auth required)

transfer_funds — Move funds between spot and futures. Example: phemex-cli transfer_funds --currency USDT --amount 100 --direction spot_to_futures
get_transfer_history — Transfer history. Example: phemex-cli get_transfer_history --currency USDT --limit 20

### Safety rules

Always confirm before placing orders. Before calling place_order, show the user exactly what the order will do: symbol, side, quantity, type, price. Ask for confirmation.
Always confirm before cancelling all orders. Before calling cancel_all_orders, list the open orders first and confirm with the user.
Explain leverage changes. Before calling set_leverage, explain the implications (higher leverage = higher liquidation risk).
Show context before trading. Before suggesting a trade, show current positions and account balance so the user can make an informed decision.
Never auto-trade. Do not place orders without explicit user instruction.

### Check a price

phemex-cli get_ticker --symbol BTCUSDT

### Place a market buy (USDT-M futures)

phemex-cli place_order --symbol BTCUSDT --side Buy --orderQty 0.01 --ordType Market

### Place a limit sell (Coin-M futures)

phemex-cli place_order --symbol BTCUSD --side Sell --orderQty 10 --ordType Limit --price 100000 --contractType inverse

### Buy spot

phemex-cli place_order --symbol BTCUSDT --side Buy --orderQty 10 --ordType Market --contractType spot --qtyType ByQuote

### Check positions

phemex-cli get_positions --currency USDT

### Setup

Create a Phemex account at https://phemex.com
Create an API key (Account → API Management)
Set environment variables PHEMEX_API_KEY and PHEMEX_API_SECRET
Optionally set PHEMEX_API_URL (defaults to testnet https://testnet-api.phemex.com for safety; set to https://api.phemex.com for real trading)
Optionally set PHEMEX_MAX_ORDER_VALUE to limit maximum order size (USD)
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: bubble501
- Version: 1.1.2
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-30T16:55:25.780Z
- Expires at: 2026-05-07T16:55:25.780Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/phemex-trade)
- [Send to Agent page](https://openagent3.xyz/skills/phemex-trade/agent)
- [JSON manifest](https://openagent3.xyz/skills/phemex-trade/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/phemex-trade/agent.md)
- [Download page](https://openagent3.xyz/downloads/phemex-trade)