Prepare mandate collateral withdraw
prepare_mandate_withdraw_collateralMove collateral from the position back to the account, never to any other address. "max" stops at the account's minimum ratio. Checks the account's limits, then returns UNSIGNED transaction data for the session key, simulated first. Above the approval threshold it returns EIP-712 typed data for the owner instead, which only works when the owner is an ordinary wallet: it refuses when the owner is a contract, such as a Safe. Never signs or sends.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | USDG to withdraw as a decimal string, or "max" | |
| market | Yes | Market address (0x...) or symbol, e.g. NO-NVDA | |
| account | Yes | Mandate account address (0x...) | |
| approval | No | Only above the approval threshold: the nonce and deadline from typedData, plus the owner's signature | |
| sessionKey | Yes | The session key that will send it (0x...). Not held by this server | |
| approvalTtlSeconds | No | Optional: how long a new approval stays valid. Default 1 hour |