Skip to main content
On Base, credit runs on Morpho Blue: a single immutable contract holding isolated markets. Each market is fixed forever by five parameters: loan token, collateral token, oracle, interest-rate model and liquidation LTV (LLTV). You call Morpho directly; GetEquity supplies the oracle.
Base Sepolia only. No gNTB market exists on Base mainnet yet.

The gNTB / cNGN market (Base Sepolia)

Most Morpho calls take the parameters as a struct, not the id:
Read them back from chain rather than hard-coding them: Morpho.idToMarketParams(0x3682…76a3).

Borrowing

Approve Morpho for the token first (approve(0xBBBB…EFFCb, amount) on gNTB to post collateral, on cNGN to repay). Amounts are in token base units: on Base Sepolia gNTB has 18 decimals and cNGN 6. Read decimals() on each token rather than assuming.
1

Post collateral

onBehalf is the wallet that will own the position, normally your own.
2

Borrow cNGN

Pass the amount as assets and 0 shares. Reverts if the position would exceed the 77% LLTV, or if the market has less idle cNGN than you ask for.
3

Repay

For a full repay, approve a little more than the debt (for example +0.1%); Morpho pulls only what is owed.
4

Withdraw collateral

Reverts if what remains would leave the loan above the LLTV.

Lending

You can withdraw only cNGN that is not lent out: totalSupplyAssets − totalBorrowAssets.

Reading a position

  • Debt (assets) = borrowShares × totalBorrowAssets ÷ totalBorrowShares, rounded up.
  • Collateral value in cNGN = collateral × price ÷ 1e36.
  • Health = collateral value × 0.77 ÷ debt.
market() totals are as of lastUpdate; to include interest since then, use Morpho’s MorphoBalancesLib (or accrue with the IRM’s borrowRateView).

The oracle

RWAPriceOracle reverts with NoPrice instead of returning 0, including when the asset’s payment token has changed. While it reverts, Morpho cannot price the collateral, so borrows, withdrawals and liquidations revert too; repaying and supplying still work.

Liquidation

When health ≤ 1.0, anyone may call:
The liquidator repays debt and seizes collateral worth the repaid amount × the liquidation incentive factor: about 1.074 at a 77% LLTV. Morpho allows liquidating the whole position; GetEquity’s own liquidator repays only enough to restore health.

Events to index

From Morpho Blue: SupplyCollateral, Borrow, Repay, WithdrawCollateral, Supply, Withdraw, Liquidate, each keyed by market id. See Morpho’s contract reference for the full signatures.