Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ jobs:
- name: Smoke test - news
run: ./target/release/fintool news BTC || true

- name: Smoke test - predict
run: |
./target/release/fintool predict list || true
./target/release/fintool predict search "election" || true

- name: Smoke test - report
run: ./target/release/fintool report list AAPL || true

Expand Down
70 changes: 1 addition & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# fintool

A Rust CLI for financial trading and market intelligence — spot and perpetual futures on **Hyperliquid**, **Unit**, **Binance**, and **Coinbase**, stock quotes, LLM-enriched analysis, prediction markets on **Polymarket** and **Kalshi**, SEC filings, and news.
A Rust CLI for financial trading and market intelligence — spot and perpetual futures on **Hyperliquid**, **Unit**, **Binance**, and **Coinbase**, stock quotes, LLM-enriched analysis, SEC filings, and news.

## Install as an OpenClaw Skill

Expand Down Expand Up @@ -48,10 +48,6 @@ fintool news ETH
fintool report annual AAPL
fintool report list TSLA

# Prediction markets
fintool predict list
fintool predict search "election"

# Spot trading (auto-selects exchange)
fintool order buy TSLA 100 410
fintool order sell TSLA 1 420
Expand Down Expand Up @@ -186,9 +182,6 @@ binance_api_secret = "..."
coinbase_api_key = "..."
coinbase_api_secret = "..."

