Quote a position swap (v4)
get_position_swap_quotev4 only. Quote swapping one Aave v4 position for another, atomically and without leaving the protocol: kind=supply swaps collateral for a different collateral asset, kind=borrow swaps one debt for another. Both sides are on the same spoke. Get 'sellPosition' from get_position_items, whose 'quotableAs' says whether that item can be sold this way (supplySwapFrom or borrowSwapFrom), and 'buyReserve' from get_markets, whose 'quotableAs' says whether that reserve can receive it (supplySwapTo or borrowSwapTo). The quoteId feeds prepare_order. Nothing is committed until the user signs, so state the plan rather than asking permission to quote it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | supply = collateral swap, borrow = debt swap. | |
| user | Yes | Wallet address (0x, 40 hex). | |
| amount | Yes | Amount in main units of the sold position, e.g. '100.5'. | |
| version | No | Optional, and only 'v4': this tool exists on v4 only. | |
| buyReserve | Yes | reserveId to move into (from get_markets), on the same spoke as the position sold. | |
| slippagePct | No | Optional max slippage as a percent string, e.g. '0.5'. Omit to accept the backend suggestion. | |
| sellPosition | Yes | positionItemId to sell (from get_position_items): a supply item for kind=supply, a borrow item for kind=borrow. | |
| enableCollateral | No | kind=supply only: enable the bought reserve as collateral (default true). |