Skip to main content
POST
Deploys a complete market in one factory transaction: the lending module, its price oracle, interest rate model, insurance fund, collateral adapter, and a liquidation router dedicated to this market. The same transaction attests the market’s asset data. The hash of a canonical bundle built from the token’s profile travels inside the deployment, signed for by the deploying wallet. The market is deployed seeking a lender of record. It names no admin, no issuer and no collateral agent. The deployment nominates candidates, or sets openToAnyCurator to offer the market beyond them. The market stays inert until an institution takes the role through Accept Lender Role. See Lender of record. Sign with the wallet named in signer, this instance’s registered wallet. The factory records the sending wallet as the market’s deployer and as the attestor of its asset data. Only that wallet or the factory owner can nominate candidates later. The deployment sets the opening rate offering and term offering. After adoption, the issuer the lender of record names can change both. A new rate mode reaches open variable-rate loans from their next accrual, while a stamped fixed rate stays with the loan it was stamped on. A new term offering reaches new loans only. See Set Rate Mode and Set Term Config, and read the ranges and the factory’s own limits first with Get Deployment Options. A collateral token can back several markets as long as they differ in collateral mode or in settlement token (stablecoin). A second market for the same token, mode and settlement asset returns 409 MARKET_EXISTS.
A freshly deployed market cannot take loans or liquidity. Two things are outstanding. A candidate must take the lender-of-record role, and the collateral token’s agent or identity registry operator must authorize the market’s adapter and router on the token. That party is typically neither Trusset nor the deployer. Call Get Setup Steps after deployment for the outstanding items and their calldata.

Body Parameters

string
required
Security token accepted as collateral. Must be imported into this instance with a published profile, and must not be the same token as the borrow asset. On the confirm call it is an optional cross-check.CUSTODY mode needs only an ERC-20 surface (balanceOf and decimals), so ERC-20, ERC-1400 and ERC-3643 tokens all qualify. FREEZE mode also needs the ERC-3643 freeze surface (isAgent or getFrozenTokens). See Collateral token standards.A token whose ERC-1400 granularity() is above one base unit is refused in either mode with COLLATERAL_GRANULARITY_UNSUPPORTED. The market seizes the exact amount a liquidation or a term realization needs, which is almost never a whole multiple of the granularity, so the token would refuse the seizure.
string
Opening collateral price as a decimal string, for example "104.82". Must be greater than zero, with at most 18 decimal places. It is denominated in the borrow asset and parsed at its decimals. A market settling in USDC therefore accepts at most 6 decimal places here.Required for the NAV, MARKET and FIXED price sources. An ORACLE market takes its first price from the feed and ignores this field. On a FIXED market it is the price of one whole collateral token for the life of the market. See Fixed price.
array
default:"[]"
Addresses nominated to become the market’s lender of record. Up to 20 entries, each a checksum-valid address that is not the zero address. Duplicates are dropped. Nominating stays possible after deployment through Nominate Candidate. An empty list is a market nobody can take yet, not a market nobody can ever take.
boolean
default:"false"
Offer the market to claimants beyond the named candidates. The factory admits a claimant nobody nominated when the borrower register the deployer installed verifies it. Through this API the claimant must also be an account Trusset approved as a lender of record. The claim takes two transactions, announced and then completed after a delay. See Accept Lender Role.An open NAV or ORACLE market deployed with no identityRegistry is narrowed rather than refused. With no borrower register to admit them, claimants nobody nominated are refused, so only a nominee can take the market. An open MARKET market must install one.
string
default:"FREEZE"
FREEZE or CUSTODY. See Collateral modes. Cannot be changed after deployment.
string
default:"NAV"
NAV, MARKET, ORACLE or FIXED. Cannot be changed after deployment.NAV is a price the issuer publishes. MARKET signals an observable market price: the contract then refuses Dutch auctions and holds the auction floor premium at 98 percent or more. ORACLE reads the external feed named in oracleAddress and takes no pushed price at all. FIXED holds initialPrice for the life of the market, never goes stale, and can only be marked down. It is offered only when Get Deployment Options lists it in priceSources.options.A MARKET market lends to professional borrowers only, so it needs a borrower register. See Borrower register on a MARKET market.
boolean
default:"false"
FIXED only. true deploys an initialPrice that differs from the instrument’s nominal times its redemption percent, which is otherwise refused with FIXED_PRICE_NOMINAL_MISMATCH. See Fixed price.
string
The external feed an ORACLE market reads prices from. Required when priceSource is ORACLE, and refused for every other price source. The feed is probed before any calldata is handed out. It must answer decimals(), plus latestRoundData() or the latestAnswer() and latestTimestamp() pair. Its price must be positive and dated within the last 24 hours.
string
Settlement token (stablecoin) for the market. Any ERC-20 with 6 to 18 decimals, validated on-chain. Omit to use the network’s USDC. Cannot be changed after deployment. See List Borrow Assets.
string
The borrower register, installed on the market by this transaction. Borrowers are examined against it on every loan. It must answer isVerified(address), as an ERC-3643 identity registry, an ONCHAINID-based register and the Trusset register all do.Optional for NAV and ORACLE. For MARKET, see Borrower register on a MARKET market. Omitted, the collateral token’s own compliance alone governs who may borrow. A register installed here stands at adoption: the lender of record cannot bring a different one. The market admin can change it afterwards with Set Identity Gates.The previous Trusset ID Register, 0xE9114c40934f6fB6BB317935156b731f7A86D006, takes no new identities and is refused with IDENTITY_REGISTRY_RETIRED. Name the current one, 0xEf244c4Bd4d71Bd9A30EDF6Edef7CCC72642291a. See The Previous Trusset ID Register.
string
A verification profile key of this instance, 1 to 60 letters, digits, - or _. The deployment installs that profile’s eligibility register as the borrower register, exactly as if its address were sent in identityRegistry. Sending both is accepted only when they name the same register, otherwise GATE_PROFILE_CONFLICT. A profile without an eligibility register is refused with ELIGIBILITY_REGISTER_NOT_SET.
string
The register the deployer proposes for liquidity providers. It is recorded on the factory and installed by nothing: which provider register the market uses is the lender of record’s decision at adoption. It must answer isVerified(address), exactly like identityRegistry, and the previous Trusset ID Register is refused here too.
string
A verification profile key whose eligibility register is proposed as providerRegistry. The same rules as identityRegistryProfile apply.
string
The ID of a whitelist of this instance, 1 to 64 letters, digits, - or _, installed as the borrower register instead of an address. Not accepted beside identityRegistryProfile, and refused on a MARKET market. See Whitelists as gates.
string
The ID of a whitelist of this instance, proposed as providerRegistry. Not accepted beside providerRegistryProfile.
boolean
true confirms that the whitelist proposed as providerRegistry lists identified wallets only. Required whenever providerRegistry is a whitelist, whether named by ID or by address.
integer
default:"0"
Decimals to assume if the collateral token’s decimals() cannot be read on-chain. Integer between 0 and 36.
string
Hash of the transaction you broadcast for this operation. Send it to confirm the transaction and record the result. Omit it to receive the calldata.

