Quote a leveraged position (v4)
get_leverage_quotev4 only. Quote opening or increasing a leveraged position in one atomic order: the debt reserve is flash-loaned, swapped into the collateral reserve and supplied, and the debt is drawn against it to repay the flash loan. Both reserves are reserveIds from get_markets in this session, on the same spoke: pick a debtReserve whose 'quotableAs' lists leverageDebt and a collateralReserve whose 'quotableAs' lists leverageCollateral. Returns the quote with a quoteId (feeds preview_action and prepare_order), the approvals to sign first, and maxSafeMultiplier - the multiplier at which the position becomes liquidatable, which a requested multiplier must stay under. Nothing is committed until the user signs, so state the plan rather than asking permission to quote it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | Yes | Wallet address (0x, 40 hex) of the wallet that will sign, as the user named it in this session. If no wallet has been named, ask for it; never substitute a placeholder, which is rejected. | |
| version | No | Optional, and only 'v4': this tool exists on v4 only. | |
| multiplier | No | Target exposure multiplier (target collateral / entry equity), e.g. '2.5'. Strictly greater than 1, and it must stay under the quote's maxSafeMultiplier. Omit the argument entirely to be quoted at a multiplier the backend picks from how closely the two assets track each other. | |
| debtReserve | Yes | reserveId of the asset borrowed (flash-loaned, then owed as debt), from get_markets. | |
| slippagePct | No | Optional max slippage as a percent string, e.g. '0.5'. Omit to accept the backend suggestion. | |
| enableCollateral | No | Whether the supplied collateral backs borrowing (default true, which the leverage loop requires). Omit unless the user asked otherwise. | |
| collateralReserve | Yes | reserveId of the asset bought and supplied as collateral, from get_markets. | |
| additionalCollateral | No | Extra collateral pulled from the wallet (via permit) on top of existing collateral, in the collateral asset's main units. Required when the wallet has no existing collateral in that reserve; otherwise omit the argument entirely unless the user wants to top up. |