Nolus Docs
Protocol

Borrowing

How the protocol opens, services, repays, and closes a margin position.

Each supported denomination has a dedicated Liquidity Providers' Pool (LPP) instance that handles all borrow requests and repayments in that currency. The LPP calculates a fixed interest rate for each loan, tracks total principal and interest due, and maintains records of all active loans. An LPP operates exclusively in its native currency, called the Liquidity Pool's Native (LPN) denomination, and does not interact with other assets.

A factory contract creates all margin positions, with one factory deployed per integrated market. Each factory is connected to a single LPP - and by extension, to a single LPN. The LPN can be a stablecoin or a volatile token. For instance, if a user wants to borrow USDC to go long, they submit a request to the factory linked to the LPP whose LPN is USDC.

Factory configuration

The factory smart contract is configured with parameters that define the behavior and constraints of every position it creates.

ParameterDefinition
Code IDThe identifier of the margin-position contract used to initialize new positions.
LPP AddressThe LPP smart contract tied to this factory instance.
Protocol Interest RateThe fixed interest portion collected by the protocol (e.g., 3%); 100% is used for buybacks.
Max LiabilityMaximum allowed liability ratio. Crossing this triggers liquidation eligibility (e.g., 90%).
Healthy LiabilityTarget liability after a liquidation restores the position (e.g., 83%).
Initial LiabilityMaximum LTV at position creation. Must be lower than the healthy liability (e.g., 60%).
Minimum Position SizeMinimum value, in LPN, that a position must maintain to stay alive (e.g., 15 USDC).
Minimum Transaction AmountSmallest allowable amount for any transaction within the position (e.g., 0.01 USDC).
Interest Due PeriodWindow in which outstanding interest must be repaid. Past the deadline, owed interest is deducted via partial liquidation.
Liability Reevaluation IntervalHow often (in seconds) the "liability covered" invariant is checked (e.g., every 2 seconds).
First / Second / Third Liquidation Warning ThresholdThree warning levels that signal escalating liquidation risk (e.g., 83.5% / 85% / 87.5%). Each must be strictly lower than the next, and all below the max liability.

The "liability covered" invariant a position must satisfy at every check:

Current Liability < Max Liability × Position Value (in LPN)

Worked example

  • Borrowed amount (loan): 150 USDC
  • Initial position value: 250 USDC
  • Liability: 150 / 250 = 0.60
  • Max allowed liability: 0.90

If the position value drops to 200 USDC, liability becomes 150 / 200 = 0.75 - still within the limit. If it drops further to 165 USDC, liability becomes 150 / 165 ≈ 0.91, exceeding the 0.90 cap and breaking the invariant. Once breached, the position is flagged for liquidation.

Walk through the flow

On this page