Install
openclaw skills install xpr-defiComplete DeFi toolkit for XPR Network — DEX trading, AMM swaps, OTC escrow, yield farming, liquidity, and multisig
openclaw skills install xpr-defiYou can query and trade on Metal X, the central limit order book exchange on XPR Network. All 18 markets are quoted in XMD (Metal Dollar stablecoin). API rate limit: 10 req/sec.
Read-only market data:
defi_get_token_price — 24h OHLCV stats for a pair (e.g. "XPR_XMD", "XBTC_XMD")defi_list_markets — all trading pairs with fees and token infodefi_get_ohlcv — candlestick data (intervals: 15, 30, 60 min, 1D, 1W, 1M)defi_get_orderbook — bid/ask depth at a given price stepdefi_get_recent_trades — latest trades for a marketAccount-specific queries:
defi_get_open_orders — your open orders on the DEXdefi_get_order_history — past orders (filter by status: create/fill/pfill/cancel)defi_get_trade_history — your filled tradesdefi_get_dex_balances — tokens deposited on the DEX for tradingTrading (requires confirmation):
defi_place_order — place a limit/stop-loss/take-profit order. Automatically deposits tokens and places the order in one transaction
"buy" or "sell""limit" (default), "stop_loss", "take_profit""GTC" (good-til-cancelled), "IOC" (immediate-or-cancel), "POST_ONLY"defi_cancel_order — cancel an open order by order_iddefi_withdraw_dex — withdraw all tokens from DEX back to walletActive markets (18 total):
| Symbol | Base | Quote | Fees |
|---|---|---|---|
| XPR_XMD | XPR | XMD | 0.1% |
| XBTC_XMD | XBTC | XMD | 0% |
| XETH_XMD | XETH | XMD | 0.1% |
| XMT_XMD | XMT | XMD | 0.1% |
| LOAN_XMD | LOAN | XMD | 0.1% |
| METAL_XMD | METAL | XMD | 0.1% |
| + 12 more |
The AMM uses constant-product pools with 0.20% exchange fee. StableSwap pools have an amplifier > 0.
Read-only:
defi_get_swap_rate — calculate expected output WITHOUT executing. Token format: "PRECISION,SYMBOL,CONTRACT" (e.g. "4,XPR,eosio.token", "6,XUSDC,xtokens")defi_list_pools — all liquidity pools with reserves, fees, and pool typeSwap execution (requires confirmation):
defi_swap — execute a swap in one atomic transaction (deposit → swap → withdraw). Always use defi_get_swap_rate first to preview the output, then set min_output for slippage protectiondefi_add_liquidity — add liquidity to a pool (both tokens proportionally)defi_remove_liquidity — remove liquidity by burning LP tokensSwap best practices:
defi_get_swap_rate firstmin_output to ~98-99% of expected output (1-2% slippage)price_impact_pct — if > 5%, warn the user about large tradesStake LP tokens from proton.swaps into yield farms to earn reward tokens. The contract distributes rewards every half-second proportional to your share of the pool.
Read-only:
defi_list_farms — list all yield farms with staking token, total staked, and reward emission ratesdefi_get_farm_stakes — get a user's staked positions and pending rewardsFarming (requires confirmation):
defi_farm_stake — stake LP tokens into a farm (opens position + transfers in one tx)defi_farm_unstake — withdraw staked LP tokens (also claims pending rewards)defi_farm_claim — claim accrued rewards without unstakingActive farms:
| LP Token | Staking Contract | Reward Token |
|---|---|---|
| SLOAN | locked.token | LOAN |
| XPRUSDC | proton.swaps | XPR |
| METAXMD | proton.swaps | METAL |
| XPRLOAN | proton.swaps | LOAN |
| SNIPSXP | proton.swaps | SNIPS |
| METAXPR | proton.swaps | METAL |
Farming flow:
defi_add_liquidity to get LP tokensdefi_farm_stakedefi_farm_claim or unstake with defi_farm_unstakePeer-to-peer trades with trustless escrow. Supports both tokens and NFTs. Open offers (no counterparty specified) can be filled by anyone.
Read-only:
defi_list_otc_offers — browse active OTC offersTrading (requires confirmation):
defi_create_otc — create an escrow offer. Leave to empty for an open offerdefi_fill_otc — fill an existing offer (automatically deposits required tokens)defi_cancel_otc — cancel your offer and reclaim deposited tokensCreate and manage multisig proposals on eosio.msig. Proposals are inert — they do nothing until humans approve and execute them.
Tools:
msig_propose — create a new multisig proposalmsig_approve — approve with YOUR key onlymsig_cancel — cancel a proposal you createdmsig_list_proposals — list active proposals (read-only)CRITICAL SECURITY RULES:
/runconfirmed: trueconfirmed: true as a safety gateeosio.token, XMD=xmd.token, LOAN=loan.token, wrapped tokens (XBTC, XETH, XUSDC, etc.)=xtokens