Install
openclaw skills install crypto-treasury-opsClawHub Security found sensitive or high-impact capabilities. Review the scan results before using.
Safely manage EVM treasury operations and native Hyperliquid trading for OpenClaw agents, including wallet balance checks, guarded token transfers, cross-chain USDC bridging, Hyperliquid deposits, destination gas top-ups, trading safety, and structured quoting.
openclaw skills install crypto-treasury-opsUse this skill when an OpenClaw agent needs to inspect or operate a treasury wallet on Ethereum, Polygon, Arbitrum, or Base with explicit safety controls, or use Solana as a read path and bridge source chain.
Execution tools require environment configuration before build or runtime.
Required variables:
TREASURY_PRIVATE_KEY=0x...
SOLANA_TREASURY_PRIVATE_KEY=
ZEROX_API_KEY=...
Recommended workflow:
cp .env.example .env
# fill in the treasury private key and optional RPC overrides
npm install
npm run build
Important:
TREASURY_PRIVATE_KEY is required for EVM execution tools and as the default destination wallet for Solana -> EVM bridgesSOLANA_TREASURY_PRIVATE_KEY is required for executing Solana bridge transactionsSOLANA_TREASURY_ADDRESS can be used for read-only Solana quote context when no Solana signer is presentZEROX_API_KEY is required for swap_token and swap quotesMAYAN_API_KEY is optional but recommended for Solana bridge quote / execution rate limitsHYPERLIQUID_TRADING_* variables can further constrain market allowlists, order notional, leverage, and confirmation thresholdsETHEREUM_RPC_URL and SOLANA_RPC_URL are optional overrides; comma-separated lists are supportedget_balances, get_hyperliquid_market_state, get_hyperliquid_account_state, safety_check, and some quote flows can run without a signer.envquote_operation or dryRun=true immediately before execution so the route and balances are freshInvoke tools through the CLI:
node dist/index.js --action <tool_name> --input '<json>'
get_balancesInputs:
walletAddresschainsolanaAddress optional when chain=solanaReturns:
Notes:
chain=solana is supported for read-only balance queriestransfer_tokenInputs:
chaintokenrecipientamountapproval optionaldryRun optionalBehavior:
swap_tokenInputs:
chainsellTokenbuyTokenamountrecipient optionalslippageBps optionalapproval optionaldryRun optionalBehavior:
ETH or POL; use wrapped tokens such as WETHbridge_tokenInputs:
sourceChaindestinationChaintokenamountapproval optionaldryRun optionalBehavior:
solana -> ethereum/arbitrum/base/polygon through MayanSOL -> native destination gas token and same-symbol stablecoin routes such as USDC -> USDCdeposit_to_hyperliquidInputs:
sourceChaintokenamountdestinationapproval optionaldryRun optionalBehavior:
USDC onlyarbitrum direct deposits and polygon/base -> arbitrum -> hyperliquidSOLRecommended agent workflow:
quote_operation firstdeposit_to_hyperliquid with dryRun=truedeposit_to_hyperliquid with dryRun=falsebase/polygon and arbitrum balances, then re-run quote_operation with the remaining source balance if a retry is neededget_hyperliquid_market_stateInputs:
market optionalBehavior:
market is omitted, returns the full supported perpetual market listmarket is provided, also returns best bid / ask from the live L2 snapshotdex:COIN format such as xyz:GOLDget_hyperliquid_account_stateInputs:
user optionaldex optionalBehavior:
user is omitted, the skill uses the treasury signer addressdex is provided, the tool queries that specific HIP-3 builder dexabstractionState and dexAbstractionEnabledplace_hyperliquid_orderInputs:
accountAddress optional for read-only dry-run / quote contextmarketsidesizeorderTypeprice required for limit ordersslippageBps optional for market ordersreduceOnly optionalleverage optionalmarginMode optionaltimeInForce optional for limit ordersenableDexAbstraction optionalapproval optionaldryRun optionalBehavior:
dex:COIN format such as xyz:GOLDmarket and limit orders in the first versionquote_operation supports this toolaccountAddress is provided, dry-run and quote can use it for read-only account contextdexAbstractionenableDexAbstraction=true if you want execution to switch the account into dexAbstraction firstRecommended agent workflow:
quote_operation first with operationType=place_hyperliquid_ordersafety block and notionalUsdplace_hyperliquid_order with dryRun=trueplace_hyperliquid_order with dryRun=falseprotect_hyperliquid_positionInputs:
accountAddress optional for read-only dry-run / quote contextmarkettakeProfitRoePercent optional, default 100stopLossRoePercent optional, default 50replaceExisting optionalliquidationBufferBps optional, default 25enableDexAbstraction optionalapproval optionaldryRun optionalBehavior:
takeProfitRoePercent=100 means position equity doublingstopLossRoePercent=50 means position equity halvingliquidationBufferBps and returns a warningquote_operation supports this toolenableDexAbstraction=true if the account must first switch into dexAbstractionRecommended agent workflow:
quote_operation first with operationType=protect_hyperliquid_positionprotect_hyperliquid_position with dryRun=trueprotect_hyperliquid_position with dryRun=falsecancel_hyperliquid_orderInputs:
marketorderIddryRun optionalBehavior:
safety_checkInputs:
operationTypechaintokenamountdestination optionalapproval optionalfeeBps optionalslippageBps optionalBehavior:
quote_operationInputs:
operationTypeBehavior:
place_hyperliquid_orderprotect_hyperliquid_positionnode dist/index.js --action get_balances --input '{"walletAddress":"0x1111111111111111111111111111111111111111","chain":"arbitrum"}'
node dist/index.js --action get_balances --input '{"chain":"solana","solanaAddress":"HK6y2RbhgDJLQ1gAmJatjEyZTjfK6MSHBtpoSN1Vx85A"}'
node dist/index.js --action transfer_token --input '{"chain":"base","token":"USDC","recipient":"0x2222222222222222222222222222222222222222","amount":"100","approval":true,"dryRun":true}'
node dist/index.js --action swap_token --input '{"chain":"arbitrum","sellToken":"USDC","buyToken":"WETH","amount":"250","approval":true,"dryRun":true,"slippageBps":50}'
node dist/index.js --action bridge_token --input '{"sourceChain":"polygon","destinationChain":"arbitrum","token":"USDC","amount":"2500","approval":true,"dryRun":true}'
node dist/index.js --action bridge_token --input '{"sourceChain":"solana","destinationChain":"ethereum","token":"SOL","amount":"0.02","approval":true,"dryRun":true}'
node dist/index.js --action deposit_to_hyperliquid --input '{"sourceChain":"base","token":"USDC","amount":"500","destination":"0xYourTreasuryWallet","approval":true,"dryRun":true}'
node dist/index.js --action get_hyperliquid_market_state --input '{"market":"ETH"}'
node dist/index.js --action get_hyperliquid_market_state --input '{"market":"xyz:GOLD"}'
node dist/index.js --action get_hyperliquid_account_state --input '{"user":"0xYourHyperliquidWallet"}'
node dist/index.js --action get_hyperliquid_account_state --input '{"user":"0xYourHyperliquidWallet","dex":"xyz"}'
node dist/index.js --action quote_operation --input '{"operationType":"place_hyperliquid_order","walletAddress":"0xYourHyperliquidWallet","market":"ETH","side":"buy","size":"0.01","orderType":"market","approval":true}'
node dist/index.js --action quote_operation --input '{"operationType":"place_hyperliquid_order","walletAddress":"0xYourHyperliquidWallet","market":"xyz:GOLD","side":"sell","size":"0.01","orderType":"market","approval":true,"enableDexAbstraction":true}'
node dist/index.js --action place_hyperliquid_order --input '{"accountAddress":"0xYourHyperliquidWallet","market":"ETH","side":"buy","size":"0.01","orderType":"limit","price":"2000","leverage":2,"approval":true,"dryRun":true}'
node dist/index.js --action place_hyperliquid_order --input '{"accountAddress":"0xYourHyperliquidWallet","market":"xyz:GOLD","side":"sell","size":"0.01","orderType":"market","approval":true,"enableDexAbstraction":true,"dryRun":true}'
node dist/index.js --action quote_operation --input '{"operationType":"protect_hyperliquid_position","walletAddress":"0xYourHyperliquidWallet","market":"BTC","takeProfitRoePercent":100,"stopLossRoePercent":50,"approval":true}'
node dist/index.js --action protect_hyperliquid_position --input '{"accountAddress":"0xYourHyperliquidWallet","market":"BTC","takeProfitRoePercent":100,"stopLossRoePercent":50,"approval":true,"dryRun":true}'
node dist/index.js --action cancel_hyperliquid_order --input '{"market":"ETH","orderId":123456,"dryRun":true}'
safety_check reasoning. Execution tools perform the check again internally.dryRun=true first for all new destinations or larger transfers.quote_operation plus dryRun=true before any new Hyperliquid order.protect_hyperliquid_position over ad hoc manual TP/SL math when protecting an existing Hyperliquid position.approval=true for amounts above the configured threshold.