Repository navigation
Conversation
…-fee Both commands signed and submitted to Hyperliquid even with --dry-run, and never asked for confirmation. They now go through the same guard as order, close, cancel and leverage: --dry-run prints the plan and signs nothing, an interactive terminal asks before signing, and NANSEN_REQUIRE_CONFIRM applies off a terminal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
transfer makes no proxy read before the guard, so unlike the other perp commands its dry run did not check the network and previewed a transfer the real run refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nansen-pr-reviewer summaryThe change correctly adds dry-run and confirmation guards to perp transfers and builder-fee approval, and the transfer path now rejects values whose float-rendered wire amount would differ from the input. One contradictory skill-documentation statement still says these commands are unchanged, which can mislead agents about confirmation behavior. Findings by Severity
Deterministic check: success — Found 1 finding(s) within acceptable thresholds Risk: 3/5 (Elevated) ✅ Auto-approved — Deterministic gates passed: severity thresholds met, recommendation "approve_with_comments", risk level 3/5 within threshold 3. Token usage: 44,388 input, 3,034 output, 89,697 cache read | Usage Guide Cooldown: for the next 10 minutes (counting from when this review finished), new pushes to this PR will not trigger another review — the next push after the window expires will. Need a fresh review sooner? Comment |
The amount went through a float and an 8-decimal string, so an input with more precision, or too large for a float, was signed as a different amount. Compare the typed decimal with the string that would be signed, and refuse the transfer when they differ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| **When stdin is *not* a terminal** (agents, CI) the commands submit without prompting, exactly as before, and `--yes` is a no-op. **Exception:** if `NANSEN_REQUIRE_CONFIRM=1` is set, they fail with `CONFIRMATION_REQUIRED` (exit 1) before any request or signature unless `--yes` or `NANSEN_YES=1` is given; follow the operator stop point described above. These are the same rules as `trade execute` and `bridge execute`. `transfer` and `approve-builder-fee` are unchanged. | ||
| **When stdin is *not* a terminal** (agents, CI) the commands submit without prompting, exactly as before, and `--yes` is a no-op. **Exception:** if `NANSEN_REQUIRE_CONFIRM=1` is set, they fail with `CONFIRMATION_REQUIRED` (exit 1) before any request or signature unless `--yes` or `NANSEN_YES=1` is given; follow the operator stop point described above. These are the same rules as `trade execute` and `bridge execute`. | ||
|
|
There was a problem hiding this comment.
🔵 - Low | Trading skill incorrectly says transfer and builder-fee approval are unchanged
This statement contradicts the surrounding documentation and the implementation: both commands now support --dry-run, prompt on an interactive terminal, and honor NANSEN_REQUIRE_CONFIRM. Agents following this line may incorrectly assume the old unguarded behavior and fail to account for confirmation or confirmation-required errors.
There was a problem hiding this comment.
✅ Auto-approved by Nansen review
Deterministic gates passed: severity thresholds met, recommendation "approve_with_comments", risk level 3/5 within threshold 3.
- The deterministic severity check passed: Found 1 finding(s) within acceptable thresholds
- Risk level 3/5 (Elevated)
- The model recommended: approve_with_comments
Approval was decided by deterministic gates, not by the model. The model's recommendation can block auto-approval but never cause it.
What
nansen perp transferandnansen perp approve-builder-feenow go through the same execute guard asperp order,close,cancelandleverage:--dry-runruns validation and the compliance screen, prints a plan, and signs nothing (no wallet password needed).--yes/-y/NANSEN_YES=1skips the question. The wallet key is only loaded after the user says yes.NANSEN_REQUIRE_CONFIRM=1is set, in which case they fail withCONFIRMATION_REQUIREDbefore any request.dry-runandyesare added to both commands insrc/schema.json, and the perp help, README and trading skill list both commands with the others.Why
Both commands ignored
--dry-run(it is a global boolean flag, so it was parsed and silently dropped):perp transfer --direction perp-to-spot --amount 500 --dry-runsigned and submitted the transfer, andapprove-builder-fee --dry-runsigned the fee approval. Neither ever asked for confirmation.How it was tested
src/__tests__/perp-execute-guard.test.jsfor both commands: dry run (plan, nothing signed, no password, blocked wallet, testnet URL refused, unparseable amount),NANSEN_REQUIRE_CONFIRMwith and without--yes, terminal decline/accept, off-terminal, already-approved, the transfer nonce taken after the prompt, and the CLI command table. The dry-run tests fail on main withsubmitExchangecalled once.npm testandnpm run lintpass.--dry-runruns print the plan and exit 0 with nothing signed;NANSEN_REQUIRE_CONFIRM=1without--yesexits 1 withCONFIRMATION_REQUIRED;nansen schemalists the new options.perp transfer ... --dry-runperp approve-builder-fee --dry-runnCONFIRMATION_DECLINED, nothing signedNANSEN_REQUIRE_CONFIRM=1, no--yesCONFIRMATION_REQUIRED, no request🤖 Generated with Claude Code