# Kalshi — prediction market trading
# kalshi_api_key = "..."
# kalshi_api_secret = "..."
```

### Config Options
Expand All @@ -205,9 +198,6 @@ coinbase_api_secret = "..."
| `api_keys` | `binance_api_secret` | string | — | Binance API secret (HMAC-SHA256 signing). |
| `api_keys` | `coinbase_api_key` | string | — | Coinbase Advanced Trade API key. |
| `api_keys` | `coinbase_api_secret` | string | — | Coinbase Advanced Trade API secret (HMAC-SHA256 signing). |
| `api_keys` | `kalshi_api_key` | string | — | Kalshi API key (for prediction market trading). |
| `api_keys` | `kalshi_api_secret` | string | — | Kalshi API secret. |

### What Needs Configuration

| Command | Hyperliquid Wallet | Binance Keys | Coinbase Keys | OpenAI Key | Exchange Support |
Expand All @@ -216,15 +206,13 @@ coinbase_api_secret = "..."
| `perp quote` | No | No | No | No | N/A (read-only) |
| `news`, `init` | No | No | No | No | N/A |
| `report` | No | No | No | No | N/A |
| `predict list/search/quote` | No | No | No | No | N/A |
| `order buy/sell` | Yes (HL) | Yes (Binance) | Yes (Coinbase) | No | All three |
| `perp buy/sell` | Yes (HL) | Yes (Binance) | No | No | HL + Binance |
| `orders` | Yes (HL) | Yes (Binance) | Yes (Coinbase) | No | All three |
| `cancel` | Yes (HL) | Yes (Binance) | Yes (Coinbase) | No | All three |
| `balance` | Yes (HL) | Yes (Binance) | Yes (Coinbase) | No | All three |
| `positions` | Yes (HL) | Yes (Binance) | Yes (Coinbase) | No | All three |
| `options buy/sell` | No | Yes (Binance) | No | No | Binance only |
| `predict buy/sell` | Yes (HL) | No | No | No | Polymarket/Kalshi |
| `deposit` (HL) | Yes | No | No | No | Hyperliquid |
| `deposit` (Binance) | No | Yes | No | No | Binance |
| `deposit` (Coinbase) | No | No | Yes | No | Coinbase |
Expand Down Expand Up @@ -950,51 +938,6 @@ fintool bridge-status --human

---

### `fintool predict list [--platform <PLATFORM>] [--limit <N>]`

List trending prediction markets from Polymarket and/or Kalshi.

```bash
fintool predict list
fintool predict list --platform polymarket --limit 5
fintool predict list --platform kalshi --human
```

---

### `fintool predict search <QUERY> [--platform <PLATFORM>] [--limit <N>]`

Search prediction markets by keyword.

```bash
fintool predict search "trump"
fintool predict search "BTC" --platform kalshi
```

---

### `fintool predict quote <MARKET_ID>`

Get detailed quote for a specific market. Market ID format: `platform:identifier`.

```bash
fintool predict quote kalshi:KXBALANCE-29
fintool predict quote polymarket:china-coup-attempt-before-2027
```

---

### `fintool predict buy/sell <MARKET_ID> <SIDE> <AMOUNT>`

> ⚠️ **Stub** — Requires Polymarket CLOB signing or Kalshi API credentials.

```bash
fintool predict buy kalshi:KXBALANCE-29 yes 10
fintool predict sell polymarket:some-market no 50 --min-price 90
```

---

## Command Summary

| Command | Description | Exchanges |
Expand All @@ -1015,14 +958,9 @@ fintool predict sell polymarket:some-market no 50 --min-price 90
| `fintool balance` | Account balances | Hyperliquid, Binance, Coinbase |
| `fintool positions` | Open positions + PnL | Hyperliquid, Binance, Coinbase |
| `fintool options buy/sell ...` | Options trading | Binance only |
| `fintool predict list` | List prediction markets | Polymarket, Kalshi |
| `fintool predict search <Q>` | Search prediction markets | Polymarket, Kalshi |
| `fintool predict quote <ID>` | Quote prediction market | Polymarket, Kalshi |
| `fintool deposit <ASSET>` | Deposit to exchange | Hyperliquid, Binance, Coinbase |
| `fintool withdraw <AMT> <ASSET>` | Withdraw from exchange | Hyperliquid, Binance, Coinbase |
| `fintool bridge-status` | Unit bridge operation status | Hyperliquid |
| `fintool predict buy/sell <ID> ...` | Trade predictions (stub) | Polymarket, Kalshi |

## Data Sources

| Data | Source | Auth Required | Notes |
Expand All @@ -1040,10 +978,6 @@ fintool predict sell polymarket:some-market no 50 --min-price 90
| Trading — Binance futures | Binance Futures API `/fapi/v1/order` | API key + secret | HMAC-SHA256 signing |
| Trading — Binance options | Binance Options API `/eapi/v1/order` | API key + secret | HMAC-SHA256 signing |
| Trading — Coinbase spot | Coinbase Advanced Trade API `/api/v3/brokerage/orders` | API key + secret | HMAC-SHA256 signing |
| Prediction markets (quotes) | Polymarket Gamma API | No | |
| Prediction markets (quotes) | Kalshi REST API | No | |
| Prediction markets (trading) | Polymarket CLOB | Wallet private key | |
| Prediction markets (trading) | Kalshi REST API | API key + secret | |
| Deposit/Withdraw — HyperUnit bridge | HyperUnit API | Wallet private key | ETH, BTC, SOL ↔ Hyperliquid |
| Deposit — USDC cross-chain bridge | Across Protocol API | Wallet private key | Ethereum/Base → Arbitrum → HL |
| Deposit/Withdraw — HL USDC | Hyperliquid Bridge2 | Wallet private key | Arbitrum ↔ Hyperliquid |
Expand All @@ -1067,7 +1001,6 @@ fintool/
│ ├── coinbase.rs # Coinbase Advanced Trade API client (spot, deposit/withdraw, HMAC-SHA256)
│ ├── bridge.rs # Across Protocol cross-chain USDC bridge (Ethereum/Base ↔ Arbitrum)
│ ├── unit.rs # HyperUnit bridge (ETH/BTC/SOL deposit/withdraw, fee estimation)
│ ├── polymarket.rs # Polymarket CLOB client
│ ├── format.rs # Color formatting helpers
│ └── commands/
│ ├── quote.rs # Multi-source quotes + LLM enrichment
Expand All @@ -1080,7 +1013,6 @@ fintool/
│ ├── balance.rs # Account balance
│ ├── positions.rs # Open positions
│ ├── options.rs # Options trading (Binance only)
│ ├── predict.rs # Prediction markets (Polymarket + Kalshi)
│ ├── deposit.rs # Multi-exchange deposit (Unit, Across, Binance, Coinbase)
│ ├── withdraw.rs # Multi-exchange withdraw (Bridge2, Unit, Across, Binance, Coinbase)
│ └── bridge_status.rs # HyperUnit bridge operation tracker
Expand Down
5 changes: 0 additions & 5 deletions config.toml.default
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ testnet = false
# openai_api_key = "sk-..."
# openai_model = "gpt-4.1-mini"

# Kalshi API credentials — enables prediction market trading
# Sign up at https://kalshi.com
# kalshi_api_key = "..."
# kalshi_api_secret = "..."

# CryptoPanic token — crypto news (optional, not currently used)
# Free at https://cryptopanic.com/developers/api/
# cryptopanic_token = "..."
Expand Down
30 changes: 4 additions & 26 deletions skills/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: fintool
description: "Financial trading CLI — spot/perp/options trading on Hyperliquid, Binance, Coinbase. Deposit and withdraw across chains (Unit bridge, Across Protocol). LLM-enriched price quotes with trend analysis. Prediction markets (Polymarket + Kalshi). News and SEC filings. Use when: user asks about stock/crypto prices, wants to trade, deposit, withdraw, check portfolio, or browse prediction markets."
description: "Financial trading CLI — spot/perp/options trading on Hyperliquid, Binance, Coinbase. Deposit and withdraw across chains (Unit bridge, Across Protocol). 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."
homepage: https://github.com/second-state/fintool
metadata: { "openclaw": { "emoji": "📈", "requires": { "bins": ["curl"] } } }
---
Expand Down Expand Up @@ -166,29 +166,7 @@ Returns: mark price, oracle price, funding rate, open interest, premium, max lev
- `EXPIRY` format: `YYYY-MM-DD` (e.g., `2026-03-28`)
- Binance converts to: `BTC-260328-80000-C` internally

### Workflow 4: Prediction Markets

**Goal**: Browse and trade on prediction markets (Polymarket + Kalshi).

**Step 1 — Browse markets:**
```bash
{baseDir}/scripts/fintool predict list
{baseDir}/scripts/fintool predict search "election"
{baseDir}/scripts/fintool predict search "BTC" --platform kalshi
```

**Step 2 — Get detailed quote:**
```bash
{baseDir}/scripts/fintool predict quote kalshi:TICKER
{baseDir}/scripts/fintool predict quote polymarket:slug
```

**Step 3 — Trade (stub — requires platform-specific auth):**
```bash
{baseDir}/scripts/fintool predict buy kalshi:TICKER yes 10
```

### Workflow 5: Portfolio Overview
### Workflow 4: Portfolio Overview

**Goal**: Check current positions and balances across exchanges.

Expand All @@ -211,7 +189,7 @@ Returns: mark price, oracle price, funding rate, open interest, premium, max lev
{baseDir}/scripts/fintool cancel coinbase:uuid-here # Coinbase
```

