Open
Conversation
Bash script that exercises a full trading workflow: - Deposit USDC from Base → Hyperliquid - Quote and buy SILVER perp, monitor price for up to 10 min - Sell SILVER perp when price rises above entry (or on timeout) - Withdraw USDC back to Base - Buy ETH spot on Hyperliquid, withdraw to Ethereum mainnet - Buy TSLA on Coinbase Requires funded wallet with >= $10 USDC on Base and Coinbase keys. Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add informative before/after messages for each step showing key JSON response data — prices, funding rates, position sizes, PnL estimates, bridge TX hashes, and color-coded price monitoring output. Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace run_fintool() || true pattern that silently swallowed all errors. New approach captures stdout/stderr/exit-code separately via temp files. check_fail() helper prints the full error output (colored red) and calls fail() whenever a command returns non-zero. Each step now: - Gates on prior step success (e.g., skip sell if buy failed) - Prints fintool's stderr progress messages in gray on success, red on failure - Shows the exact error text from fintool on failure - Tracks pass/fail counts accurately in the summary Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deposit is a prerequisite for all subsequent trading steps. Stop immediately instead of continuing with steps that are guaranteed to fail. Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Before executing the USDC bridge, check ETH balances on both the source chain and Arbitrum. If Arbitrum has insufficient ETH for the final HL Bridge2 deposit tx, automatically bridge 0.001 ETH from the source chain via Across Protocol. Bail early with a clear error if the source chain lacks enough ETH to cover gas + the ETH bridge amount. 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>
Signed-off-by: Michael Yuan <michael@secondstate.io> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use 0x0 as outputToken in the Across API to receive native ETH on Arbitrum instead of WETH. This avoids the chicken-and-egg problem where unwrapping WETH requires native ETH for gas but there is none. Flow: wrap ETH→WETH on Base → Across bridge → native ETH on Arbitrum. Also removes the WETH balance check and unwrap logic that is no longer needed. 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
tests/e2e_trading.sh— a bash script that exercises a full real-money trading workflow across Hyperliquid and CoinbaseTest flow
Prerequisites
~/.fintool/config.tomlwith Hyperliquid wallet (>= $10 USDC on Base) and Coinbase API keysjqinstalledTest plan
bash -n tests/e2e_trading.sh— syntax check passes🤖 Generated with Claude Code