agent-finance-cli-linux-arm64 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/agent-finance CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-finance-cli-linux-arm64",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Prebuilt linux/arm64 binary for agent-finance-cli.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {
@@ -22,6 +22,7 @@
22
22
  },
23
23
  "files": [
24
24
  "bin/",
25
+ "skill-data/",
25
26
  "README.md",
26
27
  "LICENSE-MIT",
27
28
  "LICENSE-APACHE"
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: core
3
+ description: Entry guide for agent-finance market price, sessions, crypto, history, research data, provider coverage, prediction markets, proxy context, and safe source handling. Read this before using agent-finance commands.
4
+ ---
5
+
6
+ # agent-finance core skill
7
+
8
+ This skill is printed by the `agent-finance` CLI. It is the first thing an AI Agent should read before using the tool.
9
+
10
+ ## Start Here
11
+
12
+ ```bash
13
+ agent-finance skills list
14
+ agent-finance skills get core --full
15
+ agent-finance market providers
16
+ agent-finance capabilities
17
+ agent-finance skills get crypto
18
+ agent-finance skills get profile
19
+ ```
20
+
21
+ ## Default Workflow
22
+
23
+ 1. Current observable price:
24
+
25
+ ```bash
26
+ agent-finance market price CRDO
27
+ agent-finance market price CRDO --json
28
+ ```
29
+
30
+ 2. Precise session/provider split:
31
+
32
+ ```bash
33
+ agent-finance market sessions CRDO
34
+ agent-finance market sessions LITE --proxy-symbol LITEUSDT
35
+ ```
36
+
37
+ 3. History before a trading or order-quality conclusion:
38
+
39
+ ```bash
40
+ agent-finance market history LITE --interval 1d --range 1mo --adjustment auto --limit 30
41
+ agent-finance market history LITE --interval 1m --range 5d --session extended --adjustment raw --no-actions --limit 120
42
+ ```
43
+
44
+ 4. Research data:
45
+
46
+ ```bash
47
+ agent-finance market fundamentals CRDO
48
+ agent-finance market fundamentals CRDO --provider sec-edgar
49
+ agent-finance market analysis CRDO
50
+ agent-finance market options CRDO
51
+ agent-finance market ownership CRDO
52
+ agent-finance market events CRDO --provider sec-edgar
53
+ agent-finance market news CRDO
54
+ agent-finance market read-url "https://www.sec.gov/Archives/edgar/data/0001807794/000162828026014017/crdo-20260131.htm"
55
+ agent-finance market search "optical interconnect"
56
+ agent-finance market screen day_gainers
57
+ ```
58
+
59
+ 5. Prediction-market sentiment:
60
+
61
+ ```bash
62
+ agent-finance market polymarket search "spacex ipo" --limit 5
63
+ agent-finance market polymarket market MARKET_ID_OR_SLUG
64
+ agent-finance skills get prediction-markets
65
+ ```
66
+
67
+ 6. Crypto market data:
68
+
69
+ ```bash
70
+ agent-finance market crypto snapshot BTC/USDT
71
+ agent-finance market crypto sentiment BTCUSDT
72
+ agent-finance market price BTC/USDT --asset crypto
73
+ agent-finance market history BTC/USDT --asset crypto --interval 1h --limit 48
74
+ agent-finance market crypto quote BTC/USDT
75
+ agent-finance market crypto book BTC/USDT --provider okx --limit 20
76
+ agent-finance market crypto discover --provider coingecko --kind trending
77
+ ```
78
+
79
+ 7. Signed trading profile and audit workflows:
80
+
81
+ ```bash
82
+ agent-finance skills get profile
83
+ agent-finance account permissions --profile default --json
84
+ agent-finance account balances --profile default --json
85
+ agent-finance account positions --profile default --json
86
+ agent-finance risk explain --profile default
87
+ agent-finance order submit INTENT_ID --profile default
88
+ agent-finance order query BTCUSDT --profile default --market spot --client-order-id CLIENT_ORDER_ID --json
89
+ agent-finance order open --profile default --market spot --symbol BTCUSDT --json
90
+ agent-finance transfer history --profile live --direction spot-to-usds-futures --size 20 --json
91
+ agent-finance state create --profile default --kind leverage --symbol BTCUSDT --leverage 2
92
+ agent-finance state create --profile default --kind position-mode --position-mode hedge
93
+ agent-finance state submit INTENT_ID --profile default
94
+ agent-finance audit export --json
95
+ ```
96
+
97
+ ## Rules
98
+
99
+ - Use `market price` for the default "what is the current price?" answer.
100
+ - Use `market sessions` when premarket, postmarket, overnight, BOATS, provider differences, or proxy prices matter.
101
+ - Use both daily and minute history before judging fills, limit-order quality, stop placement, or intraday action.
102
+ - Use `market providers --json` when an Agent needs a machine-readable capability matrix.
103
+ - Use `capabilities --json` for the unified terminal surface, including account/order/transfer/futures-state safety boundaries.
104
+ - Use `skills get profile` before touching signed account, order, transfer, futures state, risk, or audit commands.
105
+ - Signed read commands return a typed `SignedReadSnapshot` envelope with `profile`, `provider`, `environment`, `kind`, typed `request` scope, and raw provider data under `payload`.
106
+ - Signed read snapshot kinds are command discriminators: `account permissions` -> `api-permissions`, `account balances` -> `spot-balances`, `account positions` -> `usds-futures-positions`, `order query` -> `order-query`, `order open` -> `open-orders`, `transfer history` -> `transfer-history`.
107
+ - Signed submit commands return a typed `SubmitSnapshot` envelope with `profile`, `provider`, `environment`, `intent_id`, `intent_kind`, `mode`, `risk`, `execution.kind`, and execution data under `execution.payload`.
108
+ - Run `profile doctor` before live writes; it checks `[permissions]` against the risk policy, reports Binance API permission checks when HMAC env vars are set, and live submit rechecks exchange permissions before claiming the intent.
109
+ - Signed order test/live submit checks locally checkable Binance exchangeInfo filters before sending an order; dry-run remains offline.
110
+ - Live market orders are blocked until risk notional can be derived from fresh exchange data instead of user-supplied `valuation_price`.
111
+ - USD-M futures leverage, margin type, and Binance futures account position mode changes use separate `state` intents; order submit never changes account state implicitly.
112
+ - Position mode changes every symbol; Binance UM/CM share `dualSidePosition`, and the exchange rejects the change when either side has open orders or open positions.
113
+ - Position mode policy is not in the default profile template; add an explicit `[[risk.allowed_futures_state_changes]]` entry with `kind = "position-mode"` and the intended `mode` before creating that intent.
114
+ - Treat crypto as 24/7 market data. Use Binance/Coinbase/OKX/CoinGecko through capability-first crypto commands, then force providers only for cross-checking.
115
+ - Spot is crypto spot; USD-M futures / TradFi perps are derivatives and proxy instruments.
116
+ - Treat Polymarket as quantifiable prediction-market sentiment and event-probability evidence only; it is not an equity quote or primary-source fact.
117
+ - `market read-url` is a text extraction fallback, not a real browser. For dynamic, login-gated, screenshot-sensitive, or noisy pages, use an available browser tool such as agent-browser or opencli.
118
+ - JSON output preserves structured fields for downstream computation. Human output is for quick inspection.
@@ -0,0 +1,131 @@
1
+ # agent-finance full core skill
2
+
3
+ Read this when you need the full command map for `agent-finance`.
4
+
5
+ ## Command Map
6
+
7
+ ```bash
8
+ agent-finance skills list
9
+ agent-finance skills get core
10
+ agent-finance skills get price
11
+ agent-finance skills get research-data
12
+ agent-finance skills get providers
13
+ agent-finance skills get crypto
14
+ agent-finance skills get prediction-markets
15
+ agent-finance skills get history-indicators
16
+ ```
17
+
18
+ ## Price and Sessions
19
+
20
+ ```bash
21
+ agent-finance market price CRDO
22
+ agent-finance market price CRDO MRVL --json
23
+ agent-finance market sessions CRDO
24
+ agent-finance market sessions LITE --proxy-symbol LITEUSDT
25
+ ```
26
+
27
+ `market price` answers the default current-price question. `market sessions` compares regular/pre/post/overnight/provider/proxy sources.
28
+
29
+ ## History and Indicators
30
+
31
+ ```bash
32
+ agent-finance market history CRDO --range 1mo --interval 1d
33
+ agent-finance market history CRDO --range 5d --interval 1m --session extended --adjustment raw --no-actions
34
+ agent-finance market history CRDO --range 1y --interval 1d --adjustment auto --repair
35
+ agent-finance market indicators CRDO MRVL --limit 120
36
+ ```
37
+
38
+ Use history before making order, fill, stop-loss, take-profit, or intraday trend judgments. Indicators are summaries; they do not replace the bar path.
39
+
40
+ ## Research Data
41
+
42
+ ```bash
43
+ agent-finance market fundamentals CRDO
44
+ agent-finance market fundamentals CRDO --provider sec-edgar
45
+ agent-finance market fundamentals CRDO --provider robinhood
46
+ agent-finance market fundamentals CRDO --provider cnbc
47
+ agent-finance market analysis CRDO
48
+ agent-finance market options CRDO
49
+ agent-finance market options CRDO --provider robinhood --count 80
50
+ agent-finance market ownership CRDO
51
+ agent-finance market events CRDO --provider sec-edgar
52
+ agent-finance market news CRDO
53
+ agent-finance market read-url "https://www.sec.gov/Archives/edgar/data/0001807794/000162828026014017/crdo-20260131.htm"
54
+ agent-finance market search "optical interconnect"
55
+ agent-finance market screen day_gainers
56
+ ```
57
+
58
+ Research reports include sources, modules, coverage gaps, highlights, and raw payloads in JSON mode.
59
+
60
+ ## Providers and Proxy Data
61
+
62
+ ```bash
63
+ agent-finance market providers
64
+ agent-finance market providers --json
65
+ agent-finance market crypto snapshot BTC/USDT
66
+ agent-finance market crypto sentiment BTCUSDT
67
+ agent-finance market price BTC/USDT --asset crypto
68
+ agent-finance market crypto quote BTC/USDT
69
+ agent-finance market crypto candles BTC/USDT --provider coingecko --interval 1d --limit 30
70
+ agent-finance market crypto discover --provider okx --kind instruments --instrument swap
71
+ ```
72
+
73
+ Use `market providers` as the source-of-truth coverage matrix. Crypto commands are capability-first across Binance/Coinbase/OKX/CoinGecko; USD-M futures / TradFi perps are derivative/proxy prices, not legal equity or broker-fill prices.
74
+
75
+ ## Prediction Markets
76
+
77
+ ```bash
78
+ agent-finance market polymarket search "spacex ipo" --limit 5
79
+ agent-finance market polymarket search "spcex" --limit 5
80
+ agent-finance market polymarket market MARKET_ID_OR_SLUG --json
81
+ agent-finance skills get prediction-markets
82
+ ```
83
+
84
+ Use Polymarket for quantifiable sentiment and event-probability signals. It does not replace SEC/IR/company releases, verified news, or equity quotes.
85
+
86
+ ## Signed Profile, Risk, and Audit
87
+
88
+ ```bash
89
+ agent-finance skills get profile
90
+ agent-finance profile doctor --profile default
91
+ agent-finance account permissions --profile default --json
92
+ agent-finance account balances --profile default --json
93
+ agent-finance account positions --profile default --json
94
+ agent-finance risk explain --profile default
95
+ agent-finance risk check INTENT_ID --profile default --live
96
+ agent-finance order query BTCUSDT --profile default --market spot --client-order-id CLIENT_ORDER_ID --json
97
+ agent-finance order open --profile default --market spot --symbol BTCUSDT --json
98
+ agent-finance state create --profile default --kind leverage --symbol BTCUSDT --leverage 2
99
+ agent-finance state create --profile default --kind margin-type --symbol BTCUSDT --margin-type isolated
100
+ agent-finance state create --profile default --kind position-mode --position-mode hedge
101
+ agent-finance state submit INTENT_ID --profile default
102
+ agent-finance audit tail --limit 20
103
+ agent-finance audit export --json
104
+ agent-finance transfer history --profile live --direction spot-to-usds-futures --size 20 --json
105
+ ```
106
+
107
+ Use `profile doctor` to inspect profile `[permissions]`, risk-policy consistency, Binance API key restrictions, and provider permissions before live writes. Use `risk explain` to inspect profile limits and the local audit-backed daily order notional counter before live writes.
108
+ Signed read JSON commands return a typed `SignedReadSnapshot` envelope. The typed request scope is under `request`; provider-native data is under `payload`.
109
+
110
+ | Command | `kind` | Common payload path |
111
+ | --- | --- | --- |
112
+ | `account permissions` | `api-permissions` | `payload` |
113
+ | `account balances` | `spot-balances` | `payload.balances` |
114
+ | `account positions` | `usds-futures-positions` | `payload.assets`, `payload.positions` |
115
+ | `order query` | `order-query` | `payload` |
116
+ | `order open` | `open-orders` | `payload` |
117
+ | `transfer history` | `transfer-history` | `payload.rows` |
118
+
119
+ Signed submit JSON commands return a typed `SubmitSnapshot` envelope. Branch on `intent_kind`, `mode`, and `execution.kind`; read dry-run plans or exchange-native execution details from `execution.payload`.
120
+
121
+ Order test/live submit checks locally checkable Binance exchangeInfo filters before sending the order; market-order notional is reported as not locally checked because the exchange execution price is unknown before submit. Live market orders are blocked until risk notional can be derived from fresh exchange data instead of user-supplied `valuation_price`. Dry-run remains offline and prints the exchangeInfo request for later verification.
122
+ USD-M futures leverage, margin type, and Binance futures account position mode changes use separate `state` intents and require explicit `risk.allowed_futures_state_changes` policy before live submit. Position mode policy is not in the default profile template; add an explicit `kind = "position-mode"` entry with the intended `mode`. Position mode changes every symbol; Binance UM/CM share `dualSidePosition`, and the exchange rejects the change when either side has open orders or open positions.
123
+ Transfer history reads Binance SAPI live account data and requires a reviewed live profile.
124
+
125
+ ## Network and Browser Boundaries
126
+
127
+ The CLI respects `--proxy`, `AGENT_FINANCE_PROXY`, and standard proxy environment variables. It does not hardcode a local proxy.
128
+
129
+ Polymarket uses the official SDK by default. When `--proxy` or `--no-proxy` is explicit, it uses public REST fallback through the CLI HTTP stack so those network controls are honored.
130
+
131
+ `market read-url` is a text extraction fallback. For dynamic, login-gated, screenshot-sensitive, or noisy pages, open the original page with an available real browser tool such as agent-browser or opencli.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: crypto
3
+ description: Use capability-first crypto market data across Binance, Coinbase, OKX, and CoinGecko for spot, swap, futures, quotes, order books, trades, candles, funding, open interest, and sentiment.
4
+ ---
5
+
6
+ # agent-finance market crypto skill
7
+
8
+ Use this when crypto markets, Binance/Coinbase/OKX/CoinGecko spot data, Binance/OKX derivatives data, funding, open interest, long/short ratios, taker flow, basis, or 24/7 crypto price discovery matter.
9
+
10
+ ## Start
11
+
12
+ ```bash
13
+ agent-finance market crypto snapshot BTC/USDT
14
+ agent-finance market crypto sentiment BTCUSDT
15
+ agent-finance market price BTC/USDT --asset crypto
16
+ agent-finance market history BTC/USDT --asset crypto --interval 1h --limit 48
17
+ agent-finance market crypto quote BTC/USDT
18
+ agent-finance market crypto book BTC/USDT --limit 20
19
+ agent-finance market crypto candles BTC/USDT --interval 1h --limit 48
20
+ ```
21
+
22
+ ## Cross-Provider Evidence
23
+
24
+ Prefer these capability-first commands before forcing provider-specific deep endpoints:
25
+
26
+ ```bash
27
+ agent-finance market crypto quote BTC/USDT
28
+ agent-finance market crypto quote BTC-USD --provider coinbase
29
+ agent-finance market crypto book BTC/USDT --provider okx --limit 20
30
+ agent-finance market crypto trades BTC/USDT --limit 20
31
+ agent-finance market crypto candles BTC/USDT --provider coingecko --interval 1d --limit 30
32
+ agent-finance market crypto funding BTCUSDT --provider auto --instrument swap --limit 8
33
+ agent-finance market crypto open-interest BTCUSDT --provider okx --instrument swap
34
+ agent-finance market crypto discover --provider coingecko --kind trending
35
+ agent-finance market crypto discover --provider coingecko --kind global
36
+ agent-finance market crypto discover --provider okx --kind instruments --instrument swap
37
+ agent-finance market crypto discover --provider coinbase --kind volume-summary
38
+ ```
39
+
40
+ `--provider auto` only queries providers that support the requested capability and instrument. Force `--provider` when auditing a specific provider.
41
+
42
+ ## Instruments
43
+
44
+ ```bash
45
+ agent-finance market crypto quote BTC/USDT --instrument spot
46
+ agent-finance market crypto book BTC/USDT --instrument spot --limit 20
47
+ agent-finance market crypto candles BTC/USDT --instrument spot --interval 1m --limit 60
48
+ agent-finance market crypto funding BTCUSDT --instrument swap --limit 8
49
+ agent-finance market crypto open-interest BTCUSDT --instrument swap
50
+ agent-finance market crypto stream BTCUSDT --kind trade --messages 1
51
+ agent-finance market crypto stream BTCUSDT --instrument swap --kind mark-price --messages 1
52
+ ```
53
+
54
+ ## Rules
55
+
56
+ - Use capability-first crypto commands for all normal work; provider eligibility is determined by capability plus `--instrument`.
57
+ - Binance, Coinbase, OKX, and CoinGecko are tier-1 no-key crypto providers in this CLI, but they answer different questions.
58
+ - Binance/OKX are stronger for exchange microstructure and derivatives evidence. Coinbase is a spot exchange cross-check. CoinGecko is stronger for aggregate breadth, trending, metadata, and exchange discovery.
59
+ - Binance integration uses self-maintained clients for official public REST and WebSocket paths; do not add the generated Binance SDK unless a future version proves cleaner than these local abstractions.
60
+ - Spot WebSocket uses Binance's market-data-only `data-stream.binance.vision` endpoint because this CLI only needs public market data.
61
+ - USD-M Futures WebSocket routes streams through Binance's current `/market/ws` and `/public/ws` paths; do not route futures streams through the legacy root `/ws` path.
62
+ - Prefer `market crypto snapshot` for current observable market state.
63
+ - Prefer `market crypto sentiment` for futures leverage, funding, open interest, long/short, taker flow, and basis.
64
+ - Prefer `market crypto quote/book/trades/candles/funding/open-interest/discover --json` when an Agent needs provider evidence for reasoning.
65
+ - Use `--json` for downstream computation and `--raw` when auditing provider payloads.
66
+ - The `market crypto` command surface is read-only market data. Signed Binance account/order/transfer/futures-state workflows live under `account`, `order`, `transfer`, `state`, `risk`, `audit`, and the `profile` skill.
67
+ - Crypto trades 24/7; do not apply equity regular/pre/post/overnight session assumptions.
68
+ - USD-M futures and TradFi perps are derivatives. They are useful for price discovery and sentiment, not legal equity or broker-fill prices.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: history-indicators
3
+ description: Fetch OHLCV history and local indicators with agent-finance, including equity and crypto intervals, sessions, adjustment modes, repair behavior, and indicator interpretation rules.
4
+ ---
5
+
6
+ # agent-finance market history and indicators skill
7
+
8
+ ## History
9
+
10
+ ```bash
11
+ agent-finance market history LITE --provider auto --interval 1d --range 1mo --limit 30
12
+ agent-finance market history LITE --interval 1m --range 5d --session extended --adjustment raw --no-actions --limit 200
13
+ agent-finance market history LITE --interval 1d --range 1y --adjustment auto --repair --limit 252
14
+ agent-finance market history AAPL --provider robinhood --interval 5m --range 1d --session extended --limit 80
15
+ agent-finance market history BTC/USDT --asset crypto --crypto-provider auto --interval 1h --limit 48
16
+ agent-finance market history BTC/USDT --asset crypto --crypto-provider coinbase --interval 1h --limit 48
17
+ agent-finance market history BTC/USDT --asset crypto --crypto-provider okx --interval 1h --limit 48
18
+ agent-finance market history BTC/USDT --asset crypto --crypto-provider coingecko --interval 1d --limit 30
19
+ agent-finance market history BTCUSDT --asset crypto --crypto-provider binance --instrument swap --interval 1d --limit 30
20
+ ```
21
+
22
+ ## Intervals
23
+
24
+ - Yahoo / Yahoo extended: `1m`, `2m`, `5m`, `15m`, `30m`, `60m`, `90m`, `1h`, `1d`, `5d`, `1wk`, `1mo`, `3mo`.
25
+ - Robinhood: `5m`, `10m`, `1h`, `1d`, `1w`.
26
+ - Stooq live: `1d`, `1w`, `1mo`.
27
+ - Stooq bulk cache: `5m`, `1h` after explicit import.
28
+ - Binance spot / USD-M futures: `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `8h`, `12h`, `1d`, `3d`, `1w`, `1M`.
29
+ - Coinbase: `1m`, `5m`, `15m`, `1h`, `6h`, `1d`.
30
+ - OKX: `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, `2h`, `4h`, `6h`, `12h`, `1d`, `2d`, `3d`.
31
+ - CoinGecko: common intraday and daily requests are mapped to supported OHLC day windows.
32
+
33
+ When unsure:
34
+
35
+ ```bash
36
+ agent-finance market history --help
37
+ agent-finance market stooq sync --help
38
+ ```
39
+
40
+ ## Adjustments
41
+
42
+ - `--adjustment auto`: adjust OHLC and close using adjusted close.
43
+ - `--adjustment back`: adjust OHLC but keep raw close.
44
+ - `--adjustment raw`: keep raw OHLC and expose adjusted close separately.
45
+ - `--repair`: repair obvious 100x Yahoo price errors and mark repaired bars.
46
+
47
+ ## Indicators
48
+
49
+ ```bash
50
+ agent-finance market indicators LITE AAOI --provider auto --limit 120
51
+ agent-finance market indicators CRDO MRVL --session extended --interval 1m --range 5d --limit 200
52
+ ```
53
+
54
+ Indicators are summaries. For fill quality, limit-order decisions, or intraday exits, inspect daily and minute bars directly.
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: prediction-markets
3
+ description: Use Polymarket prediction-market data as quantifiable sentiment and event-probability evidence, including market search, market details, liquidity, orderbook, holder previews, and probability history.
4
+ ---
5
+
6
+ # agent-finance prediction-markets skill
7
+
8
+ Use this skill when an AI Agent needs prediction-market sentiment, event probabilities, or "what capital is pricing in" for a public event.
9
+
10
+ ## Commands
11
+
12
+ ```bash
13
+ agent-finance market polymarket search "spacex ipo" --limit 5
14
+ agent-finance market polymarket search "spcex" --limit 5
15
+ agent-finance market polymarket market MARKET_ID_OR_SLUG
16
+ agent-finance market polymarket market MARKET_ID_OR_SLUG --json
17
+ ```
18
+
19
+ ## Search Semantics
20
+
21
+ - Treat Polymarket search as public relevance search. Do not describe it as guaranteed fuzzy search.
22
+ - Use multiple query fallbacks for important topics:
23
+ - `spacex`, `space x`, `starship`, `ipo`
24
+ - `nvidia`, `nvda`, product names, regulatory events
25
+ - The CLI locally filters and sorts by active/closed state, volume, liquidity, and market signal strength. Still inspect source URLs and raw JSON for important decisions.
26
+
27
+ ## Interpretation Rules
28
+
29
+ - Polymarket prices are implied probabilities backed by user capital.
30
+ - They are useful as quantifiable sentiment and event-probability evidence.
31
+ - They are not facts, confirmed insider information, legal equity prices, broker-fill prices, or official company disclosures.
32
+ - For investment research, pair this signal with primary sources: SEC filings, IR pages, company releases, earnings calls, and verifiable news.
33
+
34
+ ## Useful Flags
35
+
36
+ ```bash
37
+ agent-finance market polymarket search "spacex ipo" --include-closed --min-volume 1000 --json
38
+ agent-finance market polymarket market MARKET_ID_OR_SLUG --limit 20 --refresh
39
+ ```
40
+
41
+ - `--include-closed`: include resolved/closed markets for historical expectation checks.
42
+ - `--min-volume`: ignore thin markets.
43
+ - `--refresh`: bypass local cache.
44
+ - `--cache-ttl-seconds`: tune freshness for repeated agent workflows.
45
+ - `--json`: preserve full structured payloads for downstream reasoning.
46
+
47
+ ## Boundaries
48
+
49
+ - This CLI is read-only for Polymarket.
50
+ - It does not accept private keys, derive API keys, place orders, cancel orders, or manage Polymarket positions.
51
+ - Default transport uses the official SDK. Explicit `--proxy` or `--no-proxy` uses public REST fallback through the CLI HTTP stack so those network controls are honored.
52
+ - Holder data is reported as preview rows returned by the API limit, not as a total holder count.
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: price
3
+ description: Fetch current price summaries, regular-market basis, premarket, postmarket, overnight sessions, crypto prices, proxy symbols, streams, and watch output with agent-finance.
4
+ ---
5
+
6
+ # agent-finance market price skill
7
+
8
+ ## Default Price
9
+
10
+ Use `market price` to answer "what is it trading at now?":
11
+
12
+ ```bash
13
+ agent-finance market price CRDO
14
+ agent-finance market price CRDO --json
15
+ ```
16
+
17
+ The default output includes current observable price, session, provider, local timestamp, UTC fields in JSON, change from regular-market previous close, and regular-market open/high/low/volume when available.
18
+
19
+ ## Session Split
20
+
21
+ Use `market sessions` when the task asks about premarket, postmarket, overnight, BOATS, platform 24h prices, or provider disagreement:
22
+
23
+ ```bash
24
+ agent-finance market sessions CRDO
25
+ agent-finance market sessions LITE --proxy-symbol LITEUSDT
26
+ ```
27
+
28
+ ## Crypto And Proxy Context
29
+
30
+ Use the crypto market domain for actual crypto symbols:
31
+
32
+ ```bash
33
+ agent-finance market price BTC/USDT --asset crypto
34
+ agent-finance market price BTCUSDT --asset crypto --instrument spot
35
+ agent-finance market price BTCUSDT --asset crypto --instrument swap
36
+ ```
37
+
38
+ If an equity or pre-IPO name has a relevant 24/7 derivative or proxy contract, add it only as side context:
39
+
40
+ ```bash
41
+ agent-finance market sessions SPCX --proxy-symbol SPCXUSDT
42
+ ```
43
+
44
+ Proxy symbols are price-discovery and sentiment signals. They are not the legal equity, pre-IPO ownership, or broker-fill price.
45
+
46
+ ## Streaming
47
+
48
+ ```bash
49
+ agent-finance market stream CRDO --messages 5
50
+ agent-finance market watch CRDO --interval-seconds 15 --iterations 4
51
+ ```
52
+
53
+ Use `watch` when WebSocket streaming is blocked by the local network.
@@ -0,0 +1,217 @@
1
+ ---
2
+ name: profile
3
+ description: Configure agent-finance trading profiles, Binance HMAC env references, risk policy, intent-first live writes, audit logs, and safe AI Agent workflows.
4
+ ---
5
+
6
+ # agent-finance profile skill
7
+
8
+ Use this skill before any `account`, `order`, `transfer`, `risk`, or `audit` command.
9
+ Also use it before USD-M futures `state` changes.
10
+
11
+ ## Model
12
+
13
+ - A profile is a TOML file in the user config directory.
14
+ - The profile stores environment variable names for Binance HMAC keys, not secrets.
15
+ - The default HMAC secret env is `BINANCE_PRIVATE_KEY`; in Binance HMAC mode this is the API Secret string, not an RSA or Ed25519 private key.
16
+ - Live writes require all of these: profile `allow_live = true`, matching `[permissions]` declarations, the relevant order/transfer/futures-state whitelist, matching Binance API key permissions, intent id, and `--live`.
17
+ - Live market orders are blocked until risk notional can be derived from fresh exchange data instead of user-supplied `valuation_price`.
18
+ - USD-M futures leverage, margin type, and Binance futures account position mode changes require explicit `risk.allowed_futures_state_changes` policy and use separate `state` intents.
19
+ - Binance position mode changes every symbol; UM/CM share `dualSidePosition`, and Binance rejects the change when either side has open orders or open positions.
20
+ - Order, cancel, transfer, and futures state writes are intent-first. Create the intent, inspect it, run `risk check`, then submit.
21
+ - Audit logging is append-only JSONL in the user data directory.
22
+
23
+ ## Profile Permissions
24
+
25
+ `[permissions]` declares what this profile is allowed to attempt before API-key probing:
26
+
27
+ ```toml
28
+ [permissions]
29
+ spot_trading = true
30
+ usds_futures = true
31
+ universal_transfer = false
32
+ ```
33
+
34
+ - `spot_trading`: required for Spot order and cancel intents.
35
+ - `usds_futures`: required for USD-M order/cancel intents and futures state changes.
36
+ - `universal_transfer`: required for Spot `<->` USD-M internal transfers.
37
+ - `profile doctor` reports both profile/risk consistency and live Binance API-key permission checks when HMAC env vars are set.
38
+ - `risk check` and submit block an intent when the matching profile permission is `false`, even if the risk whitelist would otherwise allow it.
39
+ - Profiles that omit `[permissions]` or omit individual fields parse with those permissions defaulting to `false`; this is fail-closed and `profile doctor` will report which declarations are missing for the risk policy.
40
+
41
+ ## Setup
42
+
43
+ ```bash
44
+ agent-finance profile path --profile default
45
+ agent-finance profile template --profile default
46
+ agent-finance profile doctor --profile default
47
+ agent-finance profile explain --profile default
48
+ agent-finance risk explain --profile default
49
+ agent-finance account permissions --profile default --json
50
+ agent-finance account balances --profile default --json
51
+ agent-finance account positions --profile default --json
52
+ ```
53
+
54
+ Signed read JSON output is a `SignedReadSnapshot` envelope:
55
+
56
+ - `profile`, `provider`, `environment`, `kind`
57
+ - `request`: typed read request and scope
58
+ - `payload`: raw provider response for the requested signed read
59
+
60
+ | Command | `kind` | Common payload path |
61
+ | --- | --- | --- |
62
+ | `account permissions` | `api-permissions` | `payload` |
63
+ | `account balances` | `spot-balances` | `payload.balances` |
64
+ | `account positions` | `usds-futures-positions` | `payload.assets`, `payload.positions` |
65
+ | `order query` | `order-query` | `payload` |
66
+ | `order open` | `open-orders` | `payload` |
67
+ | `transfer history` | `transfer-history` | `payload.rows` |
68
+
69
+ ## Order Flow
70
+
71
+ ```bash
72
+ agent-finance order create BTCUSDT --profile default --market spot --side buy --kind limit --quantity 0.001 --price 50000 --time-in-force gtc
73
+ agent-finance order create BTCUSDT --profile default --market spot --side buy --kind limit-maker --quantity 0.001 --price 50000
74
+ agent-finance order create BTCUSDT --profile default --market spot --side buy --kind market --quantity 0.001 --valuation-price 50000
75
+ agent-finance risk check INTENT_ID --profile default
76
+ agent-finance order submit INTENT_ID --profile default
77
+ agent-finance order submit INTENT_ID --profile default --test
78
+ agent-finance order submit INTENT_ID --profile default --live
79
+ agent-finance order query BTCUSDT --profile default --market spot --client-order-id CLIENT_ORDER_ID --json
80
+ agent-finance order open --profile default --market spot --symbol BTCUSDT --json
81
+ ```
82
+
83
+ Signed submit JSON output is a `SubmitSnapshot` envelope:
84
+
85
+ - `profile`, `provider`, `environment`, `intent_id`, `intent_kind`, `mode`, `risk`
86
+ - `execution.kind`: `plan`, `order-submit`, `cancel`, `transfer`, or `futures-state`
87
+ - `execution.payload`: dry-run request plan, exchange rule check, or raw provider execution payload
88
+
89
+ ## Cancel Flow
90
+
91
+ `order cancel` creates a cancel intent; it does not cancel an exchange order until the intent is checked and submitted.
92
+
93
+ ```bash
94
+ agent-finance order cancel BTCUSDT --profile default --market spot --client-order-id CLIENT_ORDER_ID
95
+ agent-finance risk check CANCEL_INTENT_ID --profile default
96
+ agent-finance order submit CANCEL_INTENT_ID --profile default
97
+ agent-finance order submit CANCEL_INTENT_ID --profile default --live
98
+ ```
99
+
100
+ ## Futures State Flow
101
+
102
+ Add Binance futures account position mode policy manually before using `--kind position-mode`; it is not included in the default profile template:
103
+
104
+ ```toml
105
+ [[risk.allowed_futures_state_changes]]
106
+ kind = "position-mode"
107
+ mode = "hedge"
108
+ ```
109
+
110
+ ```bash
111
+ agent-finance state create --profile default --kind leverage --symbol BTCUSDT --leverage 2
112
+ agent-finance state create --profile default --kind margin-type --symbol BTCUSDT --margin-type isolated
113
+ agent-finance state create --profile default --kind position-mode --position-mode hedge
114
+ agent-finance risk check INTENT_ID --profile default --live
115
+ agent-finance state submit INTENT_ID --profile default
116
+ agent-finance state submit INTENT_ID --profile default --live
117
+ ```
118
+
119
+ ## Transfer Flow
120
+
121
+ ```bash
122
+ agent-finance transfer create USDT --profile default --direction spot-to-usds-futures --amount 10
123
+ agent-finance risk check INTENT_ID --profile default
124
+ agent-finance transfer submit INTENT_ID --profile default
125
+ agent-finance transfer submit INTENT_ID --profile default --live
126
+ agent-finance transfer history --profile live --direction spot-to-usds-futures --size 20 --json
127
+ ```
128
+
129
+ ## Audit Flow
130
+
131
+ ```bash
132
+ agent-finance audit tail --limit 20
133
+ agent-finance audit export --json
134
+ ```
135
+
136
+ ## Gated Smoke Tests
137
+
138
+ These checks are for maintainers and AI Agents validating signed Binance workflows.
139
+ They require exported `BINANCE_API_KEY` and `BINANCE_PRIVATE_KEY`; the test profiles store only env var names.
140
+
141
+ Live read-only signed smoke, no orders or transfers:
142
+
143
+ ```bash
144
+ AGENT_FINANCE_LIVE_BINANCE_SIGNED=1 cargo test --test binance_live binance_live_signed_read_only_surface_is_usable -- --ignored --exact --nocapture
145
+ ```
146
+
147
+ Testnet signed order-test smoke, uses Binance test endpoints and does not place a live order:
148
+
149
+ ```bash
150
+ AGENT_FINANCE_TESTNET_BINANCE_SIGNED=1 cargo test --test binance_live binance_testnet_signed_order_test_surface_is_usable -- --ignored --exact --nocapture
151
+ ```
152
+
153
+ Testnet order-flow smoke places a Binance testnet spot `LIMIT_MAKER` order, checks open orders and order query, then cancels it.
154
+ It uses the Binance testnet environment and skips live SAPI permission probing; it does not touch live Binance funds, but it still requires testnet credentials, explicit ACK, a deliberately post-only order, and enough testnet balance.
155
+ If the testnet price would take liquidity, Binance should reject the `LIMIT_MAKER` submit and the smoke fails before open/query/cancel assertions:
156
+
157
+ ```bash
158
+ AGENT_FINANCE_TESTNET_BINANCE_ORDER_FLOW=1 \
159
+ AGENT_FINANCE_TESTNET_BINANCE_ORDER_FLOW_ACK=I_UNDERSTAND_THIS_PLACES_A_TESTNET_ORDER \
160
+ AGENT_FINANCE_TESTNET_BINANCE_ORDER_SYMBOL=BTCUSDT \
161
+ AGENT_FINANCE_TESTNET_BINANCE_ORDER_SIDE=buy \
162
+ AGENT_FINANCE_TESTNET_BINANCE_ORDER_QUANTITY=0.0004 \
163
+ AGENT_FINANCE_TESTNET_BINANCE_ORDER_PRICE=30000 \
164
+ AGENT_FINANCE_TESTNET_BINANCE_ORDER_MAX_NOTIONAL_USDT=15 \
165
+ cargo test --test binance_live_write binance_testnet_order_open_query_cancel_flow_is_usable -- --ignored --exact --nocapture
166
+ ```
167
+
168
+ Live place-and-cancel smoke places a real Binance spot `LIMIT_MAKER` post-only order and then cancels it.
169
+ The test also reads the live Binance order book and fails before submit unless buy price is below best bid or sell price is above best ask.
170
+ Use only with a deliberately non-marketable tiny order that still satisfies Binance min-notional filters; do not fix min-notional failures by making the price marketable.
171
+ Prefer a liquid low-notional symbol such as `DOGEUSDT` when the account only has a few USDT. Compute the smoke price from the live book and keep buy orders at least 3% below best bid, or sell orders at least 3% above best ask. After the smoke, query open orders and balances to confirm no order or locked balance remains.
172
+ Binance cancel responses may identify the original order with `origClientOrderId`; `clientOrderId` can refer to the cancel request itself.
173
+ Set `AGENT_FINANCE_LIVE_BINANCE_SMOKE_DATA_HOME` to a persistent local directory so audit events and daily live notional limits survive between smoke runs.
174
+
175
+ ```bash
176
+ AGENT_FINANCE_LIVE_BINANCE_PLACE_AND_CANCEL_ORDER=1 \
177
+ AGENT_FINANCE_LIVE_BINANCE_WRITE_ACK=I_UNDERSTAND_THIS_PLACES_A_LIVE_ORDER \
178
+ AGENT_FINANCE_LIVE_BINANCE_SMOKE_DATA_HOME=$HOME/.local/state/agent-finance-live-smoke \
179
+ AGENT_FINANCE_LIVE_BINANCE_ORDER_SYMBOL=DOGEUSDT \
180
+ AGENT_FINANCE_LIVE_BINANCE_ORDER_MARKET=spot \
181
+ AGENT_FINANCE_LIVE_BINANCE_ORDER_SIDE=buy \
182
+ AGENT_FINANCE_LIVE_BINANCE_ORDER_QUANTITY=15 \
183
+ AGENT_FINANCE_LIVE_BINANCE_ORDER_PRICE=0.07638 \
184
+ AGENT_FINANCE_LIVE_BINANCE_ORDER_MAX_NOTIONAL_USDT=5 \
185
+ cargo test --test binance_live_write binance_live_order_cancel_smoke_is_usable -- --ignored --exact --nocapture
186
+ ```
187
+
188
+ Live transfer smoke moves real funds between Spot and USD-M. Run it only with a tiny amount and an explicit direction:
189
+
190
+ ```bash
191
+ AGENT_FINANCE_LIVE_BINANCE_TRANSFERS=1 \
192
+ AGENT_FINANCE_LIVE_BINANCE_TRANSFER_ACK=I_UNDERSTAND_THIS_MOVES_FUNDS \
193
+ AGENT_FINANCE_LIVE_BINANCE_SMOKE_DATA_HOME=$HOME/.local/state/agent-finance-live-smoke \
194
+ AGENT_FINANCE_LIVE_BINANCE_TRANSFER_ASSET=USDT \
195
+ AGENT_FINANCE_LIVE_BINANCE_TRANSFER_DIRECTION=spot-to-usds-futures \
196
+ AGENT_FINANCE_LIVE_BINANCE_TRANSFER_AMOUNT=0.1 \
197
+ AGENT_FINANCE_LIVE_BINANCE_TRANSFER_MAX_AMOUNT=0.1 \
198
+ cargo test --test binance_live_write binance_live_transfer_smoke_is_usable -- --ignored --exact --nocapture
199
+ ```
200
+
201
+ ## Guardrails
202
+
203
+ - Never put API secrets in TOML, Markdown, command history, audit logs, or prompts.
204
+ - Use Binance testnet profiles first.
205
+ - For live profiles, keep whitelist and notional limits small.
206
+ - `profile doctor` first checks that `[permissions]` covers the risk policy, then reads Binance API restrictions when HMAC env vars are set and reports specific permission checks for spot trading, USD-M futures, and universal transfer.
207
+ - Missing `[permissions]` fields default to `false`; add explicit declarations instead of assuming older profiles are live-write capable.
208
+ - Live submit checks the required Binance API permissions before claiming the intent, so a permission failure does not consume the intent.
209
+ - `max_daily_order_notional_usdt` is enforced from the local append-only audit log for `risk check --live` and live order submit. Matching live-submit events with missing notional data fail closed.
210
+ - `order submit` without flags is an offline dry-run; `--test` calls an exchange test endpoint where available but does not consume the intent; only `--live` consumes the intent.
211
+ - `order submit --test` and `order submit --live` fetch Binance `exchangeInfo` and block orders that violate locally checkable symbol status, price tick, lot size, or notional filters. Dry-run is offline and prints the `exchangeInfo` request that will be checked later.
212
+ - Limit orders use `--price` as the exchange price. Spot `limit-maker` orders map to Binance `LIMIT_MAKER`, do not accept `--time-in-force`, and rely on the exchange to reject orders that would immediately take liquidity. Market orders use `--valuation-price` for risk notional checks and never send an exchange `price` parameter; exchange notional for market orders is reported as not locally checked because it depends on execution price.
213
+ - Live universal transfers require explicit `[[risk.allowed_transfers]]` entries with direction, asset, and max amount.
214
+ - Live futures state changes require explicit `[[risk.allowed_futures_state_changes]]` entries. Order submit does not change leverage, margin type, or position mode implicitly.
215
+ - Review `risk check` findings before live position-mode submit; the CLI warns that Binance applies it account-wide across every symbol and that UM/CM share the setting.
216
+ - Transfer history reads Binance SAPI live account data and requires a reviewed live profile.
217
+ - Do not use this CLI for withdrawals, margin, COIN-M, options, earn, or external transfers.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: providers
3
+ description: Understand agent-finance provider capabilities across Yahoo, SEC EDGAR, CNBC, Robinhood, Stooq, Binance, Coinbase, OKX, CoinGecko, Polymarket, and fallback URL readers.
4
+ ---
5
+
6
+ # agent-finance market providers skill
7
+
8
+ ## Capability Matrix
9
+
10
+ Always inspect provider coverage instead of guessing from provider names:
11
+
12
+ ```bash
13
+ agent-finance market providers
14
+ agent-finance market providers --json
15
+ ```
16
+
17
+ ## Provider Rules
18
+
19
+ - Quotes: use `market price SYMBOL` first. Only force a provider when cross-checking.
20
+ - Session split: use `market sessions SYMBOL`.
21
+ - History: use `market history --provider auto|yahoo|stooq|robinhood` for equities; use `market history --asset crypto --crypto-provider auto|binance|coinbase|okx|coingecko` for crypto.
22
+ - Research: `market fundamentals/events --provider auto` combines useful no-key sources when available.
23
+ - SEC EDGAR is official for filings and XBRL facts, not market quotes, options, analyst estimates, or news aggregation.
24
+ - Robinhood and CNBC are partial no-key sources; use them as cross-checks, not replacements for official filings or primary disclosures.
25
+ - Stooq live can provide no-key daily/weekly/monthly history; intraday bulk data requires explicit imported ZIP cache.
26
+ - Crypto: use capability-first commands such as `market crypto quote/book/trades/candles/funding/open-interest/discover`, then force `--provider binance|coinbase|okx|coingecko` only when cross-checking or auditing.
27
+ - Binance Spot and USD-M Futures are tier-1 crypto market-data providers. Use `agent-finance skills get crypto`.
28
+ - Binance uses local clients against official public REST/WebSocket paths, not the generated Binance SDK.
29
+ - Binance USD-M futures / TradFi perps are derivative instruments and proxy price-discovery sources, not legal equity.
30
+ - Coinbase is a spot exchange cross-check for products, tickers, stats, books, trades, candles, and volume summary.
31
+ - OKX is a spot/derivatives exchange cross-check for instruments, tickers, books, trades, candles, funding, mark price, and open interest.
32
+ - CoinGecko is an aggregate crypto source for simple price, coin metadata, markets, tickers, OHLC, market charts, trending, global, exchanges, and derivatives discovery.
33
+ - Polymarket is a prediction-market sentiment source. Use `market polymarket search` and `market polymarket market` for implied probability, orderbook, liquidity, OI, holder preview rows, and probability history; do not use it as an equity quote or primary-source fact.
34
+
35
+ ## Browser Boundary
36
+
37
+ The CLI uses HTTP requests with browser-like TLS behavior where possible, but it is not a full browser. Dynamic, login-gated, screenshot-sensitive, or noisy pages require a real browser tool. Polymarket uses the official SDK by default; explicit `--proxy` or `--no-proxy` uses public REST fallback through the CLI HTTP stack.
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: research-data
3
+ description: Fetch no-key Yahoo, SEC EDGAR, Robinhood, and CNBC research data, including fundamentals, analyst data, options, ownership, events, news, search, screeners, and URL text extraction.
4
+ ---
5
+
6
+ # agent-finance research data skill
7
+
8
+ ## Commands
9
+
10
+ ```bash
11
+ agent-finance market fundamentals CRDO
12
+ agent-finance market fundamentals CRDO --provider sec-edgar
13
+ agent-finance market fundamentals CRDO --provider robinhood
14
+ agent-finance market fundamentals CRDO --provider cnbc
15
+ agent-finance market analysis CRDO
16
+ agent-finance market options CRDO
17
+ agent-finance market options CRDO --provider robinhood --count 80
18
+ agent-finance market ownership CRDO
19
+ agent-finance market events CRDO --provider sec-edgar
20
+ agent-finance market news CRDO
21
+ agent-finance market read-url "https://www.sec.gov/Archives/edgar/data/0001807794/000162828026014017/crdo-20260131.htm"
22
+ agent-finance market search "optical interconnect"
23
+ agent-finance market screen most_actives
24
+ ```
25
+
26
+ ## Output Rules
27
+
28
+ - Human mode prints a compact table.
29
+ - `--json` preserves sources, modules, coverage gaps, highlights, and raw payloads.
30
+ - `--raw` prints raw payloads in human mode.
31
+ - `--refresh` skips cache.
32
+ - `--cache-ttl-seconds <N>` changes non-price cache TTL.
33
+ - `market read-url --provider auto` tries direct/Jina/Defuddle readers and reports fallback errors.
34
+
35
+ ## Research Rules
36
+
37
+ - Treat social media, search snippets, and extracted web text as leads until confirmed by primary sources.
38
+ - Use SEC/company filings for official facts when available.
39
+ - Use a real browser for dynamic, login-gated, table-layout-sensitive, or extraction-suspicious pages.