Skip to main content
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. A collateral token can back one FREEZE market and one CUSTODY market at the same time. Deploying a second market for the same token and mode returns 409 MARKET_EXISTS.
A freshly deployed market cannot accept loans. Token-side authorizations must be completed by the collateral token’s agent or identity registry operator, who is typically not Trusset and not you. Call Get Setup Steps immediately after deployment for the outstanding items and their calldata.

Body Parameters

string
required
ERC-3643 security token accepted as collateral. Must be a token imported into your instance.
string
required
Wallet receiving ISSUER_ROLE on the market. Must not be the zero address.
string
required
Wallet receiving DEFAULT_ADMIN_ROLE on the market and on the market’s liquidation router. Must not be the zero address.
string
required
Opening collateral price as a decimal string with up to 18 decimal places, for example "104.82". Must be greater than zero. Denominated in the borrow asset and parsed at its decimals.
string
required
Named pledgee recorded on the market and on every adapter lock. This address carries no capabilities. It exists so the pledge is documented on-chain against a specific legal counterparty. Must not be the zero address.
string
required
Wallet receiving OPERATOR_ROLE on the market’s liquidation router. This is the address permitted to withdraw seized collateral for sale and settle proceeds. Use your registered wallet address to drive settlement through this API. Must not be the zero address.
string
default:"FREEZE"
FREEZE or CUSTODY. See Collateral Modes. Cannot be changed after deployment.
string
default:"NAV"
NAV or MARKET. MARKET causes the contract to reject Dutch auctions and to floor auctionMinPremium at 9800 basis points. Cannot be changed after deployment.
string
Settlement token for the market. Any ERC-20 with 6 to 18 decimals, validated on-chain. 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. Required in practice for CUSTODY mode, recommended for FREEZE. Defaults to the zero address, which leaves compliance checks unresolvable and reports authorization status as unknown.
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.

Response Fields

Confirming with txHash returns 201 with the recorded market and its readiness state.
object
If a market for this token and mode already exists on-chain but was not recorded in your instance, the factory deployment is skipped and the existing deployment is adopted instead. In that case txHash is null.

Errors

Confirming can additionally return any transaction verification error.