Market Creation
Complete guide to creating Lotus markets with MarketParams construction, IRM and liquidation parameter encoding, and calling createMarket with examples.
Prerequisites
Step 1 — Construct MarketParams
MarketParams memory params = MarketParams({
loanToken: 0xA0b8...USDC, // ERC-20 that lenders supply
irm: 0x1234...AdaptiveLinearKinkIrm, // Must be enabled
liquidationModule: 0x5678...OracleIncentiveModule, // Must be enabled
collateralTokens: new address[](3),
oracles: new address[](3),
lltvs: new uint128[](3)
});
// Tranche 0 (senior): WETH collateral, 80% LLTV
params.collateralTokens[0] = 0xC02a...WETH;
params.oracles[0] = 0xABCD...ETH_USDC_Oracle;
params.lltvs[0] = 0.80e18;
// Tranche 1 (mid): wstETH collateral, 85% LLTV
params.collateralTokens[1] = 0x7f39...wstETH;
params.oracles[1] = 0xBCDE...wstETH_USDC_Oracle;
params.lltvs[1] = 0.85e18;
// Tranche 2 (junior): cbBTC collateral, 90% LLTV
params.collateralTokens[2] = 0x2260...cbBTC;
params.oracles[2] = 0xCDEF...cbBTC_USDC_Oracle;
params.lltvs[2] = 0.90e18;Field
Description
Step 2 — Encode IRM Parameters
AdaptiveLinearKinkIrm
FixedRateIrm
ManagedLinearKinkIrm
Converting APR to WAD per Second
Step 3 — Encode Liquidation Parameters
OracleIncentiveLiquidationModule
Step 4 — Call createMarket
Step 5 — Verify
TypeScript Example
See Also
Last updated

