Peer Cash
Use Peer Cash when the user wants to cash out Base USDC to fiat, compare live payout rails, estimate fiat received, track a cash-out, withdraw unmatched funds, or top up an open order.
Peer Cash is custody-separated. Its MCP server prepares transactions and reads protocol state, but it never accepts a private key, signs, or broadcasts. The OpenClaw host or connected wallet owns approval, signing, submission, and receipt confirmation.
One-time setup
Check whether the server is already configured:
openclaw mcp show peer-cash --json
If it is missing, add the published stdio server and prove that it starts:
openclaw mcp add peer-cash --command npx --arg -y --arg peer-cash-mcp
openclaw mcp doctor peer-cash --probe
Do not overwrite an existing peer-cash definition without showing the current configuration and getting operator approval. Optional environment variables belong on the OpenClaw gateway host. Never place secrets in a prompt, tracked config, or command argument.
The MCP tool names may be namespaced by the runtime. Match them by the exact suffixes documented below.
Required operating rules
- Call
peer_cash_capabilitiesbefore naming a payout platform, currency, amount bound, or source asset. - Treat
peer_cash_estimateas approximate. The binding Chainlink rate resolves when a buyer fills; never call it a locked quote. - Amounts are decimal base-unit strings. Base USDC has 6 decimals, so 100 USDC is
100000000. - Never request or handle a private key or seed phrase.
- Before any host signs or submits a transaction, show the destination, value, calldata purpose, ordered steps, and expected effect. Get explicit user approval for that exact plan.
- Submit prepared transactions in the returned order. Confirm each required receipt before continuing.
- Persist the returned
depositId. It is the durable resume key for order tracking and recovery. - Do not blindly retry an unknown transaction outcome. Inspect the named hash, wallet activity, and existing orders first.
Cash-out flow
- Call
peer_cash_capabilities. - Call
peer_cash_estimatewith the requested Base USDC amount and currency. Explain that the result is an oracle estimate, not a guaranteed payout. - Collect only the payee fields required by the chosen platform.
- Call
peer_cash_preparewith the amount and one or more receive legs. - Present the returned unsigned transactions and
stepsfor approval. - After approval, have the configured host wallet submit each transaction in order on Base.
- Confirm the
createDepositreceipt, then callpeer_cash_finalizewith that transaction hash. - If the prepare result set
accessPolicyRequiredtotrue, callpeer_cash_prepare_access_policy, obtain approval, and submit that policy transaction with the depositor wallet. - Return and persist the
depositId. Usepeer_cash_orderfor current state and next actions.
Order management
peer_cash_order: read one order from itsdepositId.peer_cash_orders: list a maker wallet's orders. SetinFlighttotruefor orders still needing attention.peer_cash_prepare_withdraw: prepare a full close whenamountis omitted, or a partial unmatched-funds withdrawal when it is present.peer_cash_prepare_top_up: prepare approval andaddFundstransactions for a live order.
Withdrawal and top-up plans follow the same approval and ordered-submission rules as a new cash-out.
Recovery
Peer Cash errors may include code, retryable, remediation, and recovery. Follow those fields instead of improvising retries.
ORDER_NOT_FOUNDimmediately after finalization can be indexer lag. Retry only the read. The confirmed receipt remains the source of truth.TRANSACTION_SUBMISSION_UNKNOWN: inspect wallet activity and existing orders before any resubmission.TRANSACTION_STATUS_UNKNOWN: inspect the named transaction hash first.ACCESS_POLICY_CONFIGURATION_FAILED: the deposit already exists. Repair the policy step; do not create another cash-out.INDEXER_UNAVAILABLEorORACLE_READ_FAILED: retry the read only.
If the evidence cannot prove whether a mutation happened, stop and ask the user to inspect the wallet or block explorer. Do not manufacture certainty.
