You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add --dry-run flag to all transacting commands (#11)
## Summary
- Adds a global `--dry-run` flag that previews any on-chain transaction
without signing or submitting
- The API still simulates the transaction (with taker address), so
errors like insufficient balance, minimum size violations, etc. are
caught before execution
- JSON output includes `dryRun: true`, `signature: null`, and the
unsigned base64 `transaction` for external signing workflows
- Table output prints a `[DRY RUN]` label at the top and omits the
signature row
### Commands affected
`spot swap`, `spot transfer`, `spot reclaim`, `perps open`, `perps set`,
`perps close`, `lend earn deposit`, `lend earn withdraw`, `predictions
open`, `predictions close`
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,8 @@ jup predictions positions
62
62
63
63
> [!NOTE]
64
64
> This CLI is designed to be LLM friendly and **all commands are non-interactive**. Set JSON output mode globally for structured responses: `jup config set --output json`, or use `-f json` flag on individual commands.
65
+
>
66
+
> Use `--dry-run` on any transacting command to preview the result without signing or submitting on-chain. In JSON mode, the response includes the unsigned base64 `transaction` for external signing.
65
67
66
68
[Read the docs](./docs/) for specific guides, examples, and workflows:
-`--input` defaults to SOL; accepts SOL, BTC, ETH, or USDC
146
149
-`--slippage` defaults to 200 (2%); set in basis points
147
150
-`--tp` and `--sl` cannot be combined with `--limit`
151
+
-`--dry-run` previews the order without signing. The API simulates the transaction, returning entry price, size, leverage, liquidation price, and fees. JSON response includes the unsigned base64 `transaction`.
jup spot swap --from SOL --to USDC --amount 1 --dry-run
58
59
```
59
60
60
61
-`--key` overrides the active key for this transaction
61
62
-`--slippage` sets max slippage in basis points (e.g. `50` = 0.5%). Recommended to be emtpy: Jupiter's Real-Time Slippage Estimation (RTSE) automatically picks an optimal value.
63
+
-`--dry-run` previews the swap without signing or submitting. The API still simulates the transaction, so errors like insufficient balance are caught. In JSON mode, the response includes the unsigned base64 `transaction` for external signing.
0 commit comments