feat: add orderbook command, Polymarket withdraw/balance#7
Merged
Conversation
…ple bots - Add `fintool orderbook <SYMBOL>` (spot) and `fintool perp orderbook <SYMBOL>` with support for Hyperliquid, Binance, and Coinbase exchanges - Add Polymarket withdraw support via bridge API (`--exchange polymarket`) - Add Polymarket USDC balance query (`balance --exchange polymarket`) - Fix JSON dispatch to pass `exchange` param for withdraw command - Update example bots: use fintool for all data (no direct HL API calls), require API keys as in-file constants - Add orderbook docs to README.md and skills/SKILL.md - Add tests/polymarket/withdraw.sh and withdraw step to predict_btc.sh Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fintool orderbook <SYMBOL>(spot) andfintool perp orderbook <SYMBOL>with support for Hyperliquid, Binance, and Coinbase. Includes spread/mid-price calculation, human-readable and JSON output modes.fintool withdraw USDC --amount N --to base --exchange polymarketusing the Polymarket bridge SDK. Supports Base, Ethereum, and Arbitrum destinations. JSON mode included.fintool balance --exchange polymarketto query USDC balance via the CLOB API.withdrawJSON command now passes theexchangeparameter (was hardcoded to"auto").funding_arb/bot.pyto use fintool for all data (removed direct HL API calls), added orderbook spread/depth analysis. Both bots now require API keys as in-file constants.tests/polymarket/withdraw.shand a Step 7 (withdraw entire balance to Base) intests/polymarket/predict_btc.sh.Test plan
cargo buildcompiles cleanlyfintool orderbook HYPE— spot orderbook from Hyperliquidfintool perp orderbook BTC— perp orderbook from Hyperliquidfintool orderbook ETH --levels 10— custom depthfintool --json '{"command":"orderbook","symbol":"HYPE"}'— JSON modefintool withdraw USDC --amount 10 --to base --exchange polymarket— Polymarket withdrawfintool --json '{"command":"withdraw","asset":"USDC","amount":10,"to":"base","exchange":"polymarket"}'— JSON withdrawfintool --json '{"command":"balance","exchange":"polymarket"}'— Polymarket balance./tests/polymarket/withdraw.sh— withdraw test script./tests/polymarket/predict_btc.sh— full e2e with withdraw step🤖 Generated with Claude Code