Overview
Monolith is a permissionless stablecoin factory. There is no off-chain API, SDK, or indexer — all interactions go through on-chain contracts. This guide shows the core flows. Before reading, make sure you have the contract addresses for your chain.Core contracts
| Contract | Role |
|---|---|
Factory | Deploys new instances; manages protocol fees |
Lender | Per-instance core: borrow, repay, liquidate, redeem, PSM |
Coin | Per-instance ERC‑20 stablecoin |
Vault | Per-instance ERC‑4626 staked vault (yield-bearing) |
Lens | Read-only helpers (preview redeem, synced debt) |
Metadata | Per-Lender branding (URLs, logos, description) |
Deploying a new instance
Factory.deploy(DeployParams) creates a Lender, Coin, and Vault in a single transaction and returns their addresses.
Borrowing and managing a position
Lender.adjust is the single entry point for all position changes: deposit/withdraw collateral, borrow/repay debt, switch between paid and free (redeemable) debt modes.
lender.delegate(address, bool)) lets another address manage the position on the owner’s behalf.
Staking the Coin
Vault is a standard ERC‑4626. Yield comes from interest paid by borrowers in paid-debt mode.
1e16 shares (MIN_SHARES) to prevent the ERC‑4626 inflation attack.
Redemption (arbitrage)
Anyone can redeemCoin for a redeemable borrower’s collateral at oracle price minus redeemFeeBps.
Lens (simulates without mutating state):
PSM (if enabled on the instance)
IfpsmAsset was configured at deployment, anyone can convert between Coin and the PSM asset at 1:1 (decimals-adjusted).
Querying state
Lender exposes direct getters; Lens provides a version that simulates accrual before reading.
Liquidating a position
10_000e18. Incentive scales from 0% at the collateral factor up to 10% at collateralFactor + 500 bps. See Liquidations.
Events to index
Factory:Deployed(address indexed lender, address indexed coin, address indexed vault)
PositionAdjusted(address indexed account, int collateralDelta, int debtDelta)RedemptionStatusUpdated(address indexed account, bool isRedeemable)Liquidated(address indexed borrower, address indexed liquidator, uint repayAmount, uint collateralOut)Redeemed(address indexed account, address indexed borrower, uint amountIn, uint amountOut)Sold(address indexed account, uint coinIn, uint assetOut)Bought(address indexed account, uint assetIn, uint coinOut)WrittenOff(address indexed borrower, address indexed to, uint debt, uint collateral)

