Overview
Motivation
How it works
Benefits
Implementation Choices
Risks
Closing Thoughts
This post introduces a new way to construct lending markets, featuring a hard-to-find combination of
Robustness to liquidation shortfalls
Market responsive loan terms
Pooled liquidity with no lockups
This is accomplished by simplifying an entire lending market to the trading of a token, a “papr” token (read “paper,” stands for perpetual APR).
Papr is minted by borrowers, who transfer some collateral to a papr controller (a smart contract). Borrowers can then exchange their papr for other assets using a decentralized exchange (e.g. Uniswap). Papr interest rates and the papr trading price are in a constant feedback loop. Interest rates are programmatically updated on chain as a function of papr’s trading price on Uniswap (the lower the trading price, the higher the interest to borrowers), and interest rates in turn affect the trading price, as borrowers open and close loans in response to rates.
Interest accrues to the value of papr itself: over time, new borrowers are allowed less papr for the exact same collateral. When closing a loan, borrowers repay the exact same amount of papr that they minted. However, due to interest charges, it is expected that the market value of papr will have risen since they opened their loan.
To the extent that borrower incentives push the trading price of papr up over time, corresponding to these interest charges, papr holders are rewarded.
As an analogy, for those familiar with perpetuals, we can say that papr adapts the funding rate mechanism to set interest rates for loans and balance borrower and lender demand. In particular, papr tokens were heavily inspired by Squeeth, which pioneered perpetuals built on Uniswap V3 oracles and continuous, in-kind funding payments.
Subscribe and mint this NFT to be included in a testnet competition: paprHERO. Launching soon!
Today, lending in crypto is dominated by protocols which can only serve a very limited class of assets. The dominant peer-to-protocol models (Aave, Compound, Maker, etc.) have little to no tolerance for liquidation shortfalls (collateral being liquidated for less value than it was used to borrow) and because of this can only accept collateral which has
Manipulation resistant trading volume
Liquidity to support selling large amounts of collateral near the spot price
The consequence of these limitations are extremely apparent in the NFT-backed loan space. Peer-to-protocol NFT loan products, which are modeled on the protocols named above and offer by far the most convenient borrower and lender experience, generally lend to fewer than 10 NFT collections.
This is striking, and disappointing, because there is clearly both borrower and lender demand for loans featuring a much wider set of collateral. For example, NFTfi, a popular peer-to-peer lending protocol, has facilitated loans for over 200 different NFT collections.
While market interest is there, the tools are not. The peer-to-peer models pale in comparison to the peer-to-protocol. They are high friction: every loan is a bespoke agreement between two parties. There is no shared liquidity or market discovery of loan terms. Peer-to-peer models struggle to scale. We would know! We supported the development of a peer-to-peer lending protocol, which launched April 2022.
We set out on a mission to bring the strengths of peer-to-protocol lending—instant borrower liquidity, set it and forget it lender experience—to a much broader set of collateral. We found what we were looking for in a design that is robust to liquidation shortfalls and offers a whole lot more, as well!
A papr token is defined by the following attributes
There are two important prices of a papr token.
Target: what the papr controller (i.e. lending protocol) says each papr token is worth, in underlying token terms.
Mark: what the papr token’s trading price is on Uniswap, in underlying token terms.
The maximum borrow amount, in papr tokens, for any collateral is oracle(collateral) * maxLTV / Target
. Target increases as interest is charged to borrowers, and as a result collateral is worth less and less papr over time (assuming a constant collateral price). If the amount of papr a borrower owes exceeds the current maximum borrow amount for their collateral, their collateral will be programmatically liquidated and sold for papr.
Let’s go through an example. Suppose there is a papr token protocol defined by the example values in the table above.
Lending criteria: only PUNK collateral
Collateral price oracle: Trailing 30 day floor price on OpenSea
Max loan to value ratio: 50%
Underlying token: USDC
If Target is 1.1 USDC, and the 30 day PUNK trading price is $1000, then a borrower could at most obtain 1000 * 0.5 / 1.1 = 454
papr tokens. Note that how many underlying tokens (USDC, in this case) the borrower can finally obtain depends on Mark, papr’s trading price in the market. For reasons we’ll describe below, we expect Mark to almost always be below Target (though of course this will depend on market conditions that we cannot predict for sure). So, if on Uniswap 1 papr = 1.08 USDC, then the max USDC a borrower can get is 454 * 1.08 = 490
USDC. The advertised max LTV is 50%, but the borrower could only realize a max LTV of 490 / 1000 = 49%
. This corresponds to the ~1% price difference between Target (1.1 USDC) and Mark (1.08 USDC).
Interest charges are computed as a function of
Target
Mark
Time since last interest charge
When the controller contract is created, Target = Mark = 1. Thereafter, every time the contract is touched, it asks, “How far above or below Target is Mark?” The controller wants Mark to be as close to Target as possible, and tries incentivize papr buyers and sellers to achieve this: balancing borrower and “lender” demand at some equilibrium interest rate. Mark being below Target would be considered as excess seller/borrower demand, and the contract would charge interest to borrowers to keep this demand in check.
In the case of NFT-collateralized loans, borrowers have no fungible collateral from which to take interest charges. Instead, the controller charges interest by adjusting Target. If the controller wants to charge $0.1 of interest per papr borrowed, it adds $0.1 to Target. Recall that the max allowed debt for any collateral is oracle(collateral) * maxLTV / Target
. So increasing Target means:
New borrowers are allowed less papr for the exact same collateral
Existing borrowers are moving closer to liquidation
As a result, Mark might increase due to slowed supply growth from (1) and buy pressure from borrowers closing loans due to (2). The design intent is for Mark to follow Target and provide continuous, in-kind interest payments to papr token holders.
It is possible for Mark to exceed Target, and this would result in negative interest rates. This might be uncommon, as negative interest rates are unappealing to papr buyers. We discuss below in “Risks.”
Liquidations are important and so we will discuss them before going further. This will require getting into some of our specific implementation choices. We want to note, though, that there are many viable ways for liquidations to be implemented.
A borrower’s collateral can be liquidated if the borrower’s outstanding papr debt exceeds their max allowed debt. Again, the formula for max debt is oracle(collateral) * maxLTV / Target
. Liquidations can be caused by (1) an increase in Target, from interest charges and/or (2) a decrease in the collateral’s value, according to the collateral price oracle.
The protocol is designed to be robust to liquidation shortfalls and values timely liquidations above covering all debt. The protocol does not wait for a minimum bid for the collateral, but instead sells collateral in exponential decay dutch auction.
The collateral is sold for papr. Any papr amount greater than what is needed to bring a borrower under the max allowed debt threshold is considered excess. If there is excess papr, a liquidation fee is subtracted and given to the protocol (added to an insurance fund) and the remainder is used to further reduce the borrowers debt. If the excess debt exceeds a borrower’s total debt, what is left over is sent to the borrower.
A borrower might have several collateral items, and each is liquidated separately. The auction starter (discussed below) picks which collateral item to liquidate. Liquidation auctions on each borrower’s collateral have a minimum spacing: liquidators must wait the minimum spacing time from the previous auction start before starting a new auction. This is intended to give each auction sufficient time to run and possibly bring the borrower back under max debt.
Liquidators are incentivized to start auctions by a “starter discount” they receive when purchasing the collateral being auctioned. For example, the auction starter might receive a 10% discount on the current exponential decay dutch auction price. This incentive model is designed to work equally well for both high and low value collateral. The auction starter does not know what others might pay for the collateral, and so is incentivized to purchase it at the first price that makes sense for them. We believe the mechanism works so long as there exists an arbitrage opportunity that can at least cover the auction starters gas cost of the two transactions.
By gaining robustness to liquidation shortfalls, the protocol can extend the general strengths of peer-to-protocol models—instant liquidity for borrowers, pooled lender capital with no time locks, market driven loan terms—to a much broader set of collateral.
The trick is that the protocol does not promise any specific return or need to be concerned with honoring such a return. The change in price of papr over time is the cost of the loan to borrowers and the reward to papr holders.
For example, if a borrower is liquidated and the auction fails to cover the papr the borrower owes, nothing breaks. In this scenario there is now some papr in circulation that is “unbacked” and would mean the ratio of total collateral value / papr marketcap
is now lower. This “excess” supply in papr might mean that Mark trades lower, which would cause higher interest rates and would mean new borrowers are getting less papr and existing borrowers are closer to liquidation.
We find it exciting that a liquidation shortfall would not cause the protocol to fail but likely would manifest as higher interest rates and appropriately signal increased risk to market participants. And more generally we notice that interest rates based on the trading price of a token reflect a much broader set of information than, say, just a simple ratio of supplied capital and borrowed capital.
The following are decisions specific to our go-to-market plans and are not necessary conditions for the use of papr tokens, in general.
To compute a new target price, and apply interest charges, we use the following formula
where
Funding period is a duration we select. It serves to calibrate the Target change relative to how much time has passed since the last interest rate change. Finding the right value is a delicate balance: the protocol should assess interest charges such that borrowers are properly incentivized, while ensuring borrowers are not griefed from expected things like price slippage on Uniswap.
Note that this formula is very similar to the one used by Squeeth.
Uniswap v3 is used to facilitate papr token <> underlying token exchanges and as the oracle for Mark. Three things appealed to us in the Uniswap v3 protocol:
Oracle features
Full range + specific range LP options
Possibility for “lenders”/buyers to effectively set limit orders via single side LP’ing out of range
There are other possibilities that the market might want to consider, like developing a bespoke AMM in the papr controller. There is complexity involved with doing this right, so it made sense to us to leverage a market tested protocol like Uniswap v3.
We also see value in separating investing, generally, from providing swap liquidity. Many protocols have a single pool that holds investor deposits AND facilitates all swaps, whether from borrowers or lenders leaving the protocol. In this way, an investor can incidentally serve as exit liquidity to other investors, who might be leaving a pool that is in a bad condition.
To control for the possibility of an oracle attacks (for example, manipulating Mark), the protocol is designed to have a maximum and a minimum on the result of Target/Mark
in the interest rate formula shown above. This effectively means a max and min on the APR to borrowers.
Many popular NFT collections do not have manipulation resistant trading volume. Our protocol makes use of Reservoir’s Oracle, which uses time-weighted average of floor listings. This is more resistant to manipulation because an actor cannot manipulate it by only trading with themselves. It can only be manipulated down and to do so an attacker needs to risk losing their NFT to another buyer. A tradeoff is that the floor-listing price might average slightly above the actual trading price, as it represents the “ask” at any given moment, not a matched price.
We use the oracle two different ways. When a borrower is minting debt or withdrawing collateral, we use the LOWER
method, which is a min(current floor listing, time-weighted average floor listing)
. For liquidations, we just use time-weighted average floor listing.
Reservoir uses the TrustUs pattern: signed oracle messages are passed by accounts taking actions.
We plan to help launch papr tokens that allow for several different NFT collections to serve as collateral. These various kinds of collateral are grouped under borrowers into vaults. For example, if a papr token accepts Apes and PUNKs as collateral, then each borrower would have a separate Ape vault and a PUNK vault. Each vault has its own LTV and liquidations are vault specific. I.e. the Ape price falling would not put your PUNKs at risk.
This is not at all an exhaustive set of all possible risks but a few we think are most salient to discuss.
The system is designed to incentivize market participants to keep the token price close to its target price. And as the target price goes up with interest charges, ideally the token price will as well. But it is a freely trading token. There is no certainty that it will go up or down.
What happens if Mark is above Target? In “How it Works” we discussed what happens if Mark is below target, but what if Mark is above Target?
The controller interprets Mark being above Target as excess lender/buyer demand, and it would charge negative interest to curb that demand. Target would decrease: giving new borrowers more papr for the same collateral and allowing existing borrowers longer loans.
Because this is a very unattractive scenario to investors, we do not expect Mark to trade above Target for any prolonged duration.
Note that these negative interest do mitigate a certain attack vector. Suppose there is a papr token with very little liquidity, and an attacker wants to make it very difficult for borrowers to close their loan. The attacker buys up all papr on Uniswap, so borrowers have to either pay a lot (to the attacker) to purchase papr and close their loan or maybe cannot close their loan at all.
In this situation, Mark is likely above Target. (If Mark is below or equal to Target, then the price of the papr token has not gone up that much and borrowers can close loans at rates in line with expectations.) If Mark is above Target, the controller sees this as excess “lender”/buyer demand and would flip interest rates negative. Borrowers would then have indefinite loans and could mint and sell more papr, which the attacker would have to keep buying to keep up the attack.
Suppose an NFT holder has many NFTs of a certain collection and wants to sell them quickly. Suppose further that selling all of them at once on NFT marketplaces would result in an average sell price less than 50% of the current floor.
If there exists a papr token which lends to this NFT, the NFT holder could possibly use this token to effectively “sell” their NFTs at a higher price. The NFT holder would deposit all their NFTs, borrow the max amount of papr, and sell it on Uniswap. Whether this results in a higher exit value than an NFT marketplace could provide depends on the papr token’s max allowed debt and the papr token’s liquidity on Uniswap, but such a situation could occur.
If a papr token facilitates loans to some collateral with thin spot liquidity (few ready and waiting buyers) and several of these NFT are liquidated simultaneously, it is possible that some collateral will be sold for less than oracle(collateral) * maxLTV
 and the auction will not raise enough debt to cover what the borrower owes.
For this reason, if a papr token serves multiple types of collateral (e.g. multiple NFT collections) it is advantageous that they have similar exposure to this shortfall risk, so that the market can most efficiently price this risk in setting interest rates.
We are very excited about papr! We also are certain there are many improvements still to be made. We are sharing this now and will share code ahead of any audit so that we have time to get feedback and improve our design. Thanks for reading!
As noted above, we took inspiration from Squeeth and are indebted to the Opyn and Paradigm teams for all their work there. Thanks especially to Andrew Leone for his time and feedback.
A very special thanks to John Palmer, who coined the name “papr”!
Finally, thanks to so many that gave their time and expertise to help is figure this all out: Moody, Conor Grogan, Alpharush, Hsien-Tang Kao, Peter Watts, Ankit Chiplunkar, Jordan Frankfurt, Will Price, Jacob Horne, Jesse Pollak, Spreek, and all who took the time to do user interviews and give feedback. Thank you!