Skip to main content
POST
Returns the transaction that takes a market’s lender-of-record role. The adopting institution names every party on the market, declares how seized collateral is realized, and approves the asset data version it reviewed. The factory does all of it in one transaction, signed by one of this instance’s verified wallets, and either every part lands or none does. See Lender of record.
Adoption is final: no path returns the market to seeking a lender of record. Every address in the terms receives its role in the same transaction. Check each one before signing. The saleRecipient is the fixed destination for seized collateral, and rotating it is not available through this API. Even the router admin can only rotate it through an announced, one-hour-delayed flow that is refused while any realization is in flight.
Three conditions must hold before anything is built:
  • Trusset approved this account to act as a lender of record. Otherwise 403 CURATOR_NOT_APPROVED.
  • One of this instance’s verified wallets is nominated on the market, or the market is open to claimants beyond its candidates. A claim on an open market takes two calls, see Claim an open market.
  • The market still seeks a lender of record.
Every condition the factory enforces on adoption is checked first, so a refusal here replaces a reverted transaction. Review the market with Get Queued Market before building. After the transaction mines, record it with Confirm Lender Role. Sign with the wallet in signer. It becomes the market’s operator wallet: it receives the fixed operator share of repaid interest and is one of the two kinds of depositor the market accepts directly. Rotate Operator Wallet changes it later.

Path Parameters

string
required
Market contract address, 0x followed by 40 hex characters. It must be a market of the v2 lending factory.

Body Parameters

Parties

Seven parties are required. Each is a checksum-valid address that is not the zero address. One wallet may hold several of them.
string
required
Receives DEFAULT_ADMIN_ROLE on the market and on its liquidation router, and owns the insurance fund.
string
required
Receives ISSUER_ROLE on the market and owns the interest rate model, so it governs the rate and term offering from here on. It also becomes the wallet that attests the market’s asset data.
string
required
Recorded as the pledgee on every collateral lock the market’s adapter makes. It carries no capability on the market, the adapter or the router.
string
required
Where seized collateral goes when it is withdrawn for sale. The collateral token must permit the delivery from the market’s router to this address, or the call is refused with SALE_RECIPIENT_NOT_ELIGIBLE.
string
required
Receives OPERATOR_ROLE on the market’s liquidation router, which drives settlement. Naming a wallet this instance holds lets settlement run through this API.
string
required
Owns the market’s price oracle.
string
required
Authorized as the oracle’s price signer. It is the only one: a market seeking a lender of record has no signer at all.

Realization and commitment

string
required
How seized collateral is turned into money on default: EXCHANGE_SALE, ISSUER_REDEMPTION or AUCTION.The price source limits the choice. EXCHANGE_SALE is available only on a MARKET-priced market, and AUCTION is refused there because such a market cannot run Dutch auctions. A FIXED market therefore takes ISSUER_REDEMPTION or AUCTION. The declaration puts the path on the record before any loan exists. Beyond these checks at adoption, no contract logic branches on it. The API offers the atomic sale only where EXCHANGE_SALE is declared, see Get Atomic Sale.
string
default:"0"
Liquidity the lender of record declares for the market, as a decimal amount of the borrow asset. Parsed at the borrow asset’s decimals. The factory records it and emits it with the adoption. Nothing in the contracts enforces it.
integer
Ceiling on any fixed borrower rate the rate model owner can set later, in basis points. Integer, 1 to 50000. Once recorded it can only move down. Omit it to record no ceiling.On a FIXED market the ceiling must not be below the rate new loans are stamped with, or the adoption reverts on-chain. The API does not check this before building.

Registers and provisioning

