Actions61
- Activity Actions
- Asset Actions
- Custom Query Actions
- Hub Actions
- Lending Actions
- Market Data Actions
- Position Management Actions
- Position Swap Actions
- Protocol Actions
- Reserve Actions
- Spoke Actions
- Swap Actions
- User Position Actions
Position Swap → Get Withdraw Swap Quote
AI-generatedSummary
Fetch a swap quote for withdrawing a position's funds into a specified reserve.
Inputs
- chainId (required) — Choose from the list, or specify an ID using an expression
- withdrawPosition (required) — The ID of the supply position to withdraw (UserSupplyItemId)
- withdrawBuyReserve (required) — The ID of the reserve to swap withdrawn funds into
- withdrawAmount (required) — The amount to withdraw and swap (in token units)
- withdrawUserAddress (required) — The user address performing the withdrawal
Output shape
a single swap quote object
Contains trade details such as input amount, expected output, price, and possible error information; shape is fixed but may include optional fields.
Examples
Example 1: Withdraw 1.0 USDC from position supply_item_abc into reserve reserve_xyz on Ethereum
chainId: "ethereum", withdrawPosition: "supply_item_abc", withdrawBuyReserve: "reserve_xyz", withdrawAmount: "1.0", withdrawUserAddress: "0x123..."
Example 2: Get quote for swapping withdrawn funds from a position into a stablecoin reserve on Polygon
chainId: "polygon", withdrawPosition: "pos_123", withdrawBuyReserve: "reserve_stable", withdrawAmount: "50.0", withdrawUserAddress: "0xabc..."
Example 3: Query the swap price for withdrawing a small amount into a new reserve with default settings
chainId: "base", withdrawPosition: "pos_001", withdrawBuyReserve: "reserve_new", withdrawAmount: "0.1", withdrawUserAddress: "0xdef..."