THORChain is a decentralized network which makes it possible for people to swap digital assets in a "permissionless" way. These digital assets include Bitcoin, Ether and Binance Coin which live on different blockchains. These assets will be swapped in a "permissionless" way, meaning that there is no central company or organization saying which assets can and cannot be swapped.
THORChain aims to do this using only—
Continuous Liquidity Pools (CLPs) are at the heart of THORChain. They tie the price of "external" assets – that is, assets which are from networks other than THORChain – in a "deterministic" way. Deterministic means that when you swap an asset what you get is set by a formula, making it predictable. This means that the value of external assets is linked to the value of the native asset, RUNE. So as the value of external assets goes up, so does the value of RUNE.
A unique feature of CLPs is that they provide price feeds which cannot be manipulated. This means THORChain doesn't need to rely on prices from outside the network. This is good because external price feeds have been a problem for other DeFi projects.
RUNE is used as a "settlement asset". This means whenever you swap an asset on THORChain it passes through RUNE. For example, if you're swapping from BTC to ETH, the value passes through RUNE. RUNE is also used as a security deposit for nodes.
To stay safe, the cost of attacking a network like THORChain must be higher than the value of capital it is taking care of. If you can attack the network for less than you gain then the network is not safe.
There are 3 main models which could be used to secure THORChain – Proof of Authority, Proof of Work and Proof of Stake. Proof of Authority, like Blockstream uses, has an uncertain security model. It's based on trusting a central body. If something went wrong, Blockstream would lose its reputation but this is intangible and not a reliable source of protection. The other alternative is Proof of Work which is used for the Bitcoin network. Proof of Work wouldn't work for THORChain because it's too difficult to tie the value of securing external assets with that of securing the network. This is because the cost of securing the network is measured in offline, less tangible assets like mining equipment and electricity. What's more, a Proof of Work network would be much less efficient.
So THORChain is a Proof of Stake network. The costs to attack the network are based on how much raw financial capital it would take, not on how much reputation would be lost or how much computing power could be mustered. The network is pushed in the right direction by rewarding and punishing different actions in the people taking part.
To make sure its assets are safe, THORChain needs 3 things—
THORChain achieves 1 and 2 using Continuous Liquidity Pools. It achieves 3 using a reward system, the Incentive Pendulum, to keep the balance of assets correct – at the Optimal Capital Distribution.
Network Native Asset this means RUNE.
Bonded Capital this means the total amount of RUNE which nodes have locked in the system to be able to take part.
Pooled Capital this is the total value of assets placed in Liquidity Pools. It includes both RUNE and external assets.
Pooled External Assets this refers to all the assets which have been added to Liquidity Pools, excluding RUNE. Equivalent to Pooled Capital minus Pooled RUNE.
The THORChain system has 3 assumptions which are important to its success—
Assumption 1 – Irrational Actors
THORChain assumes that there may be actors on the network who want to take it down. These actors don't want to take it down to make money, but for others reasons. They'll spend money to take the network down even if they lose that money. An example of this type of actor is a national-level government.
The network can be stopped in 2 cases. Firstly, if blocks are not being added to the blockchain. Secondly if assets are stopped from being sent out of the network by affecting TSS signing sessions. This would mean that the network's swapping service is offline, that nodes cannot get their bonds and rewards back etc.
Assumption 2 – Colluding Actors
THORChain also assumes that there are actors who are trying to steal assets from the network. These "colluding" actors communicate with each other. They become nodes and work together to send assets out of the system to themselves.
Assumption 3 – RUNE Value
THORChain assumes that RUNE has value because of the role it plays on the network.
RUNE enables people to swap assets. If those assets are stolen then RUNE can no longer be traded for those external assets. The colluding actors cannot sell their bonded RUNE.
If RUNE is stolen it immediately loses its value.
The Optimal Capital Distribution is when the value of Bonded Capital is equal to or higher than Pooled Capital. So if the value of Bonded Capital falls below the value of Pooled Capital, the system is unsafe. It is unsafe because at this point nodes can steal more value than they have bonded – it is profitable to steal.
Only 67% of nodes need to work together to steal all the assets. Given this, the system is safe up until 60% of RUNE is bonded and 40% is pooled.
This situation is helped by the fact that Secondary Vaults only contain 50% of assets. So if 67% of nodes are attackers, they only ever have access to 5/6 of the total assets. This brings the point of safety back down to 50% RUNE bonding.
Having said this though, if the secondary market somehow adds additional value to RUNE, this could increase the Safety Threshold again. THORChain estimates that up to 10% could be added in the secondary market. To protect against this and provide a buffer, the system increases the Safety Threshold on top of the 50% described above to require 67% RUNE bonded, 33% pooled.
The system collected income from Liquidity Fees and Block Rewards. When you add Liquidity Fees to Block Rewards, you get System Income – all of the income that the network generates.
Liquidity Fees come from the Slip-Based Fee that Swappers pay whenever they make a swap. The Slip-Based Fee is a fee charged on how much their swap causes the price of the asset to go down. Liquidity Fees are given as Liquidity Rewards to Liquidity Providers and Nodes.
Block Rewards are paid whenever a block successfully gets added to the blockchain. They're paid to Nodes for taking part in consensus.
The Incentive Pendulum decides how to split the System Income between Liquidity Providers and Nodes. That starts as a 67%/33% split. After costs are considered the system wants 50% of System Income to go to Liquidity Providers and 50% to go to Nodes.
This balance can be affected by the cost that Nodes and Liquidity Providers bear in contributing to the network.
Nodes spend money to run the network software. This is estimated to cost about $1,000 per month. Nodes also need to have technical expertise to run the network software. The graph below shows potential margins over 36 months post-launch for Nodes based on the following assumptions—
Given these assumptions, nodes can expect a margin of 30% 3 years after network launch.
Liquidity Providers have little real-world cost. But they do bear a cost in what's called Impermanent Loss.
Impermanent Loss relates to the difference in price when you put funds into a liquidity pool and the price when you take them out.
With THORChain, Impermanent Loss is expected to be about 10% per year. This is based on these assumptions—
These are estimates, and there seems to be a slight discrepancy on the RUNE assumptions.
The costs between Nodes and Liquidity Providers are different. So to keep the final distribution of System Income at the desired 50/50 split, Node Rewards must be higher than Liquidity Rewards. Specifically, Node Rewards should be 67% of System Income and Liquidity Rewards should be the remaining 33%.
The Optimal Capital Distribution is when Bonded Capital is roughly equal to Pooled Capital.
To maintain this balance, the system uses an Incentive Pendulum.
The are 2 types of imbalance that can happen—
In this situation the system is unsafe because the cost to Nodes of stealing assets is lower than the benefits.
To rebalance the system, the Incentive Pendulum—
As more Nodes bond more RUNE, Bonded Capital goes up. As fewer people provide liquidity, Pooled Capital goes down.
In this situation the system is inefficient. A lot of value is being put to work in securing the network, but there isn't enough value to make it worthwhile.
To rebalance the system, the Incentive Pendulum—
As fewer Nodes bond, Bonded Capital falls. As more people provide liquidity, Pooled Capital goes back up.
This behaviour is driven by the following formula—
Here are some different situations—
Note that "Staked Native Assets" – that is Pooled RUNE – is a proxy for Pooled Capital here.
The Inefficient and Unsafe extreme situations are unlikely to happen. Most of the time the network will be in the Over-Bonded situation, especially if it become easier to run a node.
Nodes get Bond Rewards for their work.
When a Node joins the network the current block number (AKA block height) is recorded. When they leave the system calculates the number of blocks they were active for.
Every block the system sets aside Bond Rewards. Every block it also creates one Block Unit for every active Node. When a Node leaves, it cashes in its Block Units for a portion of the Bond Rewards. Then those spent Block Units are destroyed.
For example, there are 1000 RUNE in Bond Rewards outstanding. Node A has been active for 30 blocks, and has 30 Block Units. There are 1000 Block Units in total. Node A leaves the network and cashes in its 30 Block Units. It receives 30 RUNE, leaving 970 RUNE in Node Rewards. Its 30 Block Units are destroyed, leaving 970 Block Units.
This is how the system keeps track of which Nodes are owed what.
Nodes are penalized for bad behavior. To keep track of penalties the system simply deletes Block Units.
Penalizing Nodes for Stealing From Secondary Vaults
If assets are stolen from a Secondary Vault all Nodes taking care of that vault are penalized.
For example, say a Secondary Vault has 3 Nodes taking care of it. It needs at least 2 Nodes to approve a transaction to send assets out. To prevent these Nodes from stealing, if they are caught all 3 must lose 50% of the value of the stolen assets.
To illustrate why this works, take a Secondary Vault which contains $2 worth of assets. 2 out the 3 Nodes who are taking care of the vault work together to steal all the assets. The system finds out they stole the assets and all 3 Nodes are punished. They are charged 50% of the total amount of stolen assets each, so $1 each – 50% of $2. So a total of $3 is recovered. This means that the full $2 is recovered, plus an extra $1. The extra $1 is added to given to Liquidity Providers of that pool.
This way, Nodes are discouraged from stealing assets.
Liquidity Providers receive rewards for providing liquidity. These are called Liquidity Rewards.
The system calculates Liquidity Rewards each block. It adds all the Liquidity Fees up for that block. Then it divides them up according to the Liquidity Pool they were earned in.
If there are no fees the system pays out based on the amount of value in a pool. In this situation if you are a Liquidity Provider in a very "deep" pool, that is a pool with a high asset value, then you will receive more rewards.
Assets are sent out of THORChain for various reasons – when Swappers swap assets, when Liquidity Providers remove assets from a pool etc.
The network helps pay for these outgoing transactions. The payment comes from the external asset pool for each chain. So the BTC pool pays for Bitcoin fees, ETH pool for Ethereum fees etc.
The network sees an outgoing transaction complete and records how much it cost in gas in the external asset. This cost is taken then taken from the external asset pool. Over time this is paid back into these pools from System Income.
The system charges a Network Fee on all transactions. It's a fixed amount. The Network Fee is calculated by taking a bunch of recent gas prices, getting an average, multiplying them by some number.
This makes is possible for THORChain to—
The Network Fee is collected in RUNE and sent to the Protocol Reserve.
If the transaction involves an asset which is not RUNE you pay the Network Fee in the external asset. Then the equivalent is taken from that pool's RUNE supply and added to the Protocol Reserve.
If the transaction is in RUNE then the amount is directly taken in RUNE.
The system rewards early behavior by giving out RUNE from the Protocol Reserve. It gives out 1/6 of the Protocol Reserve each year. The system aims to reach 2% annual inflation after 10 years. That assumed blocks are created every 5 seconds, and 6.3 million are created per year.
Swapping assets is managed by Continuous Liquidity Pools (CLPs).
During swaps, this makes it possible to have totally predictable output of assets and Liquidity Fees.
Liquidity Fees are collected as System Income and are split between Nodes and Liquidity Providers based on the Incentive Pendulum.
Liquidity Fees are paid in RUNE. If a Liquidity Fee is collected in an external asset, that asset is kept in the pool and an equivalent in RUNE is added to Liquidity Rewards.
Sometimes Liquidity Fees may be higher than the amount of Liquidity Rewards owed to Liquidity Providers. In this case, Liquidity Rewards are subtracted from Liquidity Fees to get the Liquidity Deficit. This Liquidity Deficit is paid to Nodes.
As Block Rewards fall over time the Liquidity Deficit will grow. You can think of it as a long-term fee that Liquidity Providers pay to Nodes for keeping their assets safe.
THORChain makes it possible to swap digital assets predictably and securely through decentralized economic incentives.
It does this only using information in its own blockchain, information from connected blockchains and incentives from giving out its own asset, RUNE.
It has very few assumptions or easy points to attack.
As long as the network has more Bonded Capital than Pooled Native Capital it is safe. The system uses an Incentive Pendulum to keep the ratio of Bonded Capital and Pooled Native Capital safe and efficient. That is, roughly 50% RUNE bonded and roughly 50% pooled.