Nomial Docs
  • Concepts
    • What is Nomial
    • Why use Nomial
  • Protocol
    • Architecture Overview
  • Smart Contracts
  • Loan Process
  • Interest Rate Model
  • Solvers
    • Take out a loan
  • View loan status
  • Repay a loan
  • Security
    • Security Model Overview
  • Resources
    • Terminology
    • Connect with us
Powered by GitBook
On this page
  • Overview
  • CollateralPool
  • InventoryPool
  • Interfaces
  • Liquidation Mechanism

Smart Contracts

Nomial V1 relies on two key smart contracts that handle collateral management and inventory borrowing across chains. Below is a detailed breakdown of their functionalities.

Overview

There are two smart contracts that solvers interact with:

  • CollateralPool01

    • Accepts collateral deposits of any ERC20 token from solvers

    • Implements a time-locked withdrawal mechanism to allow time for liquidations

    • Has a two-step withdrawal process with configurable withdrawal period

    • Allows the owner (a multisig) to liquidate solver balances and pending withdrawals

  • InventoryPool01

    • Deployed on blockchains where solver inventory is needed

    • Each pool manages a single token type

    • Utilization-based interest rate model based on Aave V3

    • Penalty interest is incurred for overdue loans, to disincentivize long-term borrowing

CollateralPool

The CollateralPool contract stores borrower collateral and enforces a time-locked withdrawal mechanism. It allows the owner (a multisig) to liquidate solver balances if necessary.

Key Functions

  • deposit(address token, uint256 amount) Allows solvers to deposit a specified amount of an ERC20 token as collateral.

  • initiateWithdrawal(address token, uint256 amount) Starts a two-step, time-locked withdrawal process for the specified amount of token.

  • finalizeWithdrawal(address token) Completes the withdrawal after the lock period expires, transferring funds back to the solver.

  • liquidate(address solver) Enables the multisig to liquidate a solver's collateral in cases of protocol violations or insolvency.

InventoryPool

The InventoryPool contract stores LP capital. Borrowers (e.g., solvers) borrow from instances of InventoryPool. Each pool instance supports a single ERC20 token.

Key Functions

  • borrow(uint256 amount) Allows solvers to borrow a specified amount of tokens against their collateral.

  • repay(uint256 amount) Enables solvers to repay their loan, reducing their borrowed balance.

  • accrueInterest() Updates the interest accrued on outstanding loans based on utilization rates.

  • liquidate(address solver) The contract owner can liquidate a solver's position if they fail to repay on time, enforcing penalty interest.

Interfaces

Nomial V1 defines standard interfaces that outline the expected behavior of each contract.

ICollateralPool

The ICollateralPool interface ensures that any contract implementing it has the following functions:

  • deposit(address token, uint256 amount)

  • initiateWithdrawal(address token, uint256 amount)

  • finalizeWithdrawal(address token)

  • liquidate(address solver)

IInventoryPool

The IInventoryPool interface guarantees that all inventory pools follow a common structure

  • borrow(uint256 amount)

  • repay(uint256 amount)

  • accrueInterest()

  • liquidate(address solver)

Liquidation Mechanism

  • Time-Locked Withdrawals: Solvers must wait 7 days before finalizing withdrawals.

  • Validator Monitoring: Validators continuously monitor solver collateral ratios.

  • Multisig Liquidation: If a solver becomes insolvent, the multisig can liquidate their position to prevent system losses.

  • Penalty Interest: Solvers who fail to repay on time accrue additional penalty interest, increasing their debt.

PreviousArchitecture OverviewNextLoan Process

Last updated 1 month ago