[THORFI] Lending Design Using Derived Assets
Overview
Lending allows users to deposit collateral
, then create debt
at some collateralization ratio CR
(collateralization ratio). The debt is always denominated in USD (despite what asset the user receives). These loans have 0% interest, no liquidations, and no expiration. Risk is contained by caps on launch, slip-based fees when opening and closing loans, dynamic CR, and a circuit breaker on RUNE supply.
WHY
Lending will bring fresh exogenous capital from new users to scale liquidity (both TVL and security), and drive up the capital efficiency of the pools which increases system income and real yield.
ELI5 (explain like I'm 5)
"THORChain onboards layer1 collateral to issue dollar-based debt. The collateral is stored as equity. The more collateral is taken onboard relative to the pool depths, the higher the collateralization ratio for new loans, so users want to get in first. The higher the collateralization ratio, the safer the system becomes. Since there are no liquidations and no interest rate, users are less likely to pay back their loans, which is beneficial to the protocol as the equity-value increases. Also, since the loans remove RUNE from the pools, the pools open back up for more TVL, causing THORChain to scale liquidity and security."
Design Goals
The primary design goals are:
- Minimal Cognitive Burden. The simplest UX around collateral, debt, and loan terms should be pursued.
- Scalable Security. The collateral should always be secured.
- Contained Risk. The risk of new debt being opened too fast should be throttled, and the risk of existing debt exceeding the liquidity of the system should be contained by a transparent circuit breaker.
Economic Implementation
Collateral & Debt
Collateral
The collateral should be layer1 assets, eg BTC
, and the debt should USD-denominated. This is the largest addressable market. All other forms of collateral and debt denominations can be ruled out here.
The debt should not be RUNE denominated because users would be shorting RUNE. The collateral should not be RUNE denominated because it won't bring fresh exogenous capital to the system as well as create sell pressure on RUNE.
Wrapped vs Synthetic vs Derived Assets
All 3 types can achieve layer1 exposure, but only 1 can work:
- Wrapping assets are incompatible with THORChain's coupled security model thus can be ruled out, because a security budget can not be built from entry-carrying-exit fees.
- Synthetic Assets using pooled liquidity could work, but are competing for the same security space as the Savings + LP features, which have a cap. Thus the system would lock up and could not scale. There is also RUNE-ASSET IL risk to cover.
- Derived Assets using RUNE equity can scale beyond the cap, drive price action into $RUNE to increase the network security, and attract fresh capital to the system. There is RUNE-ASSET price risk to cover.
Debt Denomination
USD-denominated Debt is the design goal. Denominating in an external stablecoin creates a third-party dependency/risk (various centralization concerns). Denominating against a median-priced manipulation-resistant basket of stablecoins is much safer. This is the design of $TOR.
$TOR as a unit of account is already live in the protocol today, and denominates that all L1 outbound fees pay a minimum of $1.00.
$TOR, whilst technically an algo-stable, will not be transferrable and will have no other use than being an internal unit of account. Thus, the market cap of $TOR is always zero (unless the community decides later to open $TOR as a general-purpose asset, which is outside the discussion of this lending feature).
Loan Terms
Liquidations
Unique to this design, it is irrelevant if the collateral drops below the debt value because the collateral is the liability, not the debt. If the collateral goes to zero, the liability also goes to zero.
The liability is the collateral, which is stored as equity (RUNE). If the collateral value out-paces the RUNE value, then the liability increases. Liability around debt-collateral is only created when the RUNE-ASSET price drops AND the loan is paid back.
Liquidating collateral contains risk on a per-loan basis. However, it creates very poor UX (distressed sales at the bottom and liquidation cascades), and causes the user to worry about the price of an unrelated third asset: RUNE, thus is untenable to the design goals.
Thus instead of liquidations, the protocol will tolerate a small increase in RUNE supply (~15m or ~3%), before trigging a circuit breaker and permanently sunsetting the lending feature. No new loans will be created and the RESERVE will cover the remaining collateral payouts (RESERVE has ~35% of the RUNE supply). Since the loan terms never change even after the circuit breaker, it's less likely to become self-fulfilling and incentivize a rush-exit.
Interest Rates
Interest Rates are a mechanism to collect income on collateral. However, it increases the propensity of a user to pay back their loan. THORChain's lending design can scale the most when users elect to have very long-term loans, or never pay them back.
0% interest rates are the most desirable for a loan facility and thus means users are least likely to pay back since their principle is never eroded. Users will pay slip-based fees when they enter or exit their position, which both increases yield for LPs/nodes as well as burn RUNE permanently.
User Experience
From the design goals above:
- A user deposits layer1 asset,
BTC
which creates a derived asset to mark their collateral amount. Eg, 2.0 BTC
Under the hood the 2.0 l1 BTC is swapped across the pools to buy and burn 1.99 BTC in RUNE^
- Based on a dynamic
CR
, some amount of TOR-denominated debt is minted. Eg 200% CR means 20k TOR (1 BTC = $20,000)
Enough RUNE is then counter-minted to produce this debt: 1.99 / 200% = 0.995 BTC of TOR^
- Based on user preference, the debt can be withdrawn as another L1 asset (eg USDC or ETH). eg 20k USDC
The TOR is then swapped to 0.99 BTC in RUNE^ The RUNE is then swapped to 0.985 of USDC^
^slip-based fees apply.
Overall, 2.0 BTC is deposited and <1.0 BTC worth of USDC is withdrawn (slip fees), leading to a net-burn of >1.0 BTC in RUNE.
- Sometime later, the user can pay back 20.1k USDC, which mints 20k TOR
The USDC is swapped to RUNE, which is swapped to TOR and cancels the debt^
- The debt is repaid, so the user unlocks their full collateral, 2.0 BTC
Enough RUNE is minted to swap to 1.99 in BTC^
^slip-based fees apply.
Overall, 1.0 BTC worth of USDC is deposited and <2.0 BTC worth of BTC is withdrawn (slip fees), leading to a net-mint of <1.0. BTC in RUNE.
Across the loan period, no new RUNE was minted (if RUNE-BTC stayed constant), but 8 * slipFees of income was made. Essentially a single loan creation is worth 8 swaps to the network, with only 1 L1 tx in and out. Half of those swaps produce revenue for layer1 pools, while the other half burns the swap fee in rune.
Economic Reasoning
Scaling Liquidity
Due to PoL and Savers, the network is likely to max out pooled RUNE and send all yield to nodes. The protocol stops scaling until it can recruit new nodes, but this takes time. A faster mechanism to scale security (and TVL) is to attract new capital, buy out the RUNE from the pools and open up caps again. This is the lending design.
Whilst the loan is opened, it created a net reduction in RUNE in the pools, allowing more TVL to enter. It also bids on RUNE, allowing security to increase. Additionally, +ve RUNE Price action boosts the value of yields (block rewards).
This is why lending scales THORChain.
Contracting Safely
If borrowers start paying back their loans, this reverses the above sequence of events and the system contracts. RUNE is minted and sold, causing sell pressure on the RUNE asset and an increase of the RUNE suply.
However, the CR will start dropping for new loans, until a point is hit and new loans are opened under favorable CR terms. This stops a runaway bank run on loans.
Circuit Breaker
If the RUNE price drops drastically against the majority of its collateral assets (L1 gas assets), then net inflation of RUNE will occur if users start paying back their loans, and it exceeds the margin of RUNE already historically burnt. This inflation could hit the breaker limit. At this point the system pauses new loans to be created and sunsets (turns off) lending (forever) (note, all other features of TC still function). At this point, no further inflation of RUNE can occur and the supply arrested. The RESERVE will cover the remaining collateral payouts.
Note: a 1-way circuit breaker means the only risk Lending has on the protocol is minting an extra 15m (3%) of the supply and a reduction in the RESERVE. Thus the downside is capped. A 1-way circuit breaker will theoretically mean it is less likely to be hit, instead of a rush-exit. THORChain borrowers know their loan terms don't ever change, and if too many of them panic and payback, they know they will cause THORChain to permanently turn off Lending. Thus if Lending is a net good, there will be an incentive to keep it turned on; thus borrowers may choose to (altruistically) stay in, instead of leaving.
Loan Caps
For safe scaling, lending is capped based on the amount of outstanding RUNE supply. The monetary policy of the asset is a cap of 500m. Currently, the network is missing ~15m RUNE due to individuals not upgrading original rune assets of BEP2 or ERC20 RUNE. Since we have this 15m gap, this is used to help "fund" lending to start.
To help protect the network from hitting the circuit breaker, only 1/3rd of the outstanding RUNE will be used to guide scaling lending (~5m RUNE) in terms of loan collateral value. 1/3rd is selected due to historical analysis of RUNE's price movements, where its largest micro-economic price event (several hacks in early beta days, 2 years ago), we saw a 3x price change downward (relative to BTC). This means that however amount of loans that are taken out, we could see a 3x downward price change AND 100% of loans could close, and we still wouldn't hit the 500m cap (circuit breaker).
As more rune is burnt, and the gap is increased from 15m --> 20m, this opens up more space for more loans to be opened. In addition, the market buy and burning of 5m+ RUNE should cause rune's price to naturally out perform BTC. As rune's price out performance BTC, and the ratio in the BTC pool shifts, and more loans can be opened, without changing our risk profile.
c = current total btc collateral
o = outstanding rune --> 500m - current rune supply
br = bitcoin rune depth
ba = bitcoin asset depth
cap = ba / (br / (o / 3)) - c
This cap, is divided and associated with each pool that allow lending collateral, relative to the pool depths. So if BTC and ETH are the collateral assets, and BTC has 3/4ths of the rune and 1/4th is ETH, then BTC gets 3/4ths of the cap, and ETH get 1/4th.
Technical Implementation
Open
Example memo
LOAN+:BTC.BTC:bc1YYYYYY:minBTC:affAddr:affPts:dexAgg:dexTarAddr:DexTargetLimit
A new loan is opened with 0 values. Then if new with 0 values, or if existing with non-0 values:
- swap collateral to RUNE, burn it, add this
rune_burnt
- swap the qty of burnt RUNE to derived asset, add this
collateral
- apply the CR ratio against
rune_burnt
, mint this in rune, add thisrune_minted
- swap the rune minted to TOR, add this
debt
- swap the TOR to the desired asset, then send to the address specified
/{pool}/borrower/{address}
{
"owner": "bc1qcxssye4j6730h7ehgega3gyykkuwgdgmmpu62n", // address
"asset": "BTC.BTC",
"debt_up": "1679500000", // total debt ever received
"debt_down": "1119172486", // total debt ever paid back
"collateral_up": "298483", // total collateral ever given
"collateral_down": "198901", // total collateral ever received back
"last_open_height": 6382841, // last time a loan was opened
"last_repay_height": 6383201 // last time a loan was closed
}
/{pool}
{
"loan_collateral": "99582", // total loan collateral open for this pool
}
Close
Example Memo
LOAN-:BTC.BTC:bc1YYYYYY:minOut
- ID the lender by the address
- The asset provided is swapped to RUNE, to TOR, then the amount reduced from their
debt
. - Anything excess of their debt is added as a credit to their next loan.
- The pro-rata share of the debt paid back (against their total debt), is converted to collateral share, then priced in RUNE, then this is minted.
collateral_to_unlock = (debt_paid_back / debt) * collateral
rune_minted = getRUNEValue(collateral_to_unlock)
- This minted RUNE is then swapped to their collateral type and sent to lender.
TOR
Existing implementation:
- median price of stables added by mimir
- virtual pool depth is sensitive to preceding swap fees generated (manipulation)
- virtual RUNE-TOR swap fees burn rune
Mimirs
-
PauseLoans
ability to pause opening/closing loans -
LoanRepaymentMaturity = 0
specifies how long a loan must be open before it can be closed -
CRmin
andCRmax
in basis points -
LendingLever = 3333
in basis points, determines the risk profile the protocol is willing to take