Skip to main content

MarketCapability

One action this market row supports, declared by the server. Render the CTA from this, not from lender knowledge — the same contract the earn rows use (/v1/data/earn capabilities[]).

The array is COMPLETE over the actions it models (today: refinance, set-mode, loop-open, loop-close, collateral-swap, debt-swap): for those, absent means NOT OFFERED for this row and a client must not offer it. Actions outside that set say nothing about the row — they are not modelled here yet. Nothing about the underlying mechanism leaks into this shape: refinance on a Lista brokered market is a flash-loan composer bundle and on Exactly it is the protocol's own DebtManager, and a caller can tell neither apart, which is the point.

The four loop actions are LENDER-level facts (the same entries on every row of a lender, and on every /pairs/leverage row of it): a loop has two legs and one row cannot say which it is, so pairing is the pair book's job. Where the protocol registers leverage market by market, the entry also names a marketGate — a field on the row's own descriptor that must be true for THIS market. A lender whose rows and pairs carry none of the four cannot be looped through this API at all; the loop endpoints refuse it up front with the same answer.

actionstring

refinance — move this market's debt into a different term without changing the assets or the size (called "roll-over" when the source is itself a fixed loan); builds at /v1/actions/loop/refinance.

set-mode — switch the ACCOUNT's active risk mode (Aave e-mode); builds at /v1/actions/lending/mode. Absent on lenders with no switchable mode — including LlamaLend, whose mode slot carries a BAND COUNT fixed at open, and every Morpho/Lista-shaped market, which has no mode at all.

loop-open — open or increase a leveraged position; builds at /v1/actions/loop/leverage. loop-close — unwind one; /v1/actions/loop/close. collateral-swap / debt-swap — replace one side of an open position in place; /v1/actions/loop/collateral-swap and /v1/actions/loop/debt-swap. Each carries route (how it executes) and, where applicable, marketGate.

Possible values: [refinance, set-mode, loop-open, loop-close, collateral-swap, debt-swap]

parameterstring

Which parameter the action changes — on refinance and set-mode only; absent on the loop actions, which change the position's size or assets rather than a knob. rate (the Liquity family's interest-rate adjust) is the same verb on a third knob and appears here when built.

Possible values: [term, mode]

scopestring

What the change applies to. position — acts on ONE loan, which the caller must identify. account — one value for the whole (lender, chain, account); it is declared on every row of that lender because it is true of all of them, so a consumer showing one account-level control per lender should read it off any row rather than per market.

Possible values: [position, account]

endpointstring

The endpoint that builds this action.

Example: /v1/actions/loop/refinance
requiresstring[]

Params required BEYOND the universal set (marketUid, operator, amount). For refinance: termId (the TARGET term) — fromLoanId is optional by design, omitted means the float/dynamic position. For set-mode: lender, chainId and mode, since it is account-scoped and takes no market.

Example: ["termId"]
domainFieldstring

Which field on this row holds the allowed values for requires — never a second copy of it. terms is the published rate card; config is the risk-config map, whose KEYS are the mode ids and whose label is each mode's name.

Possible values: [terms, config]

routestring

Loop actions only: HOW the action executes. composer — one 1delta Composer flash-loan bundle. bundler3 — Morpho's Bundler3 (Blue via Morpho's adapters, Midnight via Tenor's), composer as fallback where offered. native — the protocol's OWN leverage periphery, EOA-direct (Curve's zaps, Curvance Position Managers, Fraxlend / Resupply leveragedPosition, Twyne operators, Flying Tulip's RFQ engine, the Term diamond). two-step — two ordered transactions (Exactly: same-asset DebtManager.leverage, then a collateral swap; read steps[] on the response). A client that renders one button need not care; one that explains what it is about to sign should.

Possible values: [composer, bundler3, native, two-step]

marketGatestring

Loop actions only: a PER-MARKET descriptor field that must ALSO be true for this row, because the lender registers leverage market by market — llamalend.supportsLeverage (only v1 markets are indexed by Curve's zaps), fraxlend.leverageEnabled (the pair's governance swapper allowlist), curvance.positionManagers (5 of 25 markets have none). The capability is the lender's answer; the gate is the market's, read off the market row's descriptor of that name. Absent when the lender-level answer is the whole answer.

Example: llamalend.supportsLeverage
MarketCapability
{
"action": "refinance",
"parameter": "term",
"scope": "position",
"endpoint": "/v1/actions/loop/refinance",
"requires": [
"termId"
],
"domainField": "terms",
"route": "composer",
"marketGate": "llamalend.supportsLeverage"
}