Smart contracts

Architecture

One contract, fixed at deployment, with no admin surface in its ABI.

The entire protocol is a single contract, LendrMarket. There's no factory, no proxy registry, and no separate vault or treasury contract — every listing, for every borrower and lender, lives in this one contract's storage.

What's fixed at construction

constructor
constructor(address loanToken, address[] collaterals)
  • loanToken — the single ERC-20 the market will ever lend (USDG on mainnet). Every createListing call is validated against this.
  • collaterals — the allow-listed set of ERC-20s the market will accept as collateral. allowedCollateral(token) reads from this set. Adding a new collateral token requires a new deployment; there's no addCollateral function.

What's not in the ABI

There's no owner, no pause switch, no fee setter, and no upgrade path anywhere in lendrMarketAbi — no function takes an onlyOwner-shaped access pattern, and there's nothing resembling a proxy's upgradeTo. Once deployed with a given loan token and collateral set, that configuration is permanent for that deployment's lifetime.

No protocol fee

There's no fee basis-points parameter, no treasury address, and no cut taken anywhere in createListing, fillListing, or repay. The full interest amount computed by interestOwed goes from borrower to lender with nothing withheld.

What the frontend expects of every token

Both the loan token and every collateral token only need to satisfy a minimal, standard ERC-20 surface — approve, allowance, balanceOf, decimals — which is all the frontend calls directly, separately from LendrMarket itself, to manage spending allowances before each action.