### Workflow 6: Depositing Funds
### Workflow 5: Depositing Funds

**Goal**: Fund an exchange account with crypto from an external wallet or another chain.

Expand Down Expand Up @@ -249,7 +227,7 @@ Automatically signs 3 transactions: approval → Across bridge → HL Bridge2 de
{baseDir}/scripts/fintool deposit USDC --exchange coinbase
```

### Workflow 7: Withdrawing Funds
### Workflow 6: Withdrawing Funds

**Goal**: Move assets from an exchange to an external wallet or another chain.

Expand Down
54 changes: 0 additions & 54 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ pub enum Commands {
#[command(subcommand)]
Options(OptionsCmd),

/// Prediction market trading
#[command(subcommand)]
Predict(PredictCmd),

/// Get stock reports (10-K annual, 10-Q quarterly) from SEC EDGAR
#[command(subcommand)]
Report(ReportCmd),
Expand Down Expand Up @@ -192,53 +188,3 @@ pub enum OptionsCmd {
size: String,
},
}

#[derive(Subcommand)]
pub enum PredictCmd {
/// List trending/popular prediction markets
List {
/// Filter by platform: polymarket, kalshi, or all (default)
#[arg(long, default_value = "all")]
platform: String,
/// Max results
#[arg(long, default_value = "10")]
limit: usize,
},
/// Search prediction markets by keyword
Search {
query: String,
#[arg(long, default_value = "all")]
platform: String,
#[arg(long, default_value = "10")]
limit: usize,
},
/// Get price/probability quote for a specific market
Quote {
/// Market ID or ticker (e.g. polymarket:slug or kalshi:TICKER)
market: String,
},
/// Buy a prediction contract
Buy {
/// Market ID (polymarket:slug or kalshi:TICKER)
market: String,
/// Side: yes or no
side: String,
/// Amount in USDC (Polymarket) or USD (Kalshi)
amount: String,
/// Max price in cents (1-99)
#[arg(long)]
max_price: Option<String>,
},
/// Sell a prediction contract
Sell {
/// Market ID (polymarket:slug or kalshi:TICKER)
market: String,
/// Side: yes or no
side: String,
/// Number of contracts to sell
amount: String,
/// Min price in cents (1-99)
#[arg(long)]
min_price: Option<String>,
},
}
1 change: 0 additions & 1 deletion src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pub mod order;
pub mod orders;
pub mod perp;
pub mod positions;
pub mod predict;
pub mod quote;
pub mod report;
pub mod withdraw;
Loading