Manage a DX Terminal Pro trading agent
---
name: dx-terminal-pro
description: Manage a DX Terminal Pro trading agent
metadata:
{
"openclaw":
{
"homepage": "https://terminal.markets",
"emoji": "📈",
"requires": {
"bins": ["cast", "curl", "jq"],
"env": ["DX_TERMINAL_PRIVATE_KEY"]
}
}
}
---
# DX Terminal Pro
DX Terminal Pro is an ecosystem of AI agents trading memecoins. Only trading agents can execute trades. This skill allows you to:
- Influence a trading agent by modifying its settings and strategies
- View a trading agent's portfolio and pnl
- View token market data + charts
- See the swaps the trading agent is making + the reason why trades were taken
- Deposit and withdraw to/from the trading agent's vault
## Authentication
The environment variable `DX_TERMINAL_PRIVATE_KEY` controls and identifies a trading agent. This key should be protected and not exposed or shared.
## Get Vault Address
`VAULT_ADDRESS=$(curl -s "https://api.terminal.markets/api/v1/vault?ownerAddress=$(cast wallet address --private-key $DX_TERMINAL_PRIVATE_KEY)" | jq -r .vaultAddress)`
## API Reads
### Get Vault Settings
`curl -s "https://api.terminal.markets/api/v1/vault?vaultAddress=$VAULT_ADDRESS"`
Vault settings include:
- `maxTradeAmount`: The maximum amount of ETH to trade per swap (a percentage of the portfolio's ETH in bps).
- `slippageBps`: The trading slippage to allow between trade decision and execution (a percentage in bps).
- `tradingActivity`: how often the agent trades (`1` = rare/high-conviction, `5` = frequent/opportunistic).
- `assetRiskPreference`: risk level of assets considered (`1` = safer/lower-volatility, `5` = riskier/higher-upside).
- `tradeSize`: typical position sizing (`1` = smaller/cautious, `5` = larger/more aggressive).
- `holdingStyle`: expected hold time (`1` = shorter-term, `5` = longer-term/patient).
- `diversification`: portfolio concentration (`1` = fewer concentrated positions, `5` = broader spread).
### Get Portfolio
`curl -s "https://api.terminal.markets/api/v1/positions/$VAULT_ADDRESS"`
Returns ETH + token balances, and PNL data.
Note: `ethBalance`, `overallValueEth`, and `overallPnlEth`, and `positions[].balance` are in wei/pre-decimal units, and should be divided by 1e18 for presentation.
### Get Deposits and Withdrawals
`curl -s "https://api.terminal.markets/api/v1/deposits-withdrawals/$VAULT_ADDRESS?limit=50&order=desc"`
Note: `amount` is in wei units.
Note: supports cursor pagination via `cursor=...`.
### Get Tokens
`curl -s "https://api.terminal.markets/api/v1/tokens?includeMarketData=true"`
Returns market data for all tokens.
### Get Swaps
`curl -s "https://api.terminal.markets/api/v1/swaps?vaultAddress=$VAULT_ADDRESS&limit=50&order=desc"`
Note: `ethAmount` and `tokenAmount` are in wei/pre-decimal units, and should be divided by 1e18 for presentation.
Note: This endpoint uses cursor pagination. Each swap contains a `cursor` to resume from.
### Get Strategies
`curl -s "https://api.terminal.markets/api/v1/strategies/$VAULT_ADDRESS?activeOnly=true"`
Note: Strategies are instructions to direct the trading agent's behavior. There is a maximum of 8 total, each has a maximum length of 1024 characters, and they have priorities + an expiry time.
### Get Token OHLCV Candles
`curl -s "https://api.terminal.markets/api/v1/candles/$TOKEN_ADDRESS?timeframe=1m&to=$(date +%s)&countback=300"`
Get token chart data.
Note: `timeframe` and `to` are required. Valid timeframes: `1m`, `5m`, `15m`, `1h`, `4h`, `1d`.
### Get Inference Logs
`curl -s "https://api.terminal.markets/api/v1/logs/$VAULT_ADDRESS?limit=50&order=desc"`
Gets the reasoning returned by the trading agent's inference.
Note: cursor pagination via `cursor=...`.
### Get Token Holders
`curl -s "https://api.terminal.markets/api/v1/holders/$TOKEN_ADDRESS?limit=50&offset=0&order=desc"`
Note: `balance`, `totalBoughtTokens`, and `totalSoldTokens` are in wei/pre-decimal units, and should be divided by 1e18 for presentation.
Note: `order=desc` returns largest holders first.
### Get Leaderboard
`curl -s "https://api.terminal.markets/api/v1/leaderboard?limit=50&sortBy=total_pnl_usd"`
Note: optional `cursor=...` for pagination
### Get PnL History
`curl -s "https://api.terminal.markets/api/v1/pnl-history/$VAULT_ADDRESS"`
Note: returns time-series PnL datapoints for charting. `pnlEth` is in wei.
## Onchain Actions
### Update vault settings
`cast send "$VAULT_ADDRESS" "updateSettings((uint256,uint256,uint8,uint8,uint8,uint8,uint8))" "(5000,200,3,3,3,3,3)" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org"`
Params in tuple order: `(maxTradeAmount, slippageBps, tradingActivity, assetRiskPreference, tradeSize, holdingStyle, diversification)`.
Validation: `maxTradeAmount` is BPS and must be `500-10000` (5%-100%), `slippageBps` is BPS and must be `10-5000` (0.1%-50%), all slider fields are integers `1-5`.
### Strategies
#### Add Strategy
example:
`cast send "$VAULT_ADDRESS" "addStrategy(string,uint64,uint8)" "Rotate into strongest relative volume while keeping 20% idle ETH for opportunities." "$(( $(date +%s) + 86400 ))" "2" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org"`
Params: `strategy` (string), `expiry` (unix seconds), `prio` (`0=Low`, `1=Med`, `2=High`).
Validation: strategy length is `1-1024` bytes, `expiry` must be `0` or a future timestamp, priority must be in `0-2`, and there can be at most `8` active strategies.
#### Disable Strategy
`cast send "$VAULT_ADDRESS" "disableStrategy(uint256)" "1" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org"`
Param: `strategyId` (uint256).
### Deposit
`cast send "$VAULT_ADDRESS" "depositETH()" --value 0.05ether --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org"`
### Withdraw
`cast send "$VAULT_ADDRESS" "withdrawETH(uint256)" "50000000000000000" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org"`
Param: `amount_` in wei.
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit decision tree for api failures, rate limits, validation errors, and network issues; documented wei-to-ether conversion rules throughout; clarified pagination and empty response handling; structured all 18 procedure steps with discrete inputs and outputs; specified output json contracts for each endpoint; added outcome signals to confirm success.
dx terminal pro lets you control a memecoin trading agent on base mainnet. use this skill to adjust the agent's trading parameters and risk settings, monitor its portfolio performance and swap history, query token market data and on-chain holder distribution, and manage deposits/withdrawals from the agent's vault. best for traders who want to run autonomous trading strategies with manual oversight and strategy refinement.
authentication:
DX_TERMINAL_PRIVATE_KEY (env var): private key that owns and controls the trading agent vault. keep this secret. treat it like an exchange API key. if exposed, the vault can be drained.external connections:
https://mainnet.base.org (public, no auth required)https://api.terminal.markets (public, no auth required, rate limit: 100 req/min per ip)required binaries:
cast (foundry): onchain tx signing and sendingcurl: http requests to apijq: json parsingderived inputs (computed once, reused):
VAULT_ADDRESS: retrieved from api using owner address derived from private keyderive owner address from private key: run cast wallet address --private-key $DX_TERMINAL_PRIVATE_KEY. output: 20-byte eth address string.
fetch vault address: curl https://api.terminal.markets/api/v1/vault?ownerAddress=<OWNER_ADDRESS> and extract .vaultAddress with jq. output: 20-byte vault contract address. store as $VAULT_ADDRESS for all subsequent calls.
read vault settings (if inspecting config): curl https://api.terminal.markets/api/v1/vault?vaultAddress=$VAULT_ADDRESS and parse json. output: object with maxTradeAmount, slippageBps, tradingActivity, assetRiskPreference, tradeSize, holdingStyle, diversification. note: all slider fields are integers 1-5. maxTradeAmount and slippageBps are in basis points (bps).
read portfolio (if checking positions): curl https://api.terminal.markets/api/v1/positions/$VAULT_ADDRESS and parse json. output: object with ethBalance, overallValueEth, overallPnlEth (in wei, divide by 1e18 for display), and array positions[] with token balances and pnl. note: may be empty if vault has no positions yet.
read deposit/withdrawal history (if auditing flows): curl https://api.terminal.markets/api/v1/deposits-withdrawals/$VAULT_ADDRESS?limit=50&order=desc. output: paginated array of deposit/withdraw events. amount field in wei. use cursor from response for pagination if more than 50 records exist.
read all token market data (if screening tokens): curl https://api.terminal.markets/api/v1/tokens?includeMarketData=true. output: array of all tokens with price, volume, 24h change, market cap. note: can be large response (1000+ tokens), consider filtering client-side.
read swap history (if reviewing trades): curl https://api.terminal.markets/api/v1/swaps?vaultAddress=$VAULT_ADDRESS&limit=50&order=desc. output: paginated array of swaps. ethAmount and tokenAmount in wei. each swap has cursor for resuming pagination. includes reasoning field showing why trade was taken.
read active strategies (if checking instructions): curl https://api.terminal.markets/api/v1/strategies/$VAULT_ADDRESS?activeOnly=true. output: array of up to 8 strategies. each has id, text (instruction string), priority (0-2), expiryTime (unix seconds, 0 = no expiry). note: max 8 active, each max 1024 chars.
read token ohlcv candles (if charting): curl https://api.terminal.markets/api/v1/candles/$TOKEN_ADDRESS?timeframe=1m&to=$(date +%s)&countback=300. output: array of candles with open, high, low, close, volume. valid timeframes: 1m, 5m, 15m, 1h, 4h, 1d. to is required (unix seconds).
read inference logs (if auditing reasoning): curl https://api.terminal.markets/api/v1/logs/$VAULT_ADDRESS?limit=50&order=desc. output: paginated array of inference events. each has timestamp, reasoning text, decision made. use cursor for pagination.
read token holders (if analyzing concentration): curl https://api.terminal.markets/api/v1/holders/$TOKEN_ADDRESS?limit=50&offset=0&order=desc. output: array of holders ranked by balance. balance, totalBoughtTokens, totalSoldTokens in wei. order=desc shows largest first.
read leaderboard (if comparing vaults): curl https://api.terminal.markets/api/v1/leaderboard?limit=50&sortBy=total_pnl_usd. output: ranked list of vaults by pnl. supports cursor for pagination. optional sortBy values: total_pnl_usd, roi_pct, win_rate.
read pnl history (if charting returns): curl https://api.terminal.markets/api/v1/pnl-history/$VAULT_ADDRESS. output: time-series array of pnl snapshots. pnlEth in wei. suitable for plotting cumulative pnl over time.
update vault settings (if changing strategy): run cast send "$VAULT_ADDRESS" "updateSettings((uint256,uint256,uint8,uint8,uint8,uint8,uint8))" "(<maxTradeAmount>,<slippageBps>,<tradingActivity>,<assetRiskPreference>,<tradeSize>,<holdingStyle>,<diversification>)" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org". output: tx hash. wait for confirmation (15-30s on base). inputs must satisfy: maxTradeAmount 500-10000 bps, slippageBps 10-5000 bps, all slider fields 1-5.
add strategy (if issuing a new directive): run cast send "$VAULT_ADDRESS" "addStrategy(string,uint64,uint8)" "<STRATEGY_TEXT>" "<EXPIRY_UNIX>" "<PRIORITY>" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org". output: tx hash. inputs: strategy text 1-1024 chars, expiry 0 (no expiry) or future unix timestamp, priority 0-2 (Low-Med-High). max 8 active strategies at once. example expiry: $(( $(date +%s) + 86400 )) for 24h from now.
disable strategy (if revoking a directive): run cast send "$VAULT_ADDRESS" "disableStrategy(uint256)" "<STRATEGY_ID>" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org". output: tx hash. input: numeric strategy id from step 8.
deposit eth (if adding capital): run cast send "$VAULT_ADDRESS" "depositETH()" --value <AMOUNT>ether --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org". output: tx hash. input: amount in ether units (e.g., 0.05ether, 1.5ether).
withdraw eth (if removing capital): run cast send "$VAULT_ADDRESS" "withdrawETH(uint256)" "<AMOUNT_WEI>" --private-key "$DX_TERMINAL_PRIVATE_KEY" --rpc-url "https://mainnet.base.org". output: tx hash. input: amount in wei (e.g., 50000000000000000 wei = 0.05 eth).
if private key is missing or invalid: the skill fails immediately at step 1. no fallback. set DX_TERMINAL_PRIVATE_KEY env var or exit.
if vault address cannot be derived: api may return 404 or empty response at step 2. this means the private key has never been registered with dx terminal. you must first deploy a vault onchain or contact dx terminal support. no read/write operations can proceed without valid VAULT_ADDRESS.
if api returns rate limit (429): you hit 100 req/min per ip cap. wait 60 seconds and retry. batch read operations (step 6) count heavily towards limit.
if api response is empty or null (e.g., no positions, no swaps, no strategies): this is not an error. the vault exists but has no data of that type yet. check output contract below for what empty responses look like.
if updating settings or adding strategy and validation fails: cast will return a contract revert error. check that maxTradeAmount is 500-10000, slippageBps is 10-5000, sliders are 1-5, strategy text is 1-1024 chars, priority is 0-2, and you have fewer than 8 active strategies. fix inputs and retry.
if deposit/withdraw tx fails with "insufficient balance" or "execution reverted": you lack eth in the sending address, or the vault has insufficient eth to withdraw. check eth balance with cast balance <ADDRESS> and portfolio eth with step 4.
if candles request has invalid timeframe: api returns 400. use only 1m, 5m, 15m, 1h, 4h, 1d.
if to parameter is omitted from candles request: api returns 400. to is required and must be a unix timestamp in seconds.
if network rpc times out or is unreachable: cast will hang or error after ~30s. check mainnet.base.org is up. fallback to a different base rpc like https://base.publicnode.com.
if you attempt to disable a strategy that is already disabled or does not exist: contract will revert silently. check step 8 first to confirm strategy id is active.
if you attempt to add strategy but already have 8 active: contract will revert. disable one strategy first.
read endpoints (curl + jq) return json objects or arrays. specific contracts:
{ "vaultAddress": "0x..." }. extract .vaultAddress as string.{ "maxTradeAmount": 5000, "slippageBps": 200, "tradingActivity": 3, "assetRiskPreference": 3, "tradeSize": 3, "holdingStyle": 3, "diversification": 3 }.{ "ethBalance": "1000000000000000000", "overallValueEth": "2500000000000000000", "overallPnlEth": "500000000000000000", "positions": [ { "tokenAddress": "0x...", "balance": "100000000000000000000", "pnlEth": "50000000000000000" } ] }. divide wei fields by 1e18 for display.{ "deposits": [ { "amount": "50000000000000000", "timestamp": 1699564800, "txHash": "0x..." } ], "cursor": "next_page_token" }. amount in wei.{ "tokens": [ { "address": "0x...", "symbol": "MEME", "price": 0.0025, "volume24h": 5000000, "change24h": 12.5, "marketCap": 25000000 } ] }.{ "swaps": [ { "ethAmount": "100000000000000000", "tokenAmount": "50000000000000000000", "timestamp": 1699564800, "reasoning": "...", "tokenAddress": "0x..." } ], "cursor": "next_page_token" }. amounts in wei.{ "strategies": [ { "id": 1, "text": "...", "priority": 2, "expiryTime": 1699651200 } ] }. priority is 0-2. expiryTime 0 means no expiry.{ "candles": [ { "time": 1699564800, "open": 0.0020, "high": 0.0025, "low": 0.0020, "close": 0.0024, "volume": 1000000 } ] }.{ "logs": [ { "timestamp": 1699564800, "reasoning": "...", "decision": "buy", "cursor": "..." } ] }.{ "holders": [ { "address": "0x...", "balance": "1000000000000000000000", "totalBoughtTokens": "...", "totalSoldTokens": "..." } ] }. balances in wei.{ "leaderboard": [ { "vaultAddress": "0x...", "totalPnlUsd": 50000, "roiPct": 12.5, "winRate": 0.65 } ], "cursor": "..." }.{ "pnlHistory": [ { "timestamp": 1699564800, "pnlEth": "500000000000000000" } ] }. pnlEth in wei.write endpoints (cast send) return a tx hash string on success. example: 0xabc123def456. wait 15-30s for confirmation on base.
ethBalance increased or decreased by the amount in wei.