11---
22name : fintool
3- description : " Financial trading CLIs — spot and perp trading on Hyperliquid, Binance, Coinbase. Prediction markets on Polymarket. Deposit and withdraw across chains. LLM-enriched price quotes with trend analysis. News and SEC filings. Use when: user asks about stock/crypto prices, wants to trade, deposit, withdraw, or check portfolio."
3+ description : " Financial trading CLIs — spot and perp trading on Hyperliquid, Binance, Coinbase, OKX . Prediction markets on Polymarket. Deposit and withdraw across chains. LLM-enriched price quotes with trend analysis. News and SEC filings. Use when: user asks about stock/crypto prices, wants to trade, deposit, withdraw, or check portfolio."
44homepage : https://github.com/second-state/fintool
55metadata : { "openclaw": { "emoji": "📈", "requires": { "bins": ["curl"] } } }
66---
@@ -17,6 +17,7 @@ A suite of CLI tools for market intelligence and trading across multiple exchang
1717| ` hyperliquid ` | Hyperliquid trading (spot, perp, HIP-3, deposits) | ` {baseDir}/scripts/hyperliquid ` |
1818| ` binance ` | Binance trading (spot, perp, deposits) | ` {baseDir}/scripts/binance ` |
1919| ` coinbase ` | Coinbase trading (spot, deposits) | ` {baseDir}/scripts/coinbase ` |
20+ | ` okx ` | OKX trading (spot, perp, deposits, withdrawals) | ` {baseDir}/scripts/okx ` |
2021| ` polymarket ` | Polymarket prediction markets | ` {baseDir}/scripts/polymarket ` |
2122
2223- ** Config** : ` ~/.fintool/config.toml `
@@ -46,25 +47,28 @@ cat ~/.fintool/config.toml 2>/dev/null
4647 - ** Hyperliquid** : ` private_key ` or ` wallet_json ` + ` wallet_passcode ` in ` [wallet] ` (spot + perps)
4748 - ** Binance** : ` binance_api_key ` + ` binance_api_secret ` in ` [api_keys] ` (spot + perps)
4849 - ** Coinbase** : ` coinbase_api_key ` + ` coinbase_api_secret ` in ` [api_keys] ` (spot only)
50+ - ** OKX** : ` okx_api_key ` + ` okx_secret_key ` + ` okx_passphrase ` in ` [api_keys] ` (spot + perps)
4951 - ** Polymarket** : Uses ` wallet.private_key ` (same as Hyperliquid) for prediction market trading
5052 - If none configured: Ask the user which exchange they want to use and request the credentials.
5153
5254** If the user provides credentials** , edit ` ~/.fintool/config.toml ` directly to add them.
5355
5456## Exchange Capabilities
5557
56- | Feature | ` hyperliquid ` | ` binance ` | ` coinbase ` | ` polymarket ` |
57- | ---------| ---------------| -----------| ------------| --------------|
58- | Spot orders | buy, sell | buy, sell | buy, sell | — |
59- | Perp orders | perp buy/sell | perp buy/sell | — | — |
60- | Prediction markets | — | — | — | buy, sell, list, quote |
61- | Orderbook | spot + perp | spot + perp | spot | — |
62- | Deposit | Unit + Across | API | API | bridge |
63- | Withdraw | Bridge2 + Unit + Across | API | API | bridge |
64- | Balance | balance | balance | balance | balance |
65- | Open orders | orders | orders | orders | — |
66- | Cancel | cancel | cancel | cancel | — |
67- | Positions | positions | positions | — | positions |
58+ | Feature | ` hyperliquid ` | ` binance ` | ` coinbase ` | ` okx ` | ` polymarket ` |
59+ | ---------| ---------------| -----------| ------------| -------| --------------|
60+ | Spot orders | buy, sell | buy, sell | buy, sell | buy, sell | — |
61+ | Perp orders | perp buy/sell | perp buy/sell | — | perp buy/sell | — |
62+ | Prediction markets | — | — | — | — | buy, sell, list, quote |
63+ | Orderbook | spot + perp | spot + perp | spot | spot + perp | — |
64+ | Deposit | Unit + Across | API | API | API | bridge |
65+ | Withdraw | Bridge2 + Unit + Across | API | API | API | bridge |
66+ | Transfer | spot ↔ perp ↔ dex | spot ↔ futures | — | funding ↔ trading | — |
67+ | Balance | balance | balance | balance | balance | balance |
68+ | Open orders | orders | orders | orders | orders | — |
69+ | Cancel | cancel | cancel | cancel | cancel | — |
70+ | Positions | positions | positions | — | positions | positions |
71+ | Funding rate | — | — | — | perp funding_rate | — |
6872
6973## Error Handling
7074
@@ -139,6 +143,38 @@ cat ~/.fintool/config.toml 2>/dev/null
139143{"command" : " withdraw" , "asset" : " USDC" , "amount" : 100 , "to" : " 0x..." , "network" : " ethereum" }
140144```
141145
146+ ### OKX Trading (` okx ` )
147+
148+ ``` json
149+ // okx --json '<JSON>'
150+ {"command" : " quote" , "symbol" : " BTC" }
151+ {"command" : " buy" , "symbol" : " ETH" , "amount" : 0.01 , "price" : 2000 }
152+ {"command" : " sell" , "symbol" : " ETH" , "amount" : 0.01 , "price" : 2100 }
153+ {"command" : " orderbook" , "symbol" : " BTC" }
154+ {"command" : " perp_orderbook" , "symbol" : " ETH" }
155+ {"command" : " perp_buy" , "symbol" : " ETH" , "amount" : 0.1 , "price" : 2000 }
156+ {"command" : " perp_sell" , "symbol" : " ETH" , "amount" : 0.1 , "price" : 2100 , "close" : true }
157+ {"command" : " perp_leverage" , "symbol" : " ETH" , "leverage" : 5 , "cross" : true }
158+ {"command" : " perp_funding_rate" , "symbol" : " BTC" }
159+ {"command" : " balance" }
160+ {"command" : " positions" }
161+ {"command" : " orders" }
162+ {"command" : " cancel" , "inst_id" : " BTC-USDT" , "order_id" : " 12345" }
163+ {"command" : " deposit" , "asset" : " USDC" , "network" : " base" }
164+ {"command" : " deposit" , "asset" : " ETH" , "network" : " ethereum" }
165+ {"command" : " withdraw" , "asset" : " USDC" , "amount" : 100 , "network" : " base" }
166+ {"command" : " withdraw" , "asset" : " USDC" , "amount" : 100 , "to" : " 0x..." , "network" : " ethereum" }
167+ {"command" : " transfer" , "asset" : " USDT" , "amount" : 100 , "from" : " funding" , "to" : " trading" }
168+ {"command" : " transfer" , "asset" : " USDT" , "amount" : 100 , "from" : " trading" , "to" : " funding" }
169+ ```
170+
171+ ** OKX Notes:**
172+ - ` quote ` and ` orderbook ` are public endpoints — no API keys needed.
173+ - OKX uses instrument IDs: spot = ` BTC-USDT ` , perp = ` BTC-USDT-SWAP ` . The CLI auto-formats from symbol.
174+ - OKX has ` funding ` (for deposits/withdrawals) and ` trading ` (unified) accounts. Use ` transfer ` to move between them.
175+ - Withdrawal fee is auto-fetched if ` --fee ` is not specified.
176+ - Cancel requires both ` inst_id ` (e.g. ` BTC-USDT ` ) and ` order_id ` .
177+
142178### Coinbase Trading (` coinbase ` )
143179
144180``` json
@@ -209,6 +245,9 @@ Returns: bids, asks, spread, spreadPct, midPrice. Use to assess liquidity before
209245
210246# Or on Coinbase
211247{baseDir}/scripts/coinbase --json ' {"command":"buy","symbol":"BTC","amount":0.01,"price":95000}'
248+
249+ # Or on OKX
250+ {baseDir}/scripts/okx --json ' {"command":"buy","symbol":"BTC","amount":0.01,"price":95000}'
212251```
213252
214253** Step 4 — Verify:**
@@ -260,7 +299,7 @@ Returns: bids, asks, spread, spreadPct, midPrice. Use to assess liquidity before
260299```
261300Use ` "close": true ` to ensure the order only reduces an existing position.
262301
263- ** Note** : Perps are available on ` hyperliquid ` and ` binance ` . Coinbase does not support perps.
302+ ** Note** : Perps are available on ` hyperliquid ` , ` binance ` , and ` okx ` . Coinbase does not support perps.
264303
265304### Workflow 3: Portfolio Overview
266305
@@ -279,6 +318,11 @@ Use `"close": true` to ensure the order only reduces an existing position.
279318# Coinbase
280319{baseDir}/scripts/coinbase --json ' {"command":"balance"}'
281320
321+ # OKX
322+ {baseDir}/scripts/okx --json ' {"command":"balance"}'
323+ {baseDir}/scripts/okx --json ' {"command":"positions"}'
324+ {baseDir}/scripts/okx --json ' {"command":"orders"}'
325+
282326# Polymarket
283327{baseDir}/scripts/polymarket --json ' {"command":"balance"}'
284328{baseDir}/scripts/polymarket --json ' {"command":"positions"}'
@@ -311,10 +355,11 @@ Sends ETH from your wallet on Ethereum L1 to a Unit bridge deposit address. Mini
311355```
312356BTC and SOL cannot be bridged automatically. The command returns a Unit deposit address for manual transfer.
313357
314- ** Binance / Coinbase — get deposit address:**
358+ ** Binance / Coinbase / OKX — get deposit address:**
315359``` bash
316360{baseDir}/scripts/binance --json ' {"command":"deposit","asset":"USDC","from":"ethereum"}'
317361{baseDir}/scripts/coinbase --json ' {"command":"deposit","asset":"ETH"}'
362+ {baseDir}/scripts/okx --json ' {"command":"deposit","asset":"USDC","network":"base"}'
318363```
319364
320365** Polymarket — deposit USDC:**
@@ -333,10 +378,11 @@ BTC and SOL cannot be bridged automatically. The command returns a Unit deposit
333378{baseDir}/scripts/hyperliquid --json ' {"command":"withdraw","asset":"ETH","amount":0.5}'
334379```
335380
336- ** Binance / Coinbase:**
381+ ** Binance / Coinbase / OKX :**
337382``` bash
338383{baseDir}/scripts/binance --json ' {"command":"withdraw","asset":"USDC","amount":100,"to":"0x...","network":"ethereum"}'
339384{baseDir}/scripts/coinbase --json ' {"command":"withdraw","asset":"USDC","amount":100,"to":"0x..."}'
385+ {baseDir}/scripts/okx --json ' {"command":"withdraw","asset":"USDC","amount":100,"network":"base"}'
340386```
341387
342388** Polymarket:**
0 commit comments