Skip to main content
POST
Builds the unsigned transactions that move one of the market’s proxies onto the implementation the factory serves, then confirms each once mined. target picks the proxy: the market itself, its interest rate model, its liquidation router, its price oracle or its insurance fund. action picks the step. An upgrade is announced with propose, may be withdrawn with cancel, and runs with execute no earlier than 7 days after the announcement. Each proxy has its own authority, and the response names who must sign. The target implementation is always read from the factory and cannot be named in the request. A factory implementation that lacks a feature the proxy already runs is refused, so an upgrade never moves a proxy backwards. An address that is not a market of the lending factory this instance deploys to is refused with MARKET_NOT_IN_FACTORY. Get Upgrade Status shows what each upgrade would change before you build it.

Path Parameters

string
required
The market’s record ID, as id on List Markets, not its contract address. See Market IDs.

Body Parameters

string
default:"market"
The proxy to upgrade: market, rateModel, router, insuranceFund or oracle.
string
default:"execute"
propose, cancel or execute. execute is accepted only for an implementation announced with propose at least 7 days earlier. See Announce, then execute.
string
Hash of the mined transaction. Send it with the same target and action to confirm it. Omit it to receive the calldata.

Who Signs

Every target is refused with MARKET_PENDING_CURATOR while the market has no lender of record. The oracle, the model and the fund pass to the owners the lender of record named only when each nominee accepts ownership. Get Handover returns those acceptance transactions. The rate model is the one proxy whose code and whose parameters answer to different parties. The market admin announces and executes its upgrades. Its owner keeps the curve parameters, the rate mode and the fixed-rate ceiling, and cannot announce or execute an upgrade of the model’s code.

Announce, then execute

The three actions build the following, and the notice runs 7 days from the announcement. A later propose replaces an earlier one and restarts the week. Get Upgrade Status reports each proxy’s notice, with ready and secondsUntilReady, so an integration can schedule the execution.

Calldata Response

object

Confirmed Response

On execute, the confirm call verifies that the transaction targeted the proxy for target, called upgradeToAndCall or upgradeTo, and emitted Upgraded on that proxy. It then reads the new implementation from the receipt. On propose and cancel it verifies that the transaction targeted the proxy, called proposeUpgrade or cancelUpgradeProposal, and emitted UpgradeProposed or UpgradeProposalCancelled on it. The audit log records LENDING_MARKET_UPGRADE_PROPOSED, LENDING_MARKET_UPGRADE_PROPOSAL_CANCELLED or LENDING_MARKET_UPGRADED.
object

Error Codes

Confirming with txHash can also return any transaction verification error.