string
Borrower register for a market that has none. Only a nominated wallet may bring one. It is ignored when the deployer already installed a register, which stands. A MARKET-priced market must end up with one, and it must qualify as a professional gate, see Professional borrowers.It must answer isVerified(address), as an ERC-3643 identity registry, an ONCHAINID-based register and the Trusset register all do. Omit it, or send the zero address, to adopt without one where the price source allows.The previous Trusset ID Register, 0xE9114c40934f6fB6BB317935156b731f7A86D006, takes no new identities and is refused with IDENTITY_REGISTRY_RETIRED, here and in providerRegistry. Name the current one, 0xEf244c4Bd4d71Bd9A30EDF6Edef7CCC72642291a. A borrower register the deployer installed is not refused when it is the previous one: the adoption goes through, installedRegister carries retired: true, and the market admin moves the gate afterwards. See The Previous Trusset ID Register.
string
A verification profile key of your instance, 1 to 60 letters, digits, - or _. Its eligibility register is used as identityRegistry. Sent with identityRegistry, both must name the same register, otherwise GATE_PROFILE_CONFLICT.
string
The register every vault on the market examines its depositors against. Installed when the market carries none. The deployer’s proposedProviderRegistry is a suggestion only: this field decides.
string
A verification profile key whose eligibility register is used as providerRegistry, with the same rules as identityRegistryProfile.
string
The ID of a whitelist of your instance, 1 to 64 letters, digits, - or _, used as identityRegistry. Not accepted beside identityRegistryProfile, and refused on a MARKET-priced market. See Whitelists as Gates.
string
The ID of a whitelist of your instance, used as providerRegistry. Not accepted beside providerRegistryProfile.
boolean
true confirms that the whitelist named as providerRegistry lists identified wallets only. Required whenever providerRegistry is a whitelist, whether named by ID or by address. confirmWith.body carries it to Confirm Lender Role, which writes it to the audit record of the adoption.
string
Wallet granted LIQUIDATOR_ROLE on the market in the same transaction. It can trigger a seizure and configure nothing. Omitted or zero on a TWO_REGISTERS market, the API names the signing wallet.
string
One of this instance’s own vaults, registered on the market as a just-in-time liquidity source with vault liquidity switched on. The vault must settle in the market’s borrow asset and be operated by the signing wallet. The vault’s own draw cap remains the one step left, signed by the vault operator.The vault’s investors must meet the market’s provider gate, under the rules of Register Vault. A vault with its own register needs providerRegistry to be that register or none (PROVIDER_GATE_MISMATCH). A vault without one needs a providerRegistry, since nothing else would examine its depositors (DEPOSITOR_GATE_REQUIRED). It must be the register the vault adopted from the first market it funded, or, before it adopted one, the provider register of every market it funds (PROVIDER_GATE_MISMATCH).
A whitelist is checked as on Set Identity Gates: never the borrower register of a MARKET market (ACCESS_LIST_NOT_ALLOWED), never a register on the earlier single-register implementation (ACCESS_LIST_NOT_ALLOWED), kept for the right side (ACCESS_LIST_PURPOSE_MISMATCH), and as provider register only when your instance keeps it or one of its wallets owns or manages it (ACCESS_LIST_NOT_CONTROLLED) and with attestIdentifiedMembers: true (ACCESS_LIST_ATTESTATION_REQUIRED). Once the role is taken, Confirm Lender Role offers the step that makes the lender of record a manager of each whitelist gate. providerRegistry, liquidator and vault need the current market implementation. A market on the earlier implementation, reported as SINGLE_REGISTER by Get Queued Market, refuses them with MARKET_UPGRADE_REQUIRED. It also needs a borrower register whatever its price source.

Asset data and open-market claims

string
The hash of the asset data version you reviewed, 0x followed by 64 hex characters. It must equal the issuer’s standing attestation, assetData.attested on Get Queued Market. The adoption then records the approval of exactly that version.
boolean
Send false to adopt without acknowledging any version. It takes effect only when assetDataHash is omitted.
string
Salt for an open-market claim, 0x followed by 64 hex characters. Omit it on the first call and the API generates one. Send the returned value, with identical terms, on the second call. A nominee does not need it.

Professional borrowers