Borrower register on a MARKET market

A MARKET market carries the free-hand realization path, which is open against professional borrowers only. Its borrower register must therefore qualify as a professional gate: every verification profile that admits wallets to it, on any instance of the market’s network and environment, is limited to professional clients and in the REGISTER mode, and there is at least one. The register deployed for the lender of record’s own PROFESSIONAL profile qualifies, as long as no other profile admits wallets to it. Until the register qualifies, the API opens no loan and adds no liquidity on the market. See Professional borrowers. A MARKET deployment that nominates candidates and leaves openToAnyCurator off may omit identityRegistry. The nominee then brings its professional register with its adoption terms, and Accept Lender Role checks it. Any other MARKET deployment must install a register, or it is refused with IDENTITY_REGISTRY_REQUIRED. A register installed here stands at adoption, so the deployment checks it first: a MARKET deployment whose identityRegistry does not qualify is refused with 409 PROFESSIONAL_BORROWER_GATE_REQUIRED, and nothing is built. The collateral token’s own register never qualifies, because it proves identity, not professional status. When the profiles behind the register cannot be read, the deployment answers 503 STATE_UNAVAILABLE instead of a verdict. Nominating the lender of record and letting it bring the register avoids the question.

Fixed price

A FIXED market prices its collateral at initialPrice, per whole collateral token in the settlement token, for its whole life. The price never goes stale, the oracle refuses every signed price, and the price authority can only mark it down through Sync Oracle Price, within the deviation bound. No price update can raise it again, so a price set too low stays. Whoever owns the oracle could still replace its implementation through an upgrade, so the lender of record keeps the oracle owner in its own control. A fixed price is neither a stock-exchange nor a market price, so the free-hand exchange sale is not available as the market’s realization path, and neither is the atomic sale. The deployment checks the price before building anything:
  • The factory must create oracles that can hold a fixed price, or the request is refused with 409 FIXED_PRICE_UNSUPPORTED. 503 FACTORY_READ_FAILED when that cannot be read.
  • The token’s instrument record must name its currency, and the settlement token’s currency must be known to Trusset, or the request is refused with 422 FIXED_PRICE_CURRENCY_UNKNOWN. details.missing is TOKEN or SETTLEMENT. A fixed price converts nothing, so both currencies must be the same, or the request is refused with 422 FIXED_PRICE_CURRENCY_MISMATCH.
  • initialPrice is compared with the instrument’s nominal per unit times its redemption percent over 100, assuming one whole token is one unit of the instrument. A price that differs is refused with 409 FIXED_PRICE_NOMINAL_MISMATCH, and details carries initialPrice, expectedPrice, nominal, redemptionPct and currency. Send acknowledgeFixedPriceMismatch: true to deploy it anyway. A record without a nominal is not compared, and warnings says so.
