Skip to main content

Collateral swap

GET 

/v1/actions/loop/collateral-swap

Swap collateral assets within a lending position. Identify the sell-side collateral market with marketUidIn and buy-side with marketUidOut. Omit account for quote-only (returns data.quotes with price deltas). Include account to build full transaction calldata (populates actions with alternatives, transactions, and permissions).

Response actions fields (when account is provided):

  • alternatives: DEX aggregator swap transactions sorted best-output-first. Pick one to execute.
  • transactions: Collateral enable (enterMarkets) for Compound V2 lenders. Empty otherwise.
  • permissions: Lender withdrawal delegations (targeting the lending protocol contract). Only missing delegations are returned. Execute these first.

Request

Responses

Quote or full build response