A MARKET-priced market lends to professional borrowers only. Its borrower register must qualify as a professional gate: at least one verification profile admits wallets to it, and every profile that does, on any instance of the market’s network and environment, is limited to professional clients and in the REGISTER mode. The register deployed for your PROFESSIONAL profile, named with identityRegistryProfile: "PROFESSIONAL", is the simplest path. See Professional borrowers. How that is enforced depends on who installs the register:
  • You bring it, on a market the deployer left without one: a register that does not qualify is refused with 422 PROFESSIONAL_BORROWER_GATE_REQUIRED, details.field: "identityRegistry".
  • The deployer installed it: it stands, and the adoption is not refused. When it does not qualify, the response carries the warning BORROWER_GATE_NOT_PROFESSIONAL and requiredFollowUp: { action: "SET_IDENTITY_GATES", reason: "BORROWER_GATE_NOT_PROFESSIONAL" }. Right after taking the role, replace the register through Set Identity Gates. Until then the API opens no loan and adds no liquidity on the market.
When the profiles behind the register cannot be read, the call answers 503 STATE_UNAVAILABLE and builds nothing.

Fixed price markets

A FIXED market prices its collateral at the price fixed at deployment for its whole life, and the adoption underwrites that value. The response carries it in fixedPrice and warns with FIXED_PRICE_MARK_DOWN_ONLY: after adoption the oracle owner and the price signer you name can only lower the price, within the deviation bound, and the oracle owner also holds the oracle’s upgrade authority. Name an oracle owner your institution controls itself, never the issuer or a borrower. When the asset data version you acknowledge states a different fixed price than the oracle holds, the response warns with FIXED_PRICE_NOT_AS_ATTESTED. The market lends against the oracle value. When the fixed price cannot be read, the call answers 503 ORACLE_STATE_UNREADABLE and builds nothing.

Approve the asset data

A market that carries an issuer attestation cannot be adopted silently. Without assetDataHash, the call is refused with 422 ASSET_DATA_ACKNOWLEDGEMENT_REQUIRED, and error.details names the standing hash and version. Read the bundle with Get Asset Data Bundle, then send the hash you read. Send acknowledgeAssetData: false instead only if the adoption should approve no version. A hash other than the standing attestation is refused with 409 ASSET_DATA_STALE, with details.reviewed, details.standing and details.standingVersion. The issuer can still re-attest after the transaction is built. The factory then refuses the whole adoption on-chain, so a stale approval can never pass.

Claim an open market

When no wallet of this instance is nominated and the market is open, the first call returns a commitCuratorClaim transaction instead of the adoption. It announces a hash of the exact adoption call, so the terms stay private and transaction ordering cannot decide who takes the market. Only the wallet in signer can complete the claim.
1

Announce

Broadcast the returned commitCuratorClaim transaction. Keep claimSalt.
2

Wait

Wait claimDelaySeconds (10 minutes) from the announcement. Calling earlier returns 409 CLAIM_PENDING with the moment it becomes actionable.
3

Complete

Call this endpoint again with identical terms and the same claimSalt. It returns the acceptCuratorRole transaction. Broadcast it with signer, then confirm it.
The announcement lapses after claimWindowSeconds (72 hours) and its hash stays consumed. A later call returns 409 CLAIM_EXPIRED. Start again without claimSalt to receive a fresh one. Any change to the terms changes the announced hash, including a newly attested asset data version. The API then answers with a new commitCuratorClaim for the new terms, and the wait starts again. An open-market claimant is admitted by the borrower register the deployer installed. The API picks the first of this instance’s wallets, up to five, that the register verifies. None verified is 403 CANDIDATE_NOT_VERIFIED. A market with no borrower register cannot be claimed without a nomination (403 NOMINATION_REQUIRED), and a claimant cannot bring its own register.

Response Fields

The adoption transaction:
object
The claim announcement, on the first call of an open-market claim:
object

Error Codes

A malformed body is refused by its first offending field. The four INVALID_ codes below carry error.details naming that field.