⬜Litepaper
Last updated
Last updated
By Perlin Core Team
Abstract
Introduction
Perlin Protocol
Supplying
Borrowing
Interest Rate Model
Architecture
pToken Contracts
Algorithmic Stablecoins
Market Dynamics
Borrower Dynamics
Borrowing
Liquidation
Price Feeds
Pomptroller
Summary
Perlin Protocol (Perlin) is a decentralized, non-custodial, pool-based money market on Neo. Users supply cryptocurrencies to earn interest and borrow against them to unlock liquidity. Inspired by the pool-based lending strategy pioneers, Perlin allows users to exchange the time value of cryptocurrency with algorithm-based interest rates. The protocol gives full convertibility between stablecoins and collaterals. Users can swap collateral against a cryptocurrency at the oracle value. The Perlin protocol is highly capital efficient and liquid.
Open Finance or Decentralized Finance (DeFi) has developed independent, transparent, and composable algorithmic blocks to provide open access to a new set of financial primitives available to all. The money market or protocols present secured lending where the users borrow an amount provided they can front with a collateral. The trustless nature of the loans forgo the repercussions of reneging on debt commitments in traditional finance, thus operating as a true money market where the amount of borrowing is limited by the collateral. Interest rates are the prices of funds set by algorithm based on supply and demand, reaching the equilibrium. Unlike traditional finance, where the interest rates are set by central banks with a base rate, Perlin protocol sets algorithm-based interest rates to fill the gap between users with a surplus and people with a deficit of a specific cryptocurrency. The first generations of the money market, Compound and Aave, protocols have decreased the costs for end users to provide convenient and secure supplying and borrowing with native token emissions. However, the first generations have inherent interoperability and scalability issues in the following ways:
The contracts written in Solidity. Therefore, non-EVM networks, such as Neo, have limited access to trading the time value of assets.
The first generation of pool-based lending strategy protocols (Compound and Aave) provide lending and borrowing capabilities for the most liquid tokens, like ETH and BTC. They inherit scalability issues when handling lending and borrowing illiquid or volatile assets. Permissioned listings still fail to suffice the demand for lending and borrowing of the long tail of cryptocurrencies.
Over-collateralized stablecoins are the most risk-resistant designs, but limit scalability.
Perlin protocol proposes a new decentralized money market on Neo, allowing swaps at oracle value between cryptocurrency and collateral. In this whitepaper, we will showcase the implementation of a new money market.
Perlin uses a pool-based lending strategy. The lenders provide liquidity by depositing cryptocurrencies in a pool contract. The same cryptocurrencies in the contract are borrowed with a collateral as a guarantee. The lending pool is the reserve of respective cryptocurrency, with the total amount defined as total liquidity. A reserve receives deposits from lenders and users can borrow these funds, if the collateral locked is greater in value. Specific in the pooled reserves can be configured as collateral or not for borrow positions. For V1, only low risk tokens, such as NEO, BTC, and ETH, should be considered. Each lending pool has a specific Loan-To-Value (LTV), calculated as the weighted average of the different LTVs of the cryptocurrencies composing the collateral.
The interest rates are set with the following algorithm:
Borrowing is dependent on the amount of funds in the pool. If more funds are borrowed from the pool, the amount of funds available decreases. Thus, the interest rate increases and vice versa.
Lending is dependent on the interest earned. The algorithm reserves the Borrowing is dependent on the amount of funds in the pool. If more funds are borrowed from the pool, the amount of funds available decreases. Thus, the interest rate increases and vice versa.
With over-collateralized positions, users are also able to mint algorithmic stablecoins, similar to DAI and FRAX, in the future update.
Perlin aggregates the supply of each user. When a user supplies a cryptocurrency, it becomes a fungible resource. Instead of P2P or direct lending, the pool offers more liquidity. The users can withdraw their assets at any time without a specific loan maturity. Users can withdraw the supplied cryptocurrencies at any time, as long as the utilization rate for the cryptocurrency will be less than 100% after the withdrawal. If the withdrawal will raise the utilization rate to 100%, the withdrawal will be unavailable. Users must have an overcollateralized position in V1.
Perlin allows users to borrow any cryptocurrency, using pTokens as collateral. The pool based strategy removed the need for negotiating terms, maturity dates or funding periods. The borrowing is permissionless and instant. Similar to supplying an asset. Each money market has a floating interest rate with the supply and demand, determined by the borrowing cost for each asset. If the value of a user’s collateral drops below the minimum collateral ratio, their collateral will be liquidated to pay off their debt. Each cryptocurrency has an unique minimum collateral ratio, as each carries unique risk, e.g. liquidity and volatility. The aggregate risk of an account is represented through the Health Factor, which is the combined ratios of the borrowed cryptocurrencies. If the health factor is higher than 100%, the account cannot be liquidated. If the health factor is less than 100%, the account is subject to partial liquidation and cannot borrow more without repaying or providing more collateral.
Rather than individual suppliers or borrowers having to negotiate over terms and rates, the Compound protocol utilizes an interest rate model that achieves an interest rate equilibrium, in each money market, based on supply and demand. Following economic theory, interest rates (the “price” of money) should increase as a function of demand; when demand is low, interest rates should be low, and vise versa when demand is high. The utilization ratio U for each market a unifies supply and demand into a single variable:
The demand curve is codified through governance and is expressed as a function of utilization. As an example, borrowing interest rates may resemble the following:
The interest rate earned by suppliers is implicit , and is equal to the borrowing interest rate, multiplied by the utilization rate. 2.3.1 Liquidity Incentive Structure The protocol does not guarantee liquidity; instead, it relies on the interest rate model to incentivize it. In periods of extreme demand for an asset, the liquidity of the protocol (the tokens available to withdraw or borrow) will decline; when this occur, interest rates rise, incentivizing supply, and disincentivizing borrowing. 3 Implementation & Architecture At its core, the money market is a ledger that allows Ethereum accounts to supply or borrow assets, while computing interest, a function of time. The protocol’s smart contracts will be publicly accessible and completely free to use for machines, dApps and humans.
Perlin money market is a ledger that allows NEO accounts to supply or borrow assets, while computing interest, a function of time. The protocol’s smart contracts are publicly accessible and completely free to use for machines, dApps and humans.
Each money market is structured as a smart contract that implements the NEP-17 token specification. User’s balances are represented as pToken balances; users can mint(uint amountUnderlying) pTokens by supplying assets to the market, or redeem(uint amount) pTokens for the underlying asset. The price (exchange rate) between pTokens and the underlying asset increases over time, as interest is accrued by borrowers of the asset, and is equal to:
As the market’s total borrowing balance increases (as a function of borrower interest accruing), the exchange rate between pTokens and the underlying asset increases.
Perlin mints PerlinUSD, an algorithmic stablecoin based on the price of $1 USD by using pTokens from the underlying collateral previously supplied to the protocol. Users can borrow up to 50% of the remaining collateral value of pTokens for PerlinUSD. The controller mints PerlinUSD into the money market to allow PerlinUSD borrowing by paying interest instead. PerlinUSD minted in the money market are overcollateralized. This is similar to FRAX’s lending AMO, where the cash flow from lending is used to buy back and burn PERL.
For a market 𝑚, total loans 𝐿 and gross deposits 𝐴, we define the utilization of deposited funds in that market as
Each time a transaction occurs, the Interest Rate Index for the asset is updated to compound the interest since the prior index, using the interest for the period, denominated by r * t, calculated using a per-block interest rate:
The market’s total borrowing outstanding is updated to include interest accrued since the last index:
A portion of the accrued interest is retained (set aside) as reserves, determined by a reserveFactor, ranging from 0 to 1:
A borrower’s balance, including accrued interest, is simply the ratio of the current index divided by the index when the user’s balance was last checkpointed.
The balance for each borrower address in the pToken is stored as an account checkpoint. An account checkpoint is a tuple. The tuple appoints the balance at the time interest was last applied to the respective account.
A user who wishes to borrow and who has sufficient balances in Perlin may call borrow function on the relevant pToken contract. This function checks the user’s account value, and given sufficient collateral, will update the user’s borrow balance, transfer the tokens to the user’s NEO address, and update the money market’s floating interest rate.
Borrow accrue interest in the exact same fashion as balance interest was calculated in section 3.2; a borrower has the right to repay an outstanding loan at any time, by calling repay function which repays the outstanding balance.
If a user’s balance exceeds their total collateral value (borrowing capacity) due to the value of collateral falling, or borrowed assets increasing in value, the public function liquidate can be called, which exchanges the invoking user’s asset for the borrower’s collateral, at a slightly better than market price.
A Price Oracle maintains the current exchange rate of each supported asset; the Perlin protocol set the value of cryptocurrencies from NEO Oracle
a committee which pools prices from the top exchanges. These exchange rates are used to determine borrowing capacity and collateral requirements, and for all functions which require calculating the value equivalent of an account.
The Perlin protocol does not support specific tokens by default; the markets must be whitelisted. supportMarket(address market, address interest rate model) function allows the users to begin interacting with an asset. To borrow a cryptocurrency, the Price Oracle must feed a valid price. To use a cryptocurrency as a collateral, there must be a valid price and a collateralFactor.
Each function call is validated through a policy layer, Perlin Controller. The contract validates collateral and liquidity before allowing an user action to proceed.
Perlin Protocol tokenizes the deposits to corresponding amounts of derivative tokens, called Reserve Tokens (pTokens for short), mapping 1:1 the underlying cryptocurrencies. The balance of pTokens of every depositor grows over time, driven by the perpetual accrual of interest of deposits.
pTokens also natively implement the concept of interest rate redirection. The value accrued over time by the borrowers’ interest rate payments is distinct from the principal value. Once there is a balance pTokens, the accrued value can be redirected to any address, effectively splitting the balance and the generated interest. We call the continuous flow of accumulated interest over time the interest stream.
bNEO is a standard NEP-17 token with decimals 8
and it can be minted from NEO and redeemed to NEO 1:1. bNEO holders receive the optimized GAS rewards. Neo's dual token system has created an exotic lender-borrower dynamic due to the GAS received by the borrowers. The bNEO lenders must receive interest that combines the base APY and the GAS received during the deposit.
The borrowers will accrue an interest equivalent to GASamount * currentPrice + baseAPY
. Note that we will not keep track of the GAS price per epoch for the UX of the depositors and the safety of the protocol. The same interest rates will apply to liquidations.
Perlin creates properly functioning money markets for Neo assets
Each money market has interest rates that are determined by the supply and demand of the underlying asset; when demand to borrow an asset grows, or when supply is removed, interest rates increase, incentivizing additional liquidity
Users can supply tokens to a money market to earn interest, without trusting a central party
Users can borrow a token (to use, sell, or re-lend) by using their balances in the protocol as collateral