Skip to main content
Returns the canonical unsigned payload to open a position, for the given wallet to sign. Non-custodial — the server never signs, sends, or holds keys. It auto-selects the open path (direct vs. zap-swap, and public-allocator reallocation when liquidity is thin) in the background, just like the app.

Input

Same as simulate_leverage, plus:
userAddress
string
required
The wallet that will sign. Approvals and onBehalfOf are built for it.

Output

Executing

1

Approvals first

Sign and send each entry in approvals[] (none for native ETH).
2

Then the tx

Sign and send tx from userAddress.
3

Or hand off the link

Give the user meta.signingUrl to review and sign in the Spiral app.
meta.expiresAt — the embedded swap calldata is time-sensitive (~60s). If it lapses before signing, rebuild. See Non-custodial execution.