Skip to main content

Close margin position

GET 

/v1/actions/loop/close

Close a leveraged position. Identify the collateral market with marketUidIn and debt market 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: Empty for close operations (no setup needed).
  • permissions: Lender withdrawal delegations (targeting the lending protocol contract). Only missing delegations are returned. Execute these first.

Lista DAO fixed-term (brokered) markets: when marketUidOut is brokered, pass loanId to select which broker loan the repay leg pays down (or the type(uint128).max sentinel for the flexible position). The collateral withdraw leg is handled automatically (routed through the market's collateralProvider when set, e.g. slisBNB).

Request

Responses

Quote or full build response