OpenClaw skill for trading crypto options on Thetanuts Finance with integrated wallet management.
The agent instruction set lives in the locally installed SKILL.md (the file
ClawHub places next to this README). Read it from the install directory — do
not fetch it from the internet, since remote files can change after install
and ClawHub's security review only covers the published artifact.
SKILL.md contains the complete agent instruction set: onboarding flows,
trading workflows, strategy recommendation logic, risk-tiered decision trees,
SDK reference, contract addresses, and example conversations. Read it fully
before assisting users.
- Wallet Management: Create and import EVM/Solana wallets using Tether WDK
- Balance Queries: Check native (ETH/SOL) and token balances (USDC, WETH, cbBTC)
- Transaction Execution: Approve tokens and send transactions directly
- Options Trading: Orderbook fills, RFQ lifecycle, MM pricing, multi-strike structures (spreads, butterflies, condors)
- Position Tracking: Check user positions, calculate payoffs, portfolio ROI
- Market Intelligence: News-informed strategy recommendations with risk-tiered suggestions
- OpenClaw installed and running
- Node.js >= 18.0.0
clawhub install thetanutsThen skip to Step 2 below.
View on ClawHub: clawhub.ai/goheesheng/thetanuts
cd ~/.openclaw/workspace/skills
git clone https://github.com/goheesheng/thetanuts-openclaw.git thetanutscd ~/.openclaw/workspace/skills/thetanuts
bash scripts/onboard.shThis will:
- Check prerequisites (node, npm)
- Create WDK MCP runtime at
~/.openclaw/wdk-mcp - Install project dependencies (for wallet scripts like
wallet-create.js) - Install WDK MCP runtime dependencies
# Create new dedicated wallet
node scripts/wallet-create.js
# Or import existing seed
node scripts/wallet-import.js --seed-file /path/to/seed.txtStart a new session to load the skill:
/new
The agent will automatically detect your wallet, show your address and balances, and display current ETH/BTC option prices. You're ready to trade.
Before trading, you need tokens on Base network:
- ETH (gas fees) - Bridge via bridge.base.org
- USDC (for PUT options) -
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - WETH (for CALL options) -
0x4200000000000000000000000000000000000006
Once funded, just tell the agent what you want: "Show me ETH puts" or "Recommend a strategy."
Check for and apply skill updates:
bash scripts/update.shOptional flags:
REFRESH_WDK_DEPS=1- Refresh dependencies from lockfileUPGRADE_WDK_DEPS=1- Upgrade dependency versions
Note: Updates NEVER modify wallet secrets (.env, WDK_SEED).
Once installed, you can ask questions like:
- "Create a new EVM wallet for me"
- "Check my wallet balance"
- "Show me ETH put options"
- "I want to buy 0.1 ETH 2000 put expiring March 28"
- "Check positions for 0x..."
Seed handling: The skill reads your seed only from the WDK_SEED value in
~/.openclaw/wdk-mcp/.env (written there once by wallet-create.js or
wallet-import.js). The scripts intentionally refuse to accept a seed phrase
as a command-line argument — argv is visible to other processes via ps,
shell history, and terminal logs, so any script that requires the seed loads
it from the environment instead.
The skill uses a centralized wallet stored in ~/.openclaw/wdk-mcp/.env. This enables deterministic wallet operations without passing seed phrases in commands.
| Script | Description |
|---|---|
wallet-discover.js |
Check if wallet is configured, show addresses |
wallet-create.js |
Generate new BIP-39 seed and configure |
wallet-import.js |
Import existing seed from file or stdin |
wallet-select.js |
Set active wallet context (family, chain, index) |
wallet-balance.js |
Query balances with chain-specific RPC |
node scripts/wallet-discover.jsnode scripts/wallet-create.js# From file
node scripts/wallet-import.js --seed-file /path/to/seed.txt
# From stdin
printf '%s' "$SEED" | node scripts/wallet-import.js --stdinnode scripts/wallet-select.js --family evm --chain base-mainnet --index 0# Native balance
node scripts/wallet-balance.js --chain base-mainnet --index 0
# With token balance
node scripts/wallet-balance.js --chain base-mainnet --index 0 --tokens 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913| Chain Slug | Family | Symbol | Chain ID |
|---|---|---|---|
ethereum-mainnet |
evm | ETH | 1 |
base-mainnet |
evm | ETH | 8453 |
bnb-smart-chain |
evm | BNB | 56 |
solana-mainnet |
solana | SOL | - |
The following TypeScript-based commands are available for backward compatibility:
| Script | Description |
|---|---|
create-wallet.ts |
Create new EVM or Solana wallet |
import-wallet.ts |
Import existing wallet from seed phrase |
get-balance.ts |
Get native and token balances |
sign-message.ts |
Sign messages for authentication |
approve-token.ts |
Approve ERC20 token spending |
send-transaction.ts |
Sign and broadcast transactions |
Approval scripts read the seed from the WDK_SEED environment variable
(loaded from ~/.openclaw/wdk-mcp/.env). Passing a seed phrase as a CLI
argument is rejected at script entry — see the global seed-handling note
above.
# Approve an exact USDC amount for Thetanuts (preferred over --max)
npx tsx scripts/approve-token.ts --token 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
--spender 0x1aDcD391CF15Fb699Ed29B1D394F4A64106886e5 --amount 100 --wait
# Unlimited approvals require explicit confirmation; the spender must also be
# on the Thetanuts allowlist (override with --i-understand-risk only after
# independently verifying the address).
npx tsx scripts/approve-token.ts --token 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 \
--spender 0x1aDcD391CF15Fb699Ed29B1D394F4A64106886e5 --max --confirm-max --waitnpx tsx scripts/send-transaction.ts --to 0x1aDcD391CF15Fb699Ed29B1D394F4A64106886e5 --data 0xb5da63e3... --wait| Script | Description |
|---|---|
get-prices.ts |
Get current BTC, ETH prices and protocol stats |
get-mm-pricing.ts |
Get MM option pricing with filters |
get-positions.ts |
Get user positions by wallet address |
build-rfq.ts |
Build RFQ transaction data |
fetch-orders.ts |
Fetch orderbook with filters |
check-orderbook.ts |
Check orderbook liquidity before trading |
fill-order.ts |
Fill an existing orderbook order |
check-rfq-fill.ts |
Verify RFQ fill status after submission |
calculate-payout.ts |
Calculate option payout at settlement |
npx tsx scripts/get-mm-pricing.ts ETH --type PUTnpx tsx scripts/build-rfq.ts --underlying ETH --type PUT --strike 2000 --expiry 1774684800 --contracts 0.1 --direction buy-
Create wallet (or import existing):
node scripts/wallet-create.js
-
Check balance:
node scripts/wallet-balance.js --chain base-mainnet --tokens 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
-
Approve USDC for Thetanuts (one-time per token; prefer an exact amount):
npx tsx scripts/approve-token.ts --token 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 --spender 0x1aDcD391CF15Fb699Ed29B1D394F4A64106886e5 --amount 100 --wait
-
Check orderbook first (always check liquidity before choosing a method):
npx tsx scripts/check-orderbook.ts --underlying ETH --type PUT --strike 1900 --expiry 1774684800 --direction sell
5a. If orderbook has liquidity - fill directly:
npx tsx scripts/fill-order.ts --order-index 0 --collateral 10 --execute --wait5b. If no orderbook liquidity - submit an RFQ:
npx tsx scripts/build-rfq.ts --underlying ETH --type PUT --strike 1900 --expiry 1774684800 --contracts 0.1 --direction buy
npx tsx scripts/send-transaction.ts --to <from-build-rfq> --data <from-build-rfq> --wait- Verify fill (for RFQ trades):
npx tsx scripts/check-rfq-fill.ts --address <wallet> --ticker <expected> --since <submission_timestamp>
# EVM RPC (default: Base Mainnet)
export THETANUTS_RPC_URL="https://mainnet.base.org"
# Solana RPC (default: Mainnet)
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"| Contract | Address |
|---|---|
| USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| WETH | 0x4200000000000000000000000000000000000006 |
| cbBTC | 0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf |
| Thetanuts RFQ | 0x1aDcD391CF15Fb699Ed29B1D394F4A64106886e5 |
- SEED PHRASES: Save securely, never share. Scripts display seed only during creation.
- KEY DISPOSAL: Wallet scripts automatically clear keys from memory after use.
- TRANSACTIONS: Transactions are IRREVERSIBLE once broadcast. Verify before sending.
- APPROVALS: Token approvals allow contracts to spend your tokens. Only approve trusted contracts.
- GAS: Ensure wallet has ETH on Base network for gas fees.
MIT