Skip to main content
POST
Builds the transaction that grants or revokes one of seven roles across the market’s three contracts: the market itself, its liquidation router and its price oracle. The endpoint never submits it. The wallet that administers the role signs, and the same POST with txHash verifies the mined transaction.
The market and router contracts refuse an admin that revokes or renounces its own DEFAULT_ADMIN_ROLE, with SelfRemovalDisabled, and this endpoint refuses the build with SELF_REMOVAL_DISABLED when signerAddress names the address being revoked. A handover is therefore grant, then revoke by the successor. Admin Handover returns the steps in that order. The guard covers the caller’s own address only: an admin can still revoke another admin, so a market with two admins can be left with one.

Roles

An authorized price signer can move the price every loan in the market is valued at, within the oracle’s deviation bound. The oracle owner can sign prices without a grant, so revoking ORACLE_SIGNER from the owner is refused with ORACLE_OWNER_SIGNS; transferring oracle ownership is the only way to remove that authority. On an ORACLE-priced market the oracle reads an external feed and refuses every attested price, so a signer grant changes nothing there. A guardian holds emergency brakes, not a management role: nothing in the configuration, the other roles or the upgrades is reachable from it. The oracle reads the role off the market, so a revoke here ends the guardian’s standing on the oracle in the same transaction. Get Guardians lists the holders, Halt Prices builds the halt, and Guardian and brakes says what each brake stops. A guardian can halt again a day after its last halt ended, so revoke one that halts without cause.
When the address is already in the requested state, the response returns unchanged: true and no calldata. For ORACLE_SIGNER, the oracle owner counts as already granted. A role the chain read cannot answer counts as a change, so the calldata comes back.

Path Parameters

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

Body Parameters

string
required
One of MARKET_ADMIN, MARKET_ISSUER, MARKET_LIQUIDATOR, MARKET_GUARDIAN, ROUTER_ADMIN, ROUTER_OPERATOR or ORACLE_SIGNER.
string
required
Address to grant or revoke. Must be a 0x-prefixed 40-character hex address other than the zero address.
string
required
grant or revoke.
string
The wallet that will sign, as a 0x-prefixed 40-character hex address. On a revoke of MARKET_ADMIN or ROUTER_ADMIN it is compared with address: when the two match, the build is refused with SELF_REMOVAL_DISABLED instead of handing back calldata that reverts. Omit it and the admin wallet of your instance that would sign is compared instead: a wallet other than the one revoked is preferred, and when the only admin wallet of your instance is the one revoked, the same refusal applies. On a revoke of ORACLE_SIGNER, a signerAddress the oracle recognizes as the market’s guardian is named as requiredSigner, with the oracle owner as alternativeSigner. Not used when confirming with txHash.
string
Hash of the mined transaction, as a 0x-prefixed 64-character hex string. Send it with the same role, address and action to verify the change. Omit it to receive the calldata.

Response Fields

object
The confirm call reads the receipt and checks the function, the contract, the role and the address against the request. It records nothing.

Error Codes

Confirming with txHash can also return any transaction verification error. On this endpoint every one of them answers 400, including TX_NOT_FOUND.