The bundle the deployment attests commits to the exact fixed price, so the lender of record acknowledges the value itself when it takes the role. Preview Asset Data runs the same checks with priceSource=FIXED.

Whitelists as gates

identityRegistryAccessList and providerRegistryAccessList name one of this instance’s whitelists by ID instead of a register address. The rules are those of Set Identity Gates:
  • A whitelist cannot be the borrower register of a MARKET market: 409 ACCESS_LIST_NOT_ALLOWED.
  • A whitelist kept for depositors cannot be the borrower register, and one kept for borrowers cannot be the provider register: 409 ACCESS_LIST_PURPOSE_MISMATCH.
  • A whitelist proposed as providerRegistry must be kept by this instance, or owned or managed by one of its verified wallets: otherwise 403 ACCESS_LIST_NOT_CONTROLLED. It also needs attestIdentifiedMembers: true: otherwise 400 ACCESS_LIST_ATTESTATION_REQUIRED.
  • A whitelist ID that names no active whitelist of this instance answers 404 ACCESS_LIST_NOT_FOUND, and a profile key beside it 400 GATE_SOURCE_CONFLICT.

Rate offering

The market’s interest model is deployed with the market, and the rate offering sets how it prices from the first loan. All values are basis points.
string
default:"CURVE"
CURVE, CLAMPED or FIXED.CURVE is the default utilization curve and takes no bounds. CLAMPED is that curve held between a floor and a cap. FIXED stamps one rate onto each loan when it opens, and that rate does not move for the life of the loan.
integer
Lower bound for CLAMPED. Integer, 0 to 50000. Defaults to 0 under CLAMPED.
integer
Upper bound for CLAMPED, and required by it. Integer, 1 to 50000, and at least rateFloorBps. A binding cap never suspends borrowing: the rate saturates at the cap.
integer
The stamped rate for FIXED, and required by it. Integer, 1 to 50000.
The three modes do not mix. Sending rateFloorBps or rateCapBps with FIXED, or fixedRateBps with CLAMPED, is refused rather than silently ignored. Sending any bound without a rateMode of CLAMPED or FIXED is refused too. A FIXED market also needs maxLoanDurationDays, because the term clock replaces the rate curve as the pull toward repayment. The factory also bounds creator-set rates with its creatorRateCeiling, read at build time. Get Deployment Options returns it as creatorRateCeilingBps.

Term offering

A market with no term offering makes open-ended loans. Setting a duration, a terminal date, or both turns terms on, and Open Loan then returns the due date in its offering block before the borrower signs.
integer
How long a loan may run before it falls due. Integer number of days, 1 to 3650.
integer | string
A hard date every loan on this market falls due by, whatever its own duration. A unix timestamp in seconds, or an ISO date. Must be in the future.
integer
Days after the due date before the term penalty applies. Integer, 1 to 30. Omitted on a market with terms, the contract applies its 3-day default. Sending it without maxLoanDurationDays or terminalDueDate is refused.

Fee shares

Every market pays its operator a fixed 8 percent and its distributors a fixed 5 percent of repaid interest, both taken after the 15 percent Trusset infrastructure fee. The factory holds both as constants and no party can change them. A deployment therefore carries no share offer, and a request that sends operatorShareBps is refused with OPERATOR_SHARE_FIXED. The operator share is paid to the wallet that takes the lender-of-record role. The calldata response echoes both shares under feeShares.

Asset data

The deployment builds the market’s asset data bundle from the token as this instance imported it. The bundle holds the chain, factory, collateral mode, price source and settlement asset, the token’s recorded facts, the issuer’s published profile, and the token’s instrument record. See What the bundle contains. The bundle’s contentHash rides inside deployMarket, so the signature that creates the market also attests the data. A token without a published profile is refused with TOKEN_PROFILE_REQUIRED. The calldata response returns the exact bytes being attested under assetData, so the deploying wallet sees what it signs for. Preview Asset Data returns the same bundle before anything is built. A lender of record reviews it and names the hash it read when it takes the role.

Response Fields

Without txHash, the response is the unsigned factory transaction.
object
Confirm by sending txHash. Every other field is an optional cross-check against the deployment the receipt proves: a supplied collateralTokenAddress, mode or borrowAssetAddress that differs returns TX_WRONG_ARGS. Drop any confirmWith.body field that is null before sending it, because this endpoint’s schema refuses null for an address. Confirming returns 201 with the recorded market and its readiness state.
object
A recorded market blocks a redeployment only while the configured factory still holds its deployment. A record the factory does not know belongs to a superseded factory generation, so the calldata response reports it under supersedes instead of refusing.

Error Codes

Confirming with txHash can also return: A supplied borrowAssetAddress is validated on the confirm call too, so the four borrow asset codes above can also appear there. Confirming can also return any transaction verification error.