Markets
Deploy Market
Deploy a lending market for an imported security token
POST
Deploys a complete market in one factory transaction: the lending market, its price oracle, interest rate model, insurance fund, collateral adapter, and a liquidation router dedicated to this market with the market pre-authorized on it.
The market is deployed seeking a lender of record. It names no admin, no issuer and no collateral agent at deployment. You nominate
The three modes do not mix. Sending
Confirming with
candidates, or set openToAnyCurator to offer it to every approved institution, and the market stays inert until one of them takes the role. See Lender of record.
The deployment also fixes how the market prices interest and whether its loans carry a maturity. Both are set here and both change what a borrower is quoted, so decide them before the market goes out to candidates.
A collateral token can back several markets as long as they differ in collateral mode or in settlement asset. Deploying a second market for the same token, mode and borrow asset returns 409 MARKET_EXISTS.
Body Parameters
string
required
Security token accepted as collateral. Must already be imported into your instance, and must not be the same token as the borrow asset.ERC-20, ERC-1400 and ERC-3643 are all accepted in
CUSTODY mode, which holds collateral through the ERC-20 interface alone. FREEZE mode also needs the ERC-3643 agent surface.In either mode the token has to expose a surface the adapter can be authorized on, or the deployment is refused with NOT_A_SECURITY_TOKEN. See Collateral token standards.string
Opening collateral price as a decimal string, for example
"104.82". Must be greater than zero. Denominated in the borrow asset and parsed at its decimals, so a market settling in USDC accepts at most 6 decimal places here.Required for the NAV and MARKET price sources. An ORACLE market takes its first price from the feed, which the factory probes inside the deployment, so no opening price is stated there.array
default:"[]"
Addresses nominated to become the market’s lender of record. Up to 20 entries, none of them the zero address. Nominating is available at any time after deployment, so an empty list is a market nobody can take yet rather than a market nobody can ever take.
boolean
default:"false"
Offer the market to every institution Trusset has approved as a lender of record, not only to the named candidates.An open market deployed with no
identityRegistry is narrowed rather than refused. On an open market the registry is the one thing standing between the market and any caller. The factory therefore refuses a gate installed by a claimant nobody nominated, and what the deployment produces is a market only a nominee can take.string
default:"FREEZE"
FREEZE or CUSTODY. See Collateral Modes. Cannot be changed after deployment.string
default:"NAV"
NAV, MARKET or ORACLE. Cannot be changed after deployment.NAV is a price the issuer publishes. MARKET signals an observable market price: the contract responds by disallowing Dutch auctions and raising the auction floor premium. ORACLE reads an external feed named in oracleAddress and takes no pushed price at all.string
The external feed an
ORACLE market reads prices from. Required when priceSource is ORACLE, and rejected for every other price source. The feed is probed before any calldata is handed out.string
Settlement token (stablecoin) for the market. Any ERC-20 with 6 to 18 decimals, validated on-chain at deploy time. Omit to use USDC. Cannot be changed after deployment.
string
ERC-3643 identity registry for the collateral token, available on the imported token’s metadata. Optional at deployment for every price source, because most markets run their register off-chain. Defaults to the zero address, which leaves compliance checks unresolvable and reports authorization status as unknown.Adoption still refuses to complete without a gate installed, so no live market ever lends without a borrower perimeter.
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.
Rate offering
The market’s interest model is deployed with the market, and how it prices is fixed here. All four 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.integer
Upper bound for
CLAMPED, and required by it. Integer, 1 to 50000.integer
The stamped rate for
FIXED, and required by it. Integer, 1 to 50000.Share of post-infrastructure interest offered to whichever institution takes the lender-of-record role. Integer, 0 to 5000. The ceiling is half, so the liquidity providers always keep the larger part.
rateFloorBps or rateCapBps with FIXED, or fixedRateBps with CLAMPED, is refused rather than silently ignored, and sending any bound without a rateMode is refused too. A FIXED market also needs a term, because the term clock replaces the rate curve as the pull toward repayment: without maxLoanDurationDays the deployment is refused.
Rates are also bounded by the factory’s own creator ceiling, read at build time.
Term offering
A market with no term offering makes open-ended loans. Setting either a duration or a terminal date turns terms on, and Open Loan then returns the due date in itsoffering 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. It needs a term to attach to, so sending it without
maxLoanDurationDays or terminalDueDate is refused.Response Fields
WithouttxHash, the response is the unsigned factory transaction.
object
txHash returns 201 with the recorded market and its readiness state.
object
The uniqueness check is skipped when the existing market came from an earlier factory generation. A market that predates the lender-of-record model does not block a redeployment onto the current factory.
Error Codes
Confirming with
txHash can also return:
Confirming can also return any transaction verification error.
