Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
A high-level overview of what THORChain is, does, encourages, and pursues.
THORChain's design renders no need for wrapped or pegged assets. Instead, the protocol deploys what are called continuous liquidity pools (CLPs), which—with highly complex algorithms—maximise the efficiency of its transactions. These CLPs allow for THORchain to manage funds directly in on-chain vaults, and it secures those funds via an economic security model. For all this, THORChain might be best described as a "cross-chain automated market maker (AMM), like Uniswap", or even a "decentralised Binance".
Building on the foundation of liquidity pools, THORChain pursues two important financial primitives:
Created with the first principles of decentralisation, resistance to capture, and sustainability, the THORChain protocol includes several novel innovations:
3-Day Validator Churning: eliminates validator stagnation, proves spendability of funds, and upgrades the network—all with minimal governance
Asynchronous Network Upgrades: allows validators to upgrade to a new protocol version in their own time; network upgrades occur without ever breaking consensus
Chain-agnostic Bifrost Protocol: handles UTXO, EVM, BFT and Cryptonote chain connections with minimal core-logic nuances
Incentive Pendulum: streams rewards to Validators and Liquidity Providers to target a Network Security ratio that ensures funds are always secured
Continuous Liquidity Pools: allow single-sided liquidity provision, use liquidity-sensitive or "slip-based" fees to resist price attacks
Swap Queue: orders swaps based on price impact in each block, stopping sandwich attacks and most other forms of Miner Extractable Value (MEV)
THORChain contributors work towards three goals:
Security: Perpetually improve the security of the network, via either Functional Security—e.g., Solvency Checker, Node Pause, TxOut Throttler; Procedural Security—e.g., THORSec, Stagenet testing, PR reviews; or Economic Security—e.g., bonded RUNE value
Liquidity: Perpetually increase the liquidity of the network by incentivizing users to deposit into liquidity pools, thereby increasing the network's Total Value Locked (TVL)
Volume: Improve the volume of the network via swap UX and wallet integrations (Quotes Endpoint, Dev UX, BD)
To learn how THORChain works, feel free to jump here:
THORNodes are anonymous individuals who bond their RUNE to the network in order to provide validation services. As a fully permissionless network, THORChain allows anyone with the required funds to do this—all while maintaining user security. To further elevate network security, THORChain maintains a high churn schedule for these validators, every three days kicking out the oldest, slowest, and lowest bonded. This high-churn model ensures that THORChain remains resistant to centralization, capture, and censorship.
Each individual THORNode is comprised of several independent servers in a cluster, which run full-nodes for each connected chain. Initially intended to max out capacity at 100 nodes, the protocol is able scale to 250+ nodes.
THORChain is an open-source, public project with a vibrant and growing ecosystem. Whether you’re a user, an interface developer, or an app builder on top of the network, there’s a way to get involved.
Interface developers are welcome to build wallets, dashboards, exchanges, and more that integrate with THORChain. You can monetize your apps through affiliate fees, earning up to 10% on swaps and liquidity actions. Focus on building great frontends and bringing in users — the protocol takes care of the rest.
THORChain is an independent, cross-chain liquidity protocol that operates as a Layer 1 decentralised exchange (DEX). Built on the , it utilises the CometBFT consensus engine, the Cosmos-SDK state machine, and the GG20 Threshold Signature Scheme (TSS) to execute its purpose, which is to allow users to swap native assets across multiple chains with zero reliance on centralised third parties. In doing so, it stands as one of the few exchanges that verifiably ensures transparent and fair prices for cross-chain swaps of native assets.
Allow a user to {Asset X on Chain A}, to {Asset Y on Chain B}.
Allow a user to RUNE across liquidity pools,
Developers can create innovative products that integrate with THORChain, including wallets, exchanges, and various services, monetising these efforts via (e.g., up to 10% in affiliate fees for swaps and liquidity additions). All that is needed is a focus on creating engaging front-end interfaces and attracting users.
Developers interested in integrating THORChain should read the , as well as the quick start guide for .
Capped Proof Of Bond: Validator selection keeps the network decentralised and high
Be part of the THORChain ecosystem by joining the . It’s the best place to ask questions, learn how things work, and discuss all things THORChain with other users, builders, and contributors.
Join the to collaborate with other interface developers and access tools, docs, and support. Also see our and quick start guides for .
For building secure and sustainable decentralized applications (dApps) and smart contracts on top of THORChain check out . You can also join the for developers to connect with core contributors and other app developers.
Roles within THORChain
In the THORChain ecosystem, there are four key roles that network participants may play:
Liquidity providers: these add liquidity to pools, earning fees for their temporary deposit
Swappers: those users who use THORChain's liquidity to swap assets ad-hoc, paying fees for the service
Arbitrageurs: expert traders who continually monitor and rebalance pools; still paying fees but with the intent to earn a profit
Node Operators who provide a bond and are paid to secure the system.
A single user may take on multiple roles simultaneously.
THORChain's value proposition for Swappers.
On THORChain, users can swap their digital assets for other digital assets. The network aims to give users access to:
A large variety of assets through cross-chain compatibility and simple asset listing
Superior user experience through open finance protocols and permissionless access
1-transaction access to fast chains (Binance Chain), smart chains (Ethereum), censorship-resistant chains (Bitcoin) and private chains (Monero).
THORChain manages the swaps in accordance with the rules of the state machine - which is completely autonomous. Every swap that it observes is finalised, ordered and processed. Invalid swaps are refunded, valid swaps ordered in a transparent way that is resistant to front-running. Validators can not influence the order of trades, and are punished if they fail to observe a valid swap.
Swaps are completed as fast as they can be confirmed, which is around 5-10 seconds.
Swaps on THORChain are made possible by liquidity pools. These are pools of assets deposited by Liquidity providers, where each pool consists of 1 connected asset, for example Bitcoin, and THORChain's own asset, RUNE. They're called Continuous Liquidity Pools because RUNE, being in each pool, links all pools together in a single, continuous liquidity network.
When a user swaps 2 connected assets on THORChain, they swap between two pools:
Swap to RUNE in the first pool,
Move that RUNE into the second pool,
Swap to the desired asset in the second pool with the RUNE from (2)
The THORChain state machine handles this swap in one go, so the user never handles RUNE.
There are two modes possible for THORChain's swap mechanism: A single swap, and a double swap.
Single Swap
A single swap occurs when a user swaps some native asset for an equivalent value of RUNE, or vice versa.
Example: RUNE<>BTC swap.
User RUNE —> sent into THORChain. Inbound gas paid in RUNE
BTC —> sent out from one of THORChain’s vaults to user wallet. Outbound gas is paid in BTC.
Double Swap
A double swap occurs when a user swaps some native asset for some other native asset (that is not RUNE). While the user only sees one transaction, there is actually an additional one that occurs internally within THORChain.
Example: BTC<>ETH swap
User BTC —>THORChain. Inbound gas paid in BTC
Once the BTC is received, RUNE in BTC pool —> sent to ETH Pool
ETH —> sent out from one of THORChain’s vaults to user wallet. Outbound Fee is paid in ETH
The output of a swap can be worked out using the formula
where
x is input asset amount
X is input asset balance
y is output asset amount
Y is output asset balance
The BTC.RUNE pool has 100 BTC and 2.5 million RUNE. A user swaps 1 BTC into the pool. Calculate how much RUNE is output:
This user swaps 1 BTC for 24,507.40 RUNE.
The cost of a swap is made up of two parts:
Outbound Fee
Price Slippage
Note that users who force their swaps through quickly cause large slips and pay larger fees to liquidity providers.
A deeper dive into the Liquidity Provider role
Liquidity providers contribute native, network-supported assets to the THORChain liquidity pools. They may deposit any number of assets they choose of any value, doing so for their chosen amount of time; in short, there are no restrictions to LPing other than the need to pay deposit and withdrawal fees. “As stated, these LPs are compensated for their temporary contributions with swap fees, which are dynamically affected by several factors.
Liquidity providers commit capital to pools which have exposure to underlying assets. Liquidity providers THEN gain exposure to the underlying assets in each pool. Since assets can be deposited freely, LPs will experience the volatility of those assets—whether positive or negative.
While LPs are paid liquidity fees, these remain dynamic and may not be enough to cover "Impermanent Losses", which occur when price changes happen. With their deposit, Liquidity providers are voluntarily and knowingly taking on this risk. Therefore, they should not assume they are guaranteed or entitled to receive a specific quantity of their assets back when they deposit; rather, they should expect to receive their fair share of the pool's earnings and final asset balances.
Liquidity providers must have assets to deposit and their assets must be native to a supported chain. There is no minimum amount to deposit in existing pools. However, new assets must win a competition to be listed – larger value deposits will be listed over smaller value deposits.
Liquidity providers must pay for security of their assets since security is not free. This "payment" is the requirement for liquidity providers to hold RUNE, which acts as a redeemable insurance policy whilst they are in the pool. Holding RUNE allows liquidity providers to retain an ability to economically leverage nodes to ensure security of assets. When the liquidity provider withdraws, they can sell their RUNE back to the asset they desire.
Liquidity providers are not subject to any direct penalties for misconduct.
The process of providing liquidity to THORChain pools is permissionless, non-custodial, and quite simple. First, a user—anyone at all—would deposit their asset(s) to the pool. They would remain in that pool for some amount of time, entirely of their choosing. When they wish to withdraw their pool share, they simply reverse the first step.
Liquidity can be added to existing pools at any time, increasing its depth and attracting swappers with low fees, for the deeper the liquidity, the more affordable the cost of the swap. With that said, deep pools generally have higher swap volume; this in turn generates more fee revenue for LPs.
Liquidity providers have two modes by which they can deposit assets: symmetrically or asymmetrically.
Generally, LPs are encouraged to deposit symmetrically. However, if the pool is already imbalanced, they should deposit asymmetrically; this helps the pool return to balance, which in turn improves the network as a whole, as well as making the pool more attractive to swappers.
Liquidity providers deposit their assets into liquidity pools and in return earn dynamic yield. Their earnings arrive both in RUNE and the deposited pool's respective asset—e.g., BTC/RUNE LP receives fees in BTC & RUNE.
When liquidity providers (LPs) deposit their assets into liquidity pools, they earn rewards over time. These rewards come in two tokens: RUNE and the asset paired in the pool (e.g. BTC in the BTC/RUNE pool).
Rewards are calculated every block.
Rewards are paid out when you withdraw your liquidity.
How rewards are calculated depends on whether there are any swaps (trades) in that block.
When a block includes swap transactions, the rewards are based on fees collected from those swaps. Pools that earn more fees get a larger share of the rewards.
Example: 1000 RUNE in rewards split based on swap fees:
If There Are No Swaps in the Block
If a block has no swaps, the rewards are based on the size of the pools. Larger pools receive a bigger portion of the rewards.
Example: 1000 RUNE in rewards split based on pool depth:
This ensures that yield is being sent to where demand is being experienced - with fees being the proxy. Since fees are proportional to slip, it means the increase in rewards ensure that pools experiencing a lot of slip are being incentivised and will attract more liquidity.
Liquidity providers earn a yield on the assets they deposit. This yield is made up of fees.
Fees are paid by swappers and traders. Most swaps cause the ratio of assets in the liquidity pool to diverge from the market rate.
Ownership % of Pool – Liquidity providers who own more of a pool receive more of that pool's rewards.
Swap Volume – Higher swap volumes lead to higher fees. Higher fees lead to higher rewards for liquidity providers.
Size of Swaps – Swappers who are in a hurry to exchange assets will tend to make larger swaps. Larger swaps lead to greater price slips and therefore higher fees.
Change in Asset Prices -- If the price of the assets change, then liquidity providers will receive more of one and less of the other. This may change yield if yield is being priced in a third asset, ie, USD.
Passive liquidity providers should seek pools with deep liquidity to minimise risk and maximise returns.
Active liquidity providers can maximise returns by seeking out pools with shallow liquidity but high demand. This demand will cause greater slips and higher fees for liquidity providers.
Depositing assets on THORChain is permissionless and non-custodial.
The ability to use and withdraw assets is completely non-custodial. Only the original depositor has the ability to withdraw them. Nodes are bound by rules of the network and cannot take control of user-deposited assets.
Liquidity can be added to existing pools to increase depth and attract swappers. The deeper the liquidity, the lower the fee. However, deep pools generally have higher swap volume which generates more fee revenue.
Liquidity providers are incentivised to deposit symmetrically but should deposit asymmetrically if the pool is already imbalanced.
When a user deposits assets into a liquidity pool, they are given ownership of Liquidity Units which represent a percentage of ownership of the pool. LUVI is a measure of the relative value of each liquidity unit and is independent of price.
Where:
The yield of a pool uses LUVI value data from the previous 30 days and extrapolates an APR if that performance is repeated over the course of a year. A period
parameter may be used to change the number of days of data that are taken into consideration.
Factors that affect LUVI:
Swap fees, block rewards, and pool donations increase LUVI and are the primary yield sources
An increase of the synthetic asset liability of a pool decreases LUVI
An increase in ASSET Depth
or RUNE Depth
of a pool increase LUVI
Changes in the ratio of ASSET Depth
and RUNE Depth
in a pool change LUVI
Changes in ASSET Price
or RUNE Price
do not necessarily change LUVI.
Alongside the obvious investment risks of any asset, with liquidity provision, there also comes the risk of impermanent (price-divergent) loss. The bigger the divergence of price between the two assets, the more you are exposed to impermanent loss.
When you provide liquidity in a liquidity pool, the two assets are bound together by the system because it will ensure that both sides of the pool have the same value. If the price of your deposited assets changes in the wider markets, then swappers will sell one side of the pool for the other. Thus your assets are continuously sold "on the way up" or "on the way down". In fact, your assets are sold at a price that is an average of the starting price and ending price. If you then compare your original deposited assets with what you finally get, you will think you "could have got a better price based on today's value"
This is called impermanent loss because the losses are only realised when you withdraw from the pool. If the ratio swings to 5x (25.5% IL) but comes back to the same ratio when you entered the pool and withdrew your liquidity at that time, you will not have suffered any impermanent loss. It is similar to traditional finance’s unrealized losses. However, when you withdraw your liquidity from the pool at any other time, the loss becomes real and permanent. The fees you earn are generally able to compensate for those losses, or you may experience no loss at all and withdraw well compensated for your time in the pool.
LPs are encouraged to provide liquidity in pools that they are bullish on, or neutral on (don't care what the final price is). If an LP provides assets in a pool that they become bearish on, then they will be emotionally affected by the price draw-down, and may pull their assets out and realise a permanent loss.
See an
Users can swap any assets which are on connected chains and which have been added to the network. Users can swap from any connected asset to any other connected asset. They can also swap from any connected asset to .
Learn more about how chains and assets get added to the network in .
See for further detail and the page below for broader detail on Continuous Liquidity Pools.
Step 2 is the internal swap from BTC:RUNE —> RUNE:ETH. See for more information on how swapping works.
All swaps are charged a network fee. The network fee is dynamic – it's calculated by averaging a set of recent gas prices. Learn more about .
The only direct cost to liquidity providers is the , charged for withdrawing assets (pays for the compute resources and gas costs in order to process outbound transactions). An indirect cost to liquidity providers comes in the form of impermanent loss. Impermanent loss is common to Constant Function Market Makers like THORChain. It leads to potential loss of liquidity provider purchasing power as a result of price slippage in pools. However, this is minimised by THORChain's .
Anyone can add liquidity to existing pools; the same goes for proposing new asset pools (this is done simply by depositing it—see for details). Once a new asset pool is listed, anybody can add liquidity to it. It is in this sense that THORChain is permissionless.
Just as with deposits, the ability to withdraw assets is completely permissionless and non-custodial. Liquidity providers can withdraw their assets at any time. Furthermore, only the original depositor has the ability to execute the withdrawal of their pool share. The network processes their request and the liquidity provider receives their ownership percentage of the pool plus the assets they've earned. A network fee is charged whenever assets are taken out of the network. These fees go into .
are economically incentivised to never manipulate user funds (i.e. they would lose more money than they would gain by doing so); they are bound by rules of the network and have less than zero economic incentive to take control of any user-deposited assets.
This change in the ratio of assets is called a 'slip'. A proportion of each slip is kept in the pool. This is allocated to liquidity providers and forms part of their yield. Learn more about .
Rewards come from THORChain's own . Reward emissions follow a predetermined schedule of release.
Rewards also come from a token reserve. This token reserve is continuously filled up from. Part of the token reserve is paid out to liquidity providers over the long-term. This provides continuous income even during times of low exchange volume.
See here for an of the process.
Incentive Pendulum – The Incentive Pendulum balances the amount of capital bonded in the network versus pooled. It does this by changing the amount of rewards given to node operators versus liquidity providers. Sometimes rewards will be higher for liquidity providers to encourage them to deposit assets; sometimes the opposite. .
Liquidity providers can propose new asset pools or add liquidity to existing pools. Anybody can propose a new asset by depositing it. See for details. Once a new asset pool is listed, anybody can add liquidity to it. In this sense, THORChain is permissionless.
Liquidity providers can withdraw their assets at any time. The network processes their request and the liquidity provider receives their ownership % of the pool along with the assets they've earned. A network fee is taken whenever assets are taken out of the network. These are added to .
The yield of a pool on THORChain is calculated using a metric called Liquidity Unit Value Index (LUVI) which can be viewed on .
Learn more about and
Example: calculates the APR of a pool with the previous 100 days of data rather than the default of 30 days.
For more information, see:
Pool Depth (RUNE)
Fees
Share (of Fees)
Rewards
Pool A
1,000,000
1000
33%
333
Pool B
2,000,000
0
0%
0
Pool C
3,000,000
2000
67%
667
Total
6,000,000
3000
100%
1000
Pool Depth (RUNE)
Fees
Share (of Depth)
Rewards
Pool A
1,000,000
0
17%
167
Pool B
2,000,000
0
33%
333
Pool C
3,000,000
0
50%
500
Total
6,000,000
0
100%
1000
An overview of the asset and its four key roles.
RUNE is the asset which powers the THORChain ecosystem and provides the economic incentives required to secure the network. RUNE has four key roles which are described below.
Liquidity (as a settlement asset)
Security (as a sybil-resistant mechanism, and a means for driving economic behaviour)
Governance (signalling priority on-chain)
Incentives (paying out rewards, charging fees, subsidising gas)
RUNE as a Settlement Asset
RUNE is the settlement asset for all liquidity pools, meaning that when a user pools their liquidity, a 1:1 ratio of RUNE:ASSET is required. This means the value of each native asset pool holds within it an equal value of RUNE. For example, a pool with $100,000 in BTC will necessarily hold $100,000 worth of RUNE. The reasoning for this is explained .
RUNE for Network Security
RUNE for Governance
By symmetrically adding liquidity to a staged pool, users vote for the pools they want to become active. The deepest pools (i.e. with the most liquidity) become active.
Since RUNE is pooled 50:50 alongside external assets in its pools, when the value of those assets increase/decrease, the RUNE pooled will also increase/decrease by being arbed out or in. The RUNE unit value may not change, but the quantity of RUNE in the pool does. This means the system is always aware of the value of the assets it is trying to secure - it's simply the quantity of RUNE in all its pools.
Once it is aware of the value of the assets it is securing, it can use incentives to ensure security of those assets.
Since RUNE is the pooled asset, incentives can be paid directly into each pool. This extra capital is owned by the liquidity providers, and over time, slowly "purchases" the paired asset via arbitrage. Thus RUNE liquidity incentives can drive real yield to LPs.
Without a native settlement currency, each asset would need to be pooled with every other asset, which would eventually result in hundreds of new pools to be created for just one new asset, diluting liquidity. Having RUNE as the base pair allows any asset to be guaranteed to swap between any other asset.
No. of Assets
(eg. BTC, ETH)
No. of Pools
(Arbitrary Pairs)
No. of Pools
(RUNE Pairs)
n
pools = (n*(n-1))/2
pools = n
12
66
12
24
276
24
100
4950
100
Sybil-resistance refers to the ability to prevent someone masquerading as many identities in order to overcome a network. Bitcoin uses Proof-of-Work (one-cpu-one-vote) to prevent a network take-over. Ethereum 2.0 will use Proof-of-Stake (32-eth-one-vote) to prevent a network take-over.
THORChain is a Proof of Bond network instead. THORNodes commit a bond in order to be churned in. However, this bond isn't just used to identify a node (give them a voting slot), it is used to underwrite the assets in the pools. If the node attempts to steal assets, then their bond is deducted to the amount of the assets they stole (1.5x), and the pools are made whole. Additionally, if nodes misbehave their bond is slashed, ensuring reliable service.
The Incentive Pendulum ensures that Nodes are incentivised to continually buy and bond enough Rune each time to maximise their gains - which is a maximum when there is 67% of RUNE bonded and 33% pooled in pools. If the pools are holding $100m in capital, then the value of RUNE in the aggregate bond is $200m. Thus all assets can be underwritten.
The bond is extremely liquid - any RUNE holder can immediately enter or exit their position since RUNE is the settlement asset in all pools. Thus, when a node churns in, the cost basis of their bond is known to them and not an arbitrary figure. This means a node bonding $1m in RUNE will never contemplate making a decision to steal <$1m in capital from the network, else they will lose overall.
While THORChain strives to be governance-minimal, there are some parts of the protocol that use committed capital to signal priority. This is the case for the asset listing process, where every few days a new asset can be listed as a pool. In a queue of standby assets, the one with the deepest commitment of RUNE is the one that is listed first.
Additionally, if a connected chain is no longer economically valuable, then all liquidity providers in that chain can leave. If a pool is empty, it will be delisted, and this will cause the network to immediately sever ties with that chain in a process call a "ragnarok".
THORNodes each occupy one of the 100 slots in the system can can vote on changing network parameters using a mechanism called node-mimir
.
RUNE is the native currency of THORChain and is consumed as transaction fees on the network. All swaps are charged both a fixed network fee, as well as a dynamic slip-based fee. This prevents various attack paths such as denial-of-service attacks, as well as sandwich attacks on a pool. Learn more about fees here:
The network continually consumes gas as it makes outgoing transactions (as well as internal transactions). Gas on networks such as Bitcoin and Ethereum becomes complicated fast, so THORChain doesn't make much of an effort to track every minutia of gas consumed. Instead, nodes are free to use at-will the base assets BSC.BNB
, ETH.ETH
, BTC.BTC
, etc in order to pay for gas. These assets are used directly from the vaults. THORChain then observes outgoing transactions, reports on the gas used, and then pays back the liquidity providers in those pools to the value of twice the amount of gas used (in RUNE).
After fees are charged and gas is subsidised, then THORChain computes the block reward, divides it based on the Incentive Pendulum algorithm, and then pays out to Bonders and Liquidity providers.
This drives Nodes to bond the optimal amount, and pays Liquidity providers for their contribution of liquidity.
Learn about the Incentive Pendulum here:
In addition to the roles mentioned above, RUNE’s price has two factors; 1 a deterministic value based on the liquidity within the network and 2; a speculative premium.
This 2:1 bond:stake ratio, combined with the 1:1 pool ratio, means that the amount of RUNE needed in the network is three times the amount of the non-RUNE assets locked. Thus, if $1,000,000 worth of non-Rune tokens are staked in THORChain, the market cap of RUNE will be at least $3,000,000. And like any token, stock, or asset in the world of finance, speculation around future value encourages additional upward price pressure.
The 3:1 ratio is just the minimum or the deterministic value of RUNE.
Node Operators
THORNodes support the THORChain network. While the initial design target is 100 nodes, the network can scale to over 250+. The design goal of THORChain is such that anyone can join the network with the required funds (permissionless) and be anonymous, yet still be secure. THORChain takes this a step further by having a high churn schedule, kicking out nodes continuously. This high-churn network ensures that it is censorship-resistant, evades capture and resists centralisation.
Each THORNode is comprised of several independent servers in a cluster, which run full-nodes for each connected chain. All THORNodes communicate and operate in cooperation to create a cross-chain swapping network.
Node Operators earn 67% of the system income when it is stable. You can read more here:
Follow these setup up instructions
Node Operators should stay anonymous and never socially signal that they are running a node.
There are a variety of tools available in the ecosystem for Node Operators, such as the Telegram Alerts bot:
The most important aspect is that Nodes must pay for their Bond, since this is a core assumption to the security of the network. If a node pays $1m for their bond, then they will never try to steal assets unless if they can access more than $1m of funds. If they can, then they will make a profit.
If delegation was permitted, a Node Operator that paid $100k in RUNE, can possibly receive $900k in delegated funds to qualify and meet the $1m bond requirement. They will now contemplate stealing assets the moment they get access to more than $100k in capital, which is likely.
Nodes must pay for their bond to ensure the economic assumptions of the network are upheld.
THORChain makes private delegation possible, because it does not erode towards the issues discussed above.
Private Delegation requires Node Operators to know and whitelist in their bonders, and there can only be up to 100 per node. This assumes the bonders are in trust circles with their operators and have their own recourse to ensure operators act in accordance to their obligations. From the point of view of THORChain, a solo node is no different to a delegated node. The network will operate identically.
In addition, there is no discretion as to fee commissions per operator. This means bonders will prioritise on engaging with operators based purely on their trust circles, not fees.
Introduction of concepts that help make sense of how THORChain is uniquely able to provide the services it does.
Automated market makers (AMMs) are decentralised exchanges (DEXs) that rely on users to voluntarily deposit network-supported assets into what are called liquidity pools—this is called liquidity pooling. Each supported asset has its own dedicated liquidity pool; these algorithmically price its respective asset, also providing the liquidity for the exchange's transactions.
By depositing their capital into the asset-specific pools, these Liquidity Providers (LPs) become owners of a proportional share of that pool for as long as their assets remain deposited. In exchange for contributing liquidity to the network, LPs earn rewards, which are distributed regularly. These rewards come directly from swap fees paid by swappers.
While each AMM carries distinct design mechanics with regard to its liquidity pool functionality, all generally aim to offer their users deep liquidity, low transaction fees, and 100% uptime for as many users as possible. THORChain is no different in this regard.
Unlike other AMMs, THORChain is unique in that it offers swappers the ability to seamlessly swap native assets on their native blockchains. It offers this in perhaps the most decentralized, trustless, permissionless way available. It is precisely for these reasons (and more) that THORChain is the functional backend for many user interfaces.
Key features of THORChain are:
Native Asset Swaps: Swap Layer 1 assets across multiple chains—e.g., native BTC to ETH swap
Permissionless: No user registration is required; send a transaction & THORChain will execute it
Decentralized Pricing: Gives transparent, fair prices without reliance on centralised third-parties
Supports App Layer development via Cosmwasm Smart Contracts
THORChain offers two decentralized and permissionless services:
THORChain governance is deliberately minimal. It decides which chains and assets are listed, and when the protocol gets upgraded.
THORChain aims to have as little governance baked into the system as possible. This is done so that nodes don't communicate or learn who one another are. This is important for security because it makes sure that nodes don't act together to take control.
THORChain governance decides:
which assets are listed/delisted
which chains are listed/delisted
when the protocol gets upgraded
the economic limit – how many nodes can participate
Users signal which assets they want on the network by staking in a new pool. THORChain will realise it is a new asset it hasn't been seen before and create a new pool and place it in bootstrap mode. This is a normal asset pool except swapping is disabled on it. Every few days the networks looks at all the bootstrapping pools and lists the one with the highest value.
Assets are delisted when all liquidity providers have taken all their assets out of it, or its pool depth drops too low. The logic is:
When a new bootstrap pool is enabled, its depth is compared with the depth of the smallest active pools.
If it is deeper, the smallest active pool is placed back into bootstrap mode, and the new pool replaces it.
The process is repeated to re-list an asset.
When the community wants to support a new chain
THORChain developer community decides whether or not to approve it
If approved, the code gets tested and validated by core developers
If accepted, it gets added to THORNode software
Nodes upgrade their software as they are cycled off and back onto the network
When 67% of nodes are running the new software, the new chain is connected
To delist, nodes stop watching a chain. When 67% are no longer watching, it gets removed. A process begins and the assets of that chain are returned to their owners.
Developers from the community submit Architecture Decision Records (ADR) which are then voted on by node operators. An ADR should provide:
Context on the relevant goals and the current state
Proposed changes to achieve the goals
Summary of pros and cons
References
Changelog
Emergency changes are difficult to coordinate because nodes cannot communicate. To handle an emergency, nodes should leave the system. When the number of nodes falls below 4, funds are paid out and the system can be shut-down. This process is called Ragnarök.
There are only so many nodes who can participate on the network. This is because there's a minimum bond amount and a fixed supply of Rune. If the system is ever found to be always under-bonded or over-bonded, the minimum bond limit can be changed.
Mimir is a feature to allow changes in the constants of the chain, such as MinimumBond, ChurnSpeed and more.
There are two types of mimir
Node Mimir: set by each node. Once 2.3rds have set a mimir, it is enacted. Only active nodes have their votes counted
Balancing pools to exploit price deltas between markets.
Prices on THORChain are maintained by profit-seeking traders. Traders find assets that are mispriced between markets. They buy assets on markets with low prices and sell them on markets with high prices. This earns them a profit.
Traders compare the exchange rates on THORChain with the rates on external markets. If they find the price is lower on THORChain they can buy there and sell on an external market. If they find the price is lower on external markets they can buy there and sell on THORChain. This process is repeated at high-frequency. Over time, price information propagates and THORChain settles with external markets.
This is how THORChain avoids the need for oracles and how prices are set.
A swap takes place in the BTC/RUNE pool. This leaves the pool unbalanced. The ratio on THORChain is 20:1 BTC:RUNE, but is 16:1 on external markets. This means that RUNE is undervalued on THORChain.
Traders can now buy cheap RUNE on THORChain and sell it for a profit on external markets. To do so, they swap BTC into the pool and get RUNE out. They sell this RUNE on external markets and make a profit.
Specifically, each rebalancing trade should be 40–50% the imbalance size. So if the imbalance starts at $100 in value, the first rebalancing trade should be between $40–50. This will leave the imbalance at $50–60. The next rebalance should be $25–30. This process repeats until a satisfactory balance is restored.
Trading profits are impacted by liquidity on THORChain and on external markets. As an example, if the price of the asset in a THORChain pool is $1.20, but the same asset on an external market is $1.00, then someone can buy off that external market and sell into the THORChain pool for profit.
If both markets are infinitely deep, then the following will occur:
Buy on External Market for $1.00, no price slip.
Sell on THORChain for $1.20, no price slip.
Total Profit: 20%
The trader can then continue to arbitrage for a profit of 20% continuously.
If both markets have finite liquidity, but one is much deeper than the other, then the one of the markets will slip in price after the trade. However, the trader will experience a price that is roughly the average of the price before and after the trade:
Buy on External Market for $1.00, no price slip.
Sell on THORChain for $1.20, realised price of $1.10, price slip to $1.00.
Total Profit: 10%
After the trade, there is no more price differential, but the trader made 10% in profit. The trader has made the pool price equal to the secondary market. They have transferred price information from one market to another.
If both markets have low liquidity, then the trader is attempting to make trades that slip each market towards each other:
Buy on External Market for $1.00, realised price of $1.05, price slip to $1.10.
Sell on THORChain for $1.20, realised price of $1.15, price slip to $1.10.
Total Profit: >10%
The market now has no more price differential. The trader has made each market equal to each other.
THORChain does not offer explicit incentives to traders – it does not reward or punish them. Trading profits are determined by the capacity of traders to seek out and capitalise on price differentials between THORChain and external markets.
The majority of arbitrage opportunities will be exercised by software bots. These are under development by 3rd party entities and will be released in due time. They will be open-source and available for anybody to run.
THORChain's native token is called , and it is carries a fundamental utility within each facet of THORChain's operational infrastructure, as well as the larger ecosystem. Specifically, it fills three key roles:
Node Operators must always have bonded twice as many RUNE as there is RUNE pooled. This ensures the protocol will remain solvent in perpetuity. In bonding this much capital, node operators are economically incentivised to work within the . Thus it through economic security that network security is achieved.
An introduction to RUNE and its roles is .
AMM Design: maximise network efficiency
: Cross-chain swaps between native assets—e.g., from native BTC (on the Bitcoin blockchain) to native ETH (on the Ethereum blockchain)
: Depositing and withdrawing native assets to provide liquidity
Neither service requires participants to hold the RUNE token. All that is needed to use THORChain is to choose from the several that have integrated with THORChain.
That said, users may very well wish to interact with the token. Whether a user wants to hold RUNE, deposit into LPs symmetrically, and/or into a THORNode, they will need a wallet that supports RUNE (). Once the user has successfully obtained a RUNE-supporting wallet, they can acquire RUNE. To do so, users can swap for RUNE from THORChain directly using any of these . They may also choose to acquire RUNE from supported centralized exchanges.
For platform-specific instructions or support with an interface, it is best to get in touch with them via their —this also goes for troubleshooting and user support.
➜ For further reading, see:
Community developers write a new Bifröst module and propose it via a
The ADR process is defined and ADR status is listed .
Admin Mimir: set by admins to override constants during testing. Admin-mimir can't control funds, but it can set parameters. Ultimately admin-mimir will be removed. Admin-mimir has a set exclusion list, values that cannot be updated by Admin, defined .
The economics of the mean that traders should aim to restore balance to the pool in a single trade. Rebalancing should be done incrementally. If larger rebalancing trades are attempted, arbitrage may not be profitable for traders.
THORChain Ecosystem is community-based and anyone can join.
All the following are community-run resources. There are no "official" channels.
Below is a list of active THORChain community projects. If you would like to be funded to build something in the THORChain ecosystem please build something then reach out.
Keystore Json/txt File - Password Encrypted File Supported by Many THORChain Exchanges
Describes the Emission Schedule from the Reserve to Nodes and Liquidity providers.
There are a maximum of 500M RUNE. All 100% was created at genesis and distributed via different mechanisms:
In return for capital: 5% (SEED) and 16% (IDO) were sold for capital to start the network and give it value. They took on risk to support the network.
In return for time and effort: 10% was allocated to a group of devs who worked since 2018. They took on risk to deliver the network.
In return for bootstrap participation: 24% was given to users who participated in the bootstrapping of the network.
In return for through-life participation: 44% has been placed in the Protocol Reserve to pay out to Nodes and LPs for the next 10+ years.
All vesting has been completed.
Block rewards are calculated as such:
So if the reserve has 180m rune, a single block will emit ~4.28 Rune from the reserve, which means half of that is awarded to the node operators. The rest is paid to liquidity providers.
The emission curve is designed to start at around 30% APR and target 2% after 10 years. At that point, the majority of the revenue will come from fees.
Native Transaction Fee: The Native THORChain transaction fee (0.02 RUNE) applies to transactions made on the THORChain blockchain for assets such as RUNE, Synthetic Assets, and Secure Assets. This fee represents the cost for processing transactions on the THORChain blockchain and is charged independently of any outbound transactions. Unlike outbound fees, which are applied to external-chain transactions, the Native Transaction Fee only applies to transactions made on the THORChain blockchain itself.
Outbound Fees: Fees collected from all outbound transactions to users, which vary depending on the asset type:
Native Outbound Transaction Fee: A fixed 0.02 RUNE is charged on RUNE and other native asset outbound transactions. This is the THORChain network native transaction fee covering the costs for processing the native outbound transaction on the THORChain blockchain and not an additional outbound fee.
Withdrawal of Reserve POL: Occurs when a RUNEPool addition replaces Reserve-backed POL or when a POL requirement is reduced.
Slashing Income: Derived from node bond slashes, particularly for failures during keygen or other operational breaches.
Gas Reimbursement:
Churn Gas Reimbursements: Covers migration gas costs during vault churns. These costs are reimbursed by the Reserve and factored into the ongoing adjustments of outbound fees to maintain a balance.
Non-Churn Gas Reimbursements: Reimburses gas costs for external-chain transactions (e.g., user-initiated outbound transactions). Over time, the total outbound fees collected for a given coin (including adjustments for surplus) are designed to equal the total gas reimbursements for that coin, which include both user-initiated transactions and churn migration costs. This reimbursement mechanism ensures that inflows from outbound fees balance the Reserve's gas reimbursement outflows on average, maintaining sustainability without accumulating an ongoing surplus.
Reserve Adding to POL: Occurs when there isn’t enough undeployed RUNE in RUNEPool to cover a withdrawal, requiring the Reserve to add RUNE to meet POL requirements. If sufficient undeployed RUNE is available in RUNEPool, no Reserve contribution is needed.
Block Rewards: Paid out to incentivise node operators and liquidity providers.
The Reserve balance is minimally impacted by gas reimbursements and outbound fees as these inflows and outflows are generally balanced over time.
POL funding prioritises RUNEPool, with the Reserve only stepping in as a fallback when RUNEPool cannot meet the need.
System income (e.g., fees from swaps) is immediately distributed to developers, burns, pools, and nodes, rather than being retained by the Reserve.
THORChain's Incentive Pendulum keeps the network in a balanced state.
The Incentive Pendulum controls the flow of system income between node operators and liquidity providers based primarily on the Effective Security Bond and Total Vaulted. However, it also accounts for the Effective Bond and the Total Pooled to ensure an equitable and stable reward distribution. This mechanism adjusts the rewards dynamically to maintain a balanced network by incentivising either bonding or pooling as needed.
Key variables to the Incentive Pendulum are:
Bond Hard Cap : The highest bond in the bottom 2/3 of active node operators to ensure no single node has excessive influence on the Total Bond.
Total Effective Bond: The sum of all active node operator's bonds up to the Bond Hard Cap. For each node, the bond amount added is capped by the Bond Hard Cap. This maintains a balanced and secure network by distributing bonding power more evenly among node operators.
Effective Security Bond. The sum of the total bond of the bottom 2/3rds active node operators.
Vault Liquidity: Sum vaule of L1 assets within all Asgard Vaults valued in RUNE. Includes Pooled L1s and Trade Account L1s.
The capital on THORChain can lose its balance over time. Sometimes there will be too much capital in liquidity pools; sometimes there will be too much bonded by nodes. If there is too much capital in liquidity pools, the network is unsafe. If there is too much capital bonded by nodes, the network is inefficient.
If the network becomes unsafe, it increases rewards (block rewards and liquidity fees) for node operators and reduces rewards for liquidity providers. If the network becomes inefficient, it boosts rewards for liquidity providers and reduces rewards for node operators.
THORChain can be in 1 of 5 main states:
Unsafe
Under-Bonded
Optimal
Over-Bonded
Inefficient
These different states can be observed through the relationship between bonded RUNE and Vaulted Liquidity, reflecting the amount of RUNE bonded by node operators, the amount of liqudity held in the Asgard Vault within or outside the of the liquidity pools.
In the optimal state:
Effective Security Bond is roughly double the Vault Liquidity.
Total Effective Bond is roughly 1.5 times the Effective Security Bond.
Total Pooled RUNE represents approximately two-thirds of the Vault Liquidity.
This results in:
An approximate 67% to 33% split between the Total Security Bond and pooled RUNE.
A 50% to 50% split between the Total Security Bond and Vault Liquidity.
The system may become unsafe. In this case, vaulted capital is higher than bonded capital. Vaulted Rune is now equal to the Effectivity Security Bond – a 50/50 split.
This is undesirable because it means that it's become profitable for node operators to work together to steal assets.
To fix this, the system increases the amount of rewards going to node operators and lowers the rewards going to liquidity providers. This leads to more node operators getting involved, bonding more Rune and increasing bonded capital. This also disincentivises liquidity providers from taking part. They receive less return on their investment, so they pull assets out and reduce the amount of pooled capital. With time, this restores balance and the system moves back towards the optimal state.
The system can also become inefficient. In this case, vaulted capital would be much lower in value than bonded capital. This is a problem because it means that much more capital is being put into securing pooled assets than those assets are actually worth.
To fix this, the system increases rewards for liquidity providers and decreases rewards for node operators. This attracts more liquidity providers to the system, and fewer node operators. Liquidity providers add more capital to receive more rewards, increasing pooled capital. Some node operators remove their bonded Rune, seeking more profitable places to put their capital. Bonded capital falls. In this way, the system returns to the optimal state.
The under- and over-bonded states are less severe intermediary states. Being under-bonded is not a threat in itself because it is not yet profitable for node operators to steal. Being over-bonded is not a problem in itself because the system is still operating quite well.
The THORChain team does not expect the unsafe or inefficient states to come up often. The system will be in the over-bonded state most of the time, particularly as it gets easier for people to run nodes.
The algorithm that controls the Incentive Pendulum is as follows:
effectiveSecurityBond
Sum of bottom 2/3 of node operators' bond
totalEffectiveBond
Sum of all bonds counting up to the hard bond cap
vaultLiquidity
RUNE value of L1 assets in the Asgard Vaults
pooledRUNE
Total RUNE in all Pools
totalRewards
Check Security Bond: No payments to liquidity providers when the effectiveSecurityBond
is less than or equal to the vaultLiquidity
:
Determine the Initial Share of rewards for node operators based on the vaultLiquidity
and effectiveSecurityBond
:
Calculate Base Pool Share after allocating the baseNodeShare
to node operators:
Adjust Node and Pool Shares:
Adjust the Node Share if totalEffectiveBond
exceeds the effectiveSecurityBond
so Nodes are rewarded up to the Bond Hard Cap:
Adjust Pool Share based on the ratio of pooledRUNE
to vaultLiquidity
as non-pooled liquidity is not yield-bearing:
Aggregate the adjusted shares for both node operators and liquidity providers:
Calculate the final amount of rewards allocated to liquidity providers and node operators, ensuring it does not exceed the totalRewards
:
Liquidity Providers are paid the finalPoolShare
and node operators are paid the remainder. However, the income received is based on the liquidity they provided.
Yield Adjustment based on Liquidity Provided
Ensure the yield (rewards per unit of liquidity) for liquidity providers and node operators is balanced, taking into account the total effective bond and the vault liquidity:
Yield for Node Operators:
Yield for Liquidity Providers:
This ensures that the rewards are balanced according to the liquidity provided, maintaining the desired incentives for both liquidity providers and node operators.
Values are:
totalEffectiveBond
99,000,000 RUNE
effectiveSecurityBond
66,000,000 RUNE
vaultLiquidity
33,000,000 RUNE
pooledRUNE
22,000,000 RUNE
totalRewards
1,000 RUNE
Check Security Bond:
Since effectiveSecurityBond
(66,000,000 RUNE) is greater than vaultLiquidity
(33,000,000 RUNE), we proceed with the calculations.
Determine the Initial Share:
Base node share calculation:
Calculate Base Pool Share:
Adjust Node and Pool Shares:
Adjusted node share calculation:
Adjusted pool share calculation:
Aggregate the Adjusted Shares:
Calculate the Final Amount:
Since adjustmentRewards
(1,083.33 RUNE) exceeds totalRewards
(1,000 RUNE), we cap the rewards:
Final pool share:
Final node share:
Yield Adjustment:
Yield for node operators:
Yield for liquidity providers:
Final rewards for liquidity providers: 307.69 RUNE
Final rewards for node operators: 692.31 RUNE
Node yield: 6.993x10^-6 RUNE per RUNE
Pool yield: 6.993x10^-6 RUNE per RUNE
In this stable state, node yield matches pool yield meaning the system is in equilibrium based on the liquidy provided. This ensures that the rewards are balanced according to the liquidity provided, maintaining the desired incentives for both liquidity providers and node operators.
As a by-product of the Incentive Pendulum's aggressive re-targeting of the 50:50 yield split between node:pool yield, the system aims to maintain an equilibrium where the value of BONDED RUNE is proportionally aligned with the value of Vaulted RUNE. This ensures that:
For every unit of POOLED RUNE, there is approximately around 3 times that amount in effectiveSecurityBond, creating a balance that maintains network security and efficiency.
As POOLED RUNE is paired 1:1 with pooled assets (due to liquidity pools), the total market value of RUNE is targeted to be three times the value of the pooled assets.
There is sufficient bond to secure the non-pooled assets.
Describes the different security elements within THORChain
Note, THORChain and Binance Beacon Chain have near-instant finality so confirmation counting is not required.
To prevent large amounts of funds from leaving the network in an instant, large outbound transactions are throttled from immediately leaving the network. Each block has an outbound value limit (currently 1000 RUNE worth) and each outbound transaction has a maximum time limit that it can be processed. This has three effects:
Large outbounds to spread across multiple blocks, up to 720 blocks (approx one hour).
Ensures one large outbound request of $1,000,000 is handled the same as one million $1 outbound requests.
This serves as a defensive layer buying time and allowing a vigilant node operator to pause trading or automatically halt checks to engage before the large malicious outbound transaction is irreversibly executed and funds are lost. While the feature negatively impacts the user experience of THORChain, but it is necessary in ensuring the protection of liquidity provider funds.
The feature is designed to grow as the network grows and is controlled by several Mimir values that can be changed by Node Operators as required. Additionally, the feature is designed to promote bug disclosure instead of directly attacking the network as a bug disclosure is likely more profitable.
THORChain has different levels of halt controls within the network which are controlled by Mimir values or by nodes, depending on the type and level.
The halts that can affect an individual chain are:
Halt Signing- outbounds que
Halt LP - add/remove stopped, swapping allowed.
Halt Trading - no trading allows
Halt Chain - nodes stop observing that chain
The solvency checker of the network’s primary vault was introduced to catch issues early or prevent them before they happened. Detected issues can trigger an automatic trading halt on a specific chain. There are two types of automatic solvency checks:
If more than 66% of nodes, report an insolvency with a chain (reactive or proactive), trading for all assets on that chain is automatically halted (Halt{Chain}Trading). The halt will also emit a security event to ThorSec.
THORChain builds an awareness of balances purely by adding the incoming funds, then subtracting the outgoings. Thus the expected balance is the aggregate of the ins and outs. Divergences can occur when actual on-chain balances start to diverge. For gas assets (assets used to pay gas), small divergences can be intermittent, but normally less than +/- 1%.
Node Operators have the ability to halt trading within THORChain if they detect malicious activity. This is in addition to automatic chain-specific halting functionality. The ability has been made with the potential for abuse in mind.
How THORNames (TNS) work
THORNames allow anyone to register cross-chain wallet addresses to a 1-30 long string of hexadecimal characters which include special characters -_+
This makes them compatible to represent emojis ⚡️. THORNames are case insensitive.
Users use a special memo and a THORChain MsgDeposit
transaction to register their addresses. This then allows the system to lookup the name and retrieve the correct corresponding address for the specified chain.
A THORChain address can be assigned one (1) THORName to manage the other addresses associated. For example: the THORName chris can receive $BTC to the chris.btc address, chris.eth to receive $ETH and so forth. Wallet providers will easily be able to integrate to resolve cross-chain addresses for a user.
Currently, there are seven (8) native L1 chains available on THORChain: Bitcoin, Ethereum, Litecoin, Binance, Bitcoin Cash, Doge, Cosmos and BSC. THORNames are limited to 30 characters, including ^[a-zA-Z0-9+_-]+$
.
A THORName can be queried by going to /thorname/{thorname}
A THORName can be checked using /thorname/lookup/{thorname}
While there is no reverse on-chain reverse lookup, a reverse lookup is possible within THORChain via using a given THORName /thorname/lookup/{address}.
There is a one-time registration fee of around 10 RUNE, with a 20 tor
block fee, which works out to be around 1 RUNE annually. A user who pays 2 RUNE will then keep their name registered for 2 years. Fees are controlled by Constants/Mimir, the current settings are:
TNSRegisterFee
: 10 RUNE
TNSFeeOnSale
: 1000 Basis Points
TNSBlockFee
: 20 tor per block (roughly 1 RUNE per year)
Example: a 20 Rune registration registers the THORName for 10 years. (10 RUNE Registration Fee + 1 RUNE every year).
Memo template is: ~:name:chain:address:?owner:?preferredAsset:?expiry
Expiry is a block height that can be set in the past to unregister the THORName.
Bitcoin has a memo length limitation of 80 bytes and Monero has an address length of 97 bytes. This means swapping from Bitcoin to Monero is not possible using addresses, THORNames solves this issue and can also be used when specifying the affiliate address.
How THORChain has configured the CosmWasm module
Flexibility
Performance
Security
Sovereignty
THORChain offers developers maximum flexibility:
Programming Language Choice: Developers can use the programming language they prefer for building the state-machine, thanks to the ABCI (Application Blockchain Interface).
Framework Selection: Various frameworks are available, such as the Cosmos SDK (in Golang) or Lotion (in JavaScript), allowing developers to choose based on their preferred language.
Customizable Consensus Engines: Developers can swap or tweak the consensus engine to better suit their needs. Currently, CometBFT is production-ready, but more options will emerge in the future.
Tradeoff Exploration: Developers can adjust parameters like the number of validators vs. transaction throughput, or choose different storage models like DB or IAVL tree.
Automated Logic Execution: The Cosmos SDK enables automatic execution of code at the beginning and end of each block, providing further customization.
Cryptographic Flexibility: Developers are free to choose their cryptographic libraries, avoiding constraints imposed by underlying environments in virtual-machine blockchains.
This flexibility allows developers to create optimized, tailored solutions for THORChain, enhancing overall performance and adaptability.
THORChain, being an application-specific blockchain, provides several performance advantages:
Efficient Consensus: Using a consensus engine like CometBFT BFT offers higher throughput compared to Proof-of-Work blockchains.
Focused Resources: THORChain operates a single application, eliminating competition for computation and storage resources seen in non-sharded virtual-machine blockchains.
Reduced Complexity: Avoiding the need for a virtual-machine to interpret transactions significantly lowers computational complexity and boosts performance.
Application-specific blockchains like THORChain enhance security in several ways:
Proven Languages: Developers can use established programming languages like Go, which are more mature than many smart contract languages.
Custom Cryptography: Developers can implement well-audited crypto libraries, rather than relying on the limited functions available in virtual-machines.
Simplified Security: By eliminating the complexities of a virtual-machine, developers can more easily ensure the security of their application.
One of the major benefits of THORChain as an application-specific blockchain is sovereignty:
Full Control: Stakeholders have complete control over the chain, ensuring that governance and application requirements are aligned.
Responsive Upgrades: If bugs are found or new features are needed, the community can quickly act without waiting for the broader blockchain’s consensus.
Community Alignment: The community governing THORChain is directly aligned with the application’s stakeholders, providing a streamlined and responsive governance process.
How THORChain has configured the CosmWasm module
CosmWasm is a smart contracting platform built for blockchains that uses the Cosmos SDK, Simply put, it's the Cosmos (Cosm) way of using WebAssembly (Wasm) hence the name.
There would be a module placed into TC called x/wasm
and self-executing .rs
contracts are placed in it. These "contracts" would be whitelisted in via developers because they would go in via the 2-weekly upgrade cycle. They would be rolled out on stagenet for testing first, then flagged on mainnet after sometime.
Derived assets TOR
and L1 RUNE
will work easily. Notably, trade assets are missing because they are not assets, they are deposit slips.
What is Midgard in the THORChain tech stack
Midgard is a layer 2 REST API that provides front-end consumers with semi real-time rolled up data and analytics of the THORChain network. Most requests to the network will come through Midgard. This daemon is here to keep the chain itself from fielding large quantities of requests. You can think of it as a “read-only slave” to the chain. This keeps the resources of the network focused on processing transactions.
Websites: |
Socials: | |
Documentation: | | |
Development: | | |
Security: | |
Block Explorers: | | |
- Wallet and Exchange Client for THORChain
- Telegram Exchange Bot for THORChain
- Exchange Powered by THORChain
- Buy and Earn BTC, ETH, and More Fully Decentralized
- Cross-Chain DEX
- Multi-chain Liquidity Aggregator Powered by Li.Fi
- Redefining DeFi Trading
- A Dynamic AMM Infrastructure to BRC-20
- First Multi-chain DEX Aggregator
- Advanced, Hybrid CEX and DEX Aggregator
- A Multi-chain Liquidity Protocol
- World's First Multi-chain Dex Powered by THORChain
- Omni-chain Enabled Aggregator
- Payments Made Easy
- Cross-platform Mobile Application
- Open-source Crypto Wallet and Defi Wallet
- Your Keys. Your Crypto.
- Browser Extension Crypto Wallet with Built-In Swaps
- The Original Multichain Exchange
- Cross-chain Wallet & Dex, Mobile Wallet
- Best Crypto Wallet for Web3, NFTs and DeFi
- Cross-chain Wallet & Dex, Browser Extention
- Hardware Wallet Accessed via ShapeShift UI: The Next Frontier of Crypto Security
- Hardware Wallet with : The Smartest Way to Secure your Crypto
- Browser Extension Wallet: Multichain Snap for MetaMask
- Browser Extension Wallet: The Super Wallet for Web3
- A highly secure self-custodial multi-chain crypto vault with in-built two-factor authentication, and no tracking or registration requirements.
- Educational videos
- Educational, Feature-based Discussions
- Key stats and figures related to core Thorchain operations
- View your added liquidity on THORChain
- Track positions - https://decentralfi.io/liquidity?wallet={thor address}
- Useful commands to fetch network info
- Monitoring of major events in THORChain
- Contains key stats and figures related to core Thorchain operations.
|
- THORChain Network Explorer
- Detailed THORNode Dashboard
- Current THORChain Constants
- Overrides for Constants
- Documentation for Midgard API to query THORChain.
- Documentation for Thornode API to query Thornode.
- THORChain Block Explorer
- A library with a common interface for multiple blockchains, built for simple and fast integration for wallets and more, in JS. .
- By THORSwap offers a composable, user-friendly Partner API/SDK on top of THORChain's cross-chain liquidity protocol.
Client library to communicate with a THORChain App running in a Ledger.
- A library with a common interface for multiple blockchains, built for simple and fast integration for wallets and more, in PY.
- THORChain Arb Bot.
(only for dev discussions)
- Discord Server
- Discord Server
- Discord Server
- Discord Server
- Discord Server
- Discord Server
- Discord Server
- Discord Server
Russian:
Chinese:
Italian:
Portuguese:
French:
Spanish:
Dutch:
German:
Vietnamese:
Indian:
The and other modules can be viewed .
The exact distribution between node operators and liquidity providers (and therefore savers) is controlled by the .
Note: The is currently set to 10, meaning block rewards are next to 0 per block.
Layer 1 Outbound Fee: For external-chain assets (e.g., Bitcoin, Ethereum), this fee bundles the external-chain gas cost, gas pool swap fee, and THORChain network fee into a single charge. The overall fee is determined by the L1 gas rate and the for the respective chain.
Staged Pool Costs: Deduction from the stage pool to cover churn-related costs for the staged pools. These costs are determined by a Mimir-adjustable network variable .
Updated and detailed documentation on the Incentive Pendulum can be found in the .
: Sum of all RUNE bonded by active .
: Sum of liquidity in all by liquidity providers which also includes and .
It is important to note that yield is paid based on the liquidity provided and not on income share splits, as explained below in the section.
Try this of the Incentive Pendulum.
Total Block reward (fees + )
If there is any disruption to this balance, the Incentive Pendulum will reallocate rewards to correct the imbalance by incentivising node operators to bond more RUNE or liquidity providers to pool more assets. With the use of and users can play both sides of the Incentive Pendulum in order to maximise their return and help return the network back into equilibrium.
THORChain has several layers of security within the code base to ensure solvency of the network, stability of the protocol and minimise the impact of any exploit. These measures are in addition to human security efforts, see more information .
To protect against double-spend attacks and re-orgs (non-instant finality chains), THORChain users Confirmation Counting for specific chains when receiving incoming value. informs THORChain when to process the incoming value. How many confirmations are required is dependent on the size of the incoming value.
See more full details .
Each outbound transaction to compete for the next outbound block, else, it will be processed in the following block, effectively throttling the total outbound capacity of the network. This is independent of .
This feature is controlled by several values that can be changed by Node Operators as required. .
The team has created a dashboard to view delayed outbound transfers which is available .
There are also network level halts for trading, synths and lending. To get more information see .
Reactive: The network continually compares the assets the network believes it has in its primary vault (Asgard Vault) to what assets are actually stored in the network’s chain wallets. For every connected chain, each node compares the stored Asgard vault value to each chain Asgard Wallet amount. If the Asgard Vault value is more than the wallet value by 1%, the node reports insolvency for that chain. .
Proactive: This mode is more powerful and is intended to catch insolvencies even before they appear. When a node attempts to sign a txOut, it will do a calculation to check if by executing the txOut the vault becomes insolvent. If so, then it refuses to sign and reports insolvency. .
A single node can pause trading (HaltTrading) for up to an hour (720 blocks). Any additional node that calls for a halt will add 720 blocks to the halt timer. Any node that calls for the resumption of trading removes 720 blocks from the timer. The halt functions can only be called once by each active node per churn cycle (3 days). This gives the network the ability to respond to a malicious threat without giving any node unilateral control. .
This blanket protection will automatically pause THORChain on a specific chain (Halt{Chain}Trading) and stop Yggdrasill vault funding if an unauthorised transaction is detected. This will emit a security event and be sent to THORSec. The halt will allow Node Operators, THORSec, and the development team to investigate and react immediately following an unauthorised transaction and issue a fix and restore service as quickly as possible. .
Security events have been added within the code which automatically emits events when certain conditions are met such as node slashing for unauthorized transactions, attempted double-spending, or very large withdraws. Emitted events are sent to a THORSec Discord monitoring channel for immediate review. These emitted on-chain events can also be seen on Midgard. .
Website:
Example from
Example using a THOR address:
THORNames are created by sending a memo in a MsgDeposit with prefix: name
, n
or ~
Interfaces like allow you to create your own memo.
THORChain launched THORNames in June 2021, read more here .
The is an open-source toolkit for building multi-asset public Proof-of-Stake (PoS) blockchains, like the Cosmos Hub, as well as permissioned Proof-of-Authority (PoA) blockchains. Blockchains built with the Cosmos SDK are generally referred to as application-specific blockchains, like THORChain. There are multiple benefits from building an application-specific blockchain using the Cosmos SDK:
You can find more information about CosmWasm in their official .
is currently the most used programming language for CosmWasm, in the future, it is possible to have different programming languages like and Go.
All native tokens on THORChain listed would be supported in the Wasm TokenFactory (a wrapper that can push them into the WASM layer).
You can find more information about CosmWasm in their official .
Midgard is heavily used in dashboards and transaction scanners like , and . You find a full overview of the REST API endpoints on:
For more information see .
THORChain charges a fixed Outbound Fee and a dynamic Liquidity Fee.
Conceptually, fees are both value-capture, access-control and resource-subsidisation mechanisms.
The fees need to capture value from those accessing the resource, and pay it to those providing the resource, and in this case the resource is liquidity. However liquidity is relative to the size of the transaction that demands it over the depth of the market that will service it. A small transaction in a deep pool has less demand for liquidity than a large transaction in a small pool.
The other reason for fees is access-control; a way to throttle demand for a fixed resource and let natural market forces take over. If there is too much demand for a resource, fees must rise commensurately. The resource in this case is liquidity, not market depth, thus fees must be proportional to liquidity.
Every swap on THORChain consumes resources (Disk, CPU, Network and Memory resources from validators). These costs are fixed in nature. In addition, every outgoing transaction demands resources on connected chains, such as paying the Bitcoin mining fee or Ethereum gas cost. As such, THORChain charges a single flat fee on every transaction that pays for internal and external resources.
In addition to the above, fees also create the following benefits:
Avoid dust attacks
Store up income after the initial Emission Schedule reduces
Give the user a stable fee, rather than a dynamic one which changes with the external network's fees
THORChain maintains an awareness of the trailing gas price for each connected chain, saving both gas price as well as gas cost (inferring transaction weight). Nodes are instructed to pay for outgoing transactions using a gas price that is a multiple of the stored value.
The gas is consumed from each chain's base asset pool - the BTC pool pays for Bitcoin fees, the ETH pool for Ethereum fees etc.
The network then observes an outgoing transaction and records how much it cost in gas in the external asset. The final gas cost is then subsidised back into each pool by paying RUNE from the reserve.
A full overview of the THORChain fees:
Inbound Fee
Paid on every swap
Slip-based fee which is liquidity-sensitive
100% to Network participants intra-block
Outbound Fee - L1
L1 Outbounds
Ideally 1:1 gas spent, but a minimum of $1.00 is enforced to pay for TSS resources
Reserve
Outbound Fee - Native
RUNE, synth outbounds and trade assets
0.02 RUNE
Reserve
Network Fee
RUNE, synth transfers and trade assets
0.02 RUNE
Reserve
The CLP algorithm includes a slip-based fee which is liquidity-sensitive. Since demand for liquidity is defined as the size of the transaction over the depth of the market that will service it, then a fee which is proportional to liquidity solves key problems.
Firstly it has better value-capture when demand for liquidity is high, no matter the size of the transaction or the depth of the market. This means that over time, pool depths will settle to an equilibrium that is relative to the sizes of transactions that are passed over it. This solves the bootstrapping problem, because low-depth pools may turn out to be more profitable than high-depth pools to liquidity providers.
Secondly it has better access-control, since the more a trader (or attacker) demands liquidity, the more they have to pay for it. This makes sandwich attacks prohibitively expensive allowing pools to become reliable price feeds.
Additionally a slip-based fee is stateless and non-opinionated. The final fee paid is always commensurate to the demand of resources (both internal and external) no matter what it is.
This fee is retained on the output side of the pool, ensuring it counters the trade direction.
Streaming Swaps has greatly increased the swap capital efficiency. A minumum 5 pbs fee now applies to all swaps.
Any outbound liquidity incurs a fee to pay for the outbound gas cost and a network fee which is deducted from the outbound amount. The outbound gas will be sufficient for the outbound to be in the next block.
The network fee is collected in RUNE and sent to the Protocol Reserve. If the transaction involves an asset that is not RUNE the user pays the Network Fee in the external asset. If the transaction is in RUNE then the amount is directly taken in RUNE.
How THORChain has configured the IBC module
The Inter-Blockchain Communication Protocol (IBC) is a protocol that allows blockchains to talk to each other. Chains that speak IBC can share any type of data as long as it's encoded in bytes, enabling the industry’s most feature-rich cross-chain interactions. IBC is secure and permissionless.
An overview of THORChain's 1-way State Pegs, State Machine and TSS Protocol.
THORChain is a leaderless vault manager:
1-way State Pegs allow syncing state from external chains
A State Machine to coordinate asset exchange logic and delegate outgoing transactions
Bifröst Chain Client to process chain-specific transactions
A TSS protocol to enable distributed threshold key-signing
Each node has a "Bifröst" service that deals with the nuances of connecting to each chain. Once nodes are synced, they watch vault addresses. If they ever see an inbound transaction, they read it and convert it into a THORChain witness transaction.
The witness transaction has the following parameters that are essentially the same for each chain, no matter the type:
THORChain processes each observed transaction and waits for consensus. Once a super-majority of nodes agree on a particular transaction, it moves from a pending
state to a finalised state.
Each chain client is quite light-weight, containing only as much logic as is necessary to connect to that particular chain. Most of the logic is in the observer itself.
The state machine processes the finalised transaction and performs logic, such as ordering transactions, computing state changes, and delegating them to a particular outbound vault. Finally, a txOut
item is created and stored in the Key-Value store.
The txOut
looks like the following:
The Transaction Out item details which chain it should be sent on, the destination address, the vault it should be sent from, and the maximum gas that should be spent. It also has fields for the transaction that initiated it (the InHash
) and the transaction that will complete the accounting (the OutHash
).
Once the finalised transaction is created, the Signer loads it from their local copy and serialises it into a correct transaction for the destination chain using the respective chain client. This is then sent to the TSS module which coordinates key-signing. The final signed transaction is then broadcast to the respective chain.
There are two types of vaults in THORChain's system - "inbound vaults" and "outbound vaults":
Asgard TSS Vaults - inbound vaults with large committees (27-of-40)
Yggdrasil Vaults - outbound vaults with 1of1 single-signer
This allows the system to use the security of the large vaults to hold the bulk of assets, but delegate to the small, fast outbound vaults the outgoing assets. Every THORNode runs an outbound vault.
In order to further increase the node count to beyond 40 nodes, the system shards Asgard vaults into two when it approaches the MaxNodesForAsgard
constant (and merges them if two ever drop below half of this). As such, with 100 nodes, there would be 3 Asgard vaults, with 100 yggdrasil vaults. The system constantly checks which vault has the highest excess security, and instructs users to send funds there.
The state machine constantly monitors and tops up each yggdrasil outbound vault, limited to 25% of the value of its bond in assets. Thus if a node bonded $4m, then up to $1m in assets would arrive on its vault. These top up transactions are identified with yggdrasil+
memos.
When the node churns out, it automatically returns these assets back to Asgard with a yggdrasil-
memo.
Not all assets are funded to yggrdrasil vaults since it would split the funding up far too much. Instead, all pools with a depth less than minimumDepthForYggdrasil
keep their funds on Asgard vaults.
When the network churns, it creates new public keys and migrates the funds forward. The churning process is split up in 5 different transactions, 1 per asset (identified by migrate
memo). It typically takes a few hours to complete. Users are instructed to only send funds to the newest vault, but the retiring vault is monitored. Once the last of the 5 migrations is complete, the previous vault is discarded and no longer monitored.
If you send funds to a retired vault (likely by caching the address) your funds will be forever lost and is impossible to be recovered.
FAQ on how to run THORChain as a node operator
This FAQ is designed to help node operators coming to THORChain to set up and manage their nodes effectively on THORChain. Below you’ll find answers to common questions, key tips, and important warnings to ensure smooth operation.
Make sure you do not bond with the validator’s wallet. Unlike other "normal Cosmos chains", the first person to bond to the node owns the node. Ensure that you’re using the correct wallet, as ownership cannot be transferred after the bond.
THORChain handles external updates differently compared to Cosmos. When a Cosmos upgrade (e.g., using Gaia CLI or Ignite) occurs, you need to follow the specific THORChain process for node updates. Always refer to the latest node upgrade instructions in the documentation to ensure compatibility.
Common mistakes include not syncing to the top, going offline unexpectedly which can lead to being slashed for not observing. Regular monitoring, keeping your node updated, and ensuring that it remains synced with the network can help you avoid these issues.
Nodes can manually signal to exit the active validator set during the next churn by sending a MsgDeposit
with a LEAVE
memo. During each churn, the lowest bond, worst performer, and the oldest churned-in node get automatically churned out, along with any nodes that request to leave.
Most nodes impose a penalty for bond providers requesting early exit, which results in missed rewards. However, some nodes offer this service without charge. When a node is churned out, it no longer earns rewards, which means bond providers and node operators both miss out on potential earnings. Additionally, a bond provider cannot unbond while the node is active but can add more bond if desired.
Rewards for bond providers are auto-compounded back into their bond with each churn. These rewards remain locked until the node is churned out, at which point the bond providers can unbond and access their funds. Meanwhile, node operators receive their operator fee directly to their wallet each churn. For more details, you can refer to the following resources:
Slashes can happen for various reasons, including node downtime or failing to observe or sign transactions correctly. While some slashing is normal, consistent slashing could indicate a problem with your setup. Monitoring slash points and correcting any issues immediately is essential.
THORChain Frequently Asked Questions and Issues
Who founded THORChain?
It was founded in 2018 by a pseudo-anonymous core team of contributors, of which Chad Barraford is a member. Today Nine Realms has publicly taken over THORChain operations which is led by Gavin McDermott.
How many developers are there?
There are approx 8 core devs and 9 devs from Nine Realms working on the protocol. There are approx 40 devs + community members working within the ecosystem.
What are the Vesting and Allocation Details?
All tokens have fully vested since August 2023.
Directly on THORChain by swapping any supported asset for RUNE or exchanges like Binance list RUNE. Only RUNE is supported on THORChain.
Yes, there is a fee for every on-chain withdrawal from THORChain, whether it is a swap outbound, savings withdrawal, opening a loan, redeeming a collateral, or withdrawing from LPs.
The outbound fees that THORChain levies is 1.5x t0 3x the “fast” fee recommended for the respective blockchain, depending on network load.
The outbound fees that THORChain levies could be up to 2.5x the “fast” fee recommended for the respective blockchain.
How fast is THORChain?
THORChain uses Tendermint which is a classical BFT algorithm. 2/3 of the validators need to agree and the network values safety. The chain has instant finality and this is needed to secure cross-chain bridges.
What is TSS and how is it used to hold network funds?
Thorchain uses Threshold Signature Scheme (TSS) as a leaderless vault to hold funds within the network. TSS works like a multi-sig wallet but there there is no one or set of private keys that can be stolen. As a collective, all node operators work together to create a TSS vault and the super majority are required to sign a transaction for funds to leave the vault. Node operators need to bond more than 1.5x in bond the vault they can secure to ensure they do not collude to steal funds.
THORChain depends on its continuous liquidity pool design and arbitrageurs to set prices. When pools become imbalanced, arbitrage bots trade to rebalance them. THORChain knows the exchange rates between external asset pairs because RUNE binds all pools together.
Unbalanced pools represent a profit opportunity for arbitrage traders -- if a trader can purchase a token at a lower price on THORChain and sell it for a profit elsewhere, they will. These trades re-balance the pool and ensure that prices accurately reflect the market value. These pool-balancing trades happen 24/7 via arbitrage bots interacting with the protocol's API directly. It's even possible to run an arbitrage bot of your own!
If each pool is comprised of two assets (e.g. BTC:ETH) then there will be a scaling problem with n*(n-1)/2 possible connections. By having RUNE on one side of each pool, $RUNE becomes a settlement bridging asset allowing swaps between any two other assets. Additionally, having $RUNE in a pool ensures that the network can become aware of the value of assets it is securing.
Simply put, Cross-chain bridges are a better solution than Atomic Swaps. Atomic Swaps involve a complex process of signing cryptographic keys between two parties that require interactivity. You also need a counter-party on all trades. Cross-chain bridges, coupled with continuous liquidity pools means you don't need a designated counter-party, and swaps can happen in less than a second. 1-way state pegs are better than 2-way asset pegs because assets don't need to be wrapped or pegged. Instead of having IOU tokens, real native assets can be used instead.
THORChain is designed to minimize the risk of Miner Extractable Value (MEV), which is a common issue in many blockchain networks. MEV refers to the ability of validators or miners to manipulate the order of transactions within a block, such as front-running trades or causing liquidations. Here’s how THORChain is resistant to MEV:
Multi-Chain Architecture: Unlike Ethereum and other EVM architectures—where MEV is more prevalent due to the single-chain structure and longer block times—THORChain operates across multiple blockchains. This makes it nearly impossible to manipulate transaction ordering simultaneously across different chains.
Limited Node Control: Nodes in the THORChain network cannot reorder transactions—whether observed from external chains or internal. Their only power is to censor transactions, which further limits the potential for MEV. 2/3 of Nodes need to colloude to censor a transactions.
Liquidity Fee: Transactions with higher liquidity fees are prioritized.
Slip (Price Impact): Transactions with higher price impacts are given priority.
Scoring and Sorting: Each transaction is scored based on its liquidity fee and slip, and then sorted to determine the final order. This reduces the chances of MEV attacks like sandwiching.
Approximately every three days, the pending pool with the deepest liquidity is churned in (becomes an active pool). This is called a Pool Churn. Note: A pending pool must have a minimum 10K RUNE to be eligible for a churn.
This means there is an open decentralised liquidity competition where the community can vote with their liquidity. N.B. Caps will prevent voting with liquidity.
There is no contract address for RUNE, as it is the native asset on its own blockchain.
Make sure you have a sufficient amount of RUNE to process transactions. Also be sure to check if the liquidity caps are full. If so, you will not be able to add liquidity at that time. If you see errors like “No UTXOs to send” or “Need to wait for more UTXO confirmation”; likely you are trying to spend UTXO assets (BTC, LTC, BCH) that you have just transferred into your wallet. Please wait for more blockchain confirmations, and try again later!
THORYield is a 3rd party app, sometimes there is a lag between sync, so yes, it may display incorrect information. In this case use THORSwap to see what liquidity you have provided.
You can use THORChain’s keystore wallet seed phrase for xDefi, or TrustWallet. It uses the standard BIP39 mnemonic phrase, it is compatible with all multi-coin wallets and Ledger. Simply input the seed phrase and your wallet should be imported. If you are using Ledger or cold storage, it is recommended to create a new wallet.
Please be aware of the implications of inserting seed phrase previously used in hot wallets; into a cold hardware wallet.
This FAQ clarifies how THORChain has implemented the Cosmos tech stack and solved some of the most common problems faced by developers building on Cosmos chains
With many Cosmos chains running on various bridged assets, Cosmos teams often end up with multiple representations of the same asset, e.g. Axelar bridged BTC, Nomic bridged BTC, and wBTC bridged from multiple different layer 2s. This splits liquidity and causes significant user confusion.
THORChain will only have one bridged asset for per asset. E.g. ETH.ETH
on L1 will be represented as a bridged asset with ETH-ETH
.
With multiple node providers validating blocks around the world, the risk of node crashes that disrupts work flow, testing and live implementations can happen. Some teams resort to spending significant amount of time adding fairly complex fallback and retry logic in our backend Cosmos library to deal with the situation, but it still occasionally causes alerts to go crazy.
Most chains in the Cosmos ecosystem use the same public key hash method and derivation path, making their addresses convertible (works for Osmosis, Neutron, Juno, and Sei v1). Other chains attempt to keep Ethereum compatibility (Injective and Sei v2). The result is that addresses cannot be converted between these chains, which makes things like cross-chain incentivization difficult.
THORChain will have have addresses compatible with at least one other Cosmos chain as the "canonical chain". There is all work being done to try and link different wallet addresses together so that matching accounts can be found across many chains.
Many CosmWasm contracts quickly move beyond the default 800kb limit for a contract. The CosmWasm team has previously discussed bumping this limit.
THORChain will push on bumping up the contract limit to 1.5mb or more.
Having different settings between nodes for transaction size limits causes P2P sharing of mempool entries to sometimes get stuck. This can cause a node to be “starved” and none of the transactions broadcast to it to be picked up by the network. Levana’s workaround for this is quite involved:
They run a backend server, the querier, which provides a transaction broadcast endpoint
Their backend library has added support for an “all nodes broadcast,” where any broadcasts are sent to both the primary node and any fallbacks we’ve configured
Their frontends do not rely on the standard RPC interface leveraged by cosmjs, but instead have custom code to talk to the querier
Some Cosmos chains have had periods of high traffic, either due to roll-up syncs, large NFT mints, or direct attacks on the chain. Most Cosmos chains have no concept of MEV or fee markets. Osmosis has implemented a basic fee market system, but it was at least initially buggy, and only gate-keeps entrance to the memory pool. It does not prioritize transactions within the pool.
The Cosmos ecosystem generally uses CosmosKit for wallet integration. It’s a workable library, but has historically suffered from integration bugs, and the documentation has been poor. Furthermore, slight differences in behavior of different wallets has made broad wallet support difficult to achieve.
THORChain is actively working with wallets like XDEFI/Ctrl, Keplr and Leap to alleviate compatibility issues, yet its an iterative process where there will be back and forth.
Many Cosmos chains allow for multiple coins to pay for network/gas fees rather than just one. Having this option is suboptimal. As a recent example from Levana on Osmosis:
Governance contract lives on Osmosis
Governance token, LVN, is a native coin on Osmosis, and it can be used for gas fees
An option in the Levana governance UI allows users to stake the entirety of their LVN holdings
Keplr has on occasion selected LVN as the gas token to be used in such transactions, even when a user has another gas coin available
All simulations and checks within the Levana dapp will indicate that this transaction will succeed, since selection of gas coin occurs after our app initiates the signing process
Keplr provides no useful warning about the fact that more LVN will be used than are available in the wallet
Asset Notation within THORChain
THORChain is a liquidity protocol that is made up of multiple types of assets to provide the best experience for all types of users - from retail investors to professional traders to institutional investors.
To serve everyone, THORChain:
Ex: BTC.BTC
Native Assets are L1 assets (eg BTC) available on its native L1 (eg Bitcoin Network).
Ex: THOR.BTC
Ex: BTC/BTC
Ex: BTC~BTC
Savers Vaults are way to supply single-asset liquidity on THORChain. Any user can simply deposit native Bitcoin, earn in-kind yield, and withdraw their principal any time since they maintain full control of their keys.
Yield is variable and driven by swap fees, block rewards, pool depth, and the incentive pendulum. Annual percentage rates (APRs) are calculated using an extrapolation of past performance data from the last 30 days. Past performance does not guarantee or predict future results.
Yes. There are slippage fees paid on entering and exiting a Savers Vault. There is a 5 pbs for entry and exit fee for all savers position due to streaming swaps regardless of the size of the transaction.
Users can manage a THORChain Savers Vault positions through many interfaces. See Exchanges for a complete list.
Users can track their Savers Vault positions on any supported interface including:
RUNEScan.io
THOR Infobot
You should use THORChain Savings if you are planning on keeping your funds in the vault long enough for the fees accrued to offset the entry/exit costs, as well as the outbound fee(s) assessed when withdrawing.
Example: a user deposits 1 BTC in a pool 1000 BTC deep; thus pays a 0.1% slippage fee (1/1001) and is credited 0.999 BTC in the vault. If the pool is paying 3.65% APR, this is 0.1% earned every 10 days. Thus the user should plan to stay at least 20 days to pay for the entry and exit fee as a minimum. If the user does not stay long enough, they risk having the yield they earn not offsetting the fees paid to enter and exit the vault, thus causing them to experience a loss of principal.
Savers Vaults are not risk-free. Although Savers has been designed to mitigate risk, the possibility of loss cannot be eliminated completely. It is the user’s responsibility to be aware of the risks before entering a Savers Vault.
Yes, any person, service, or dApp can create a frontend interface to offer THORChain Savers Vaults to its users. Interested parties should review the THORChain Developer Documentation and contact Nine Realms.
Several factors affect the fee amount such as the gas rate and transaction size. See for more details.
The third fee to discuss is the Network Fee. This is what users pay to make transactions on THORChain ledger itself. Additionally, THORChain has custom gas logic where users pay fees in the asset they send, because all assets on THORChain have protocol pricing, either being RUNE, or synths, where synths are derived from the pools themselves. saw the introduction network of fees priced in USD. While still taken as RUNE or synths, the Network Fee is now set a USD amount instead of a fixed RUNE amount.
To get an overview of the adoption that IBC has seen, checkout to get a graphical representation of the different chains that has IBC enalbed and how many IBC transactions that flow between these chains:
You can find more information about IBC in their official .
Yggdrasil Vaults are deprecated since . Yggdrasil Vaults will slowly disappear as older nodes churn out. New nodes since ADR-002 will not have a Yggdrasil Vault.
Make sure to read and understand the before you setting up a node.
Node income includes block rewards and swap fees. Network income sent via the Incentive Pendulum and given to Node Operators. Block Reward / Node / Month can be viewed at , See more under .
Swap fees contribute significantly to node income. To estimate total income per node per month, consider both block rewards and swap fees. See to see the block reward and swap fee split.
Churning is the process by which nodes are rotated in and out of the active validator set. This happens approximately every 2 1/2 days. During a churn event, new nodes may be added to the network while others are removed based on criteria such as bond size, age, and behavior. See more in .
Node Operators can invite Bond Providers to contribute to their bond. Up to 10 Bond Providers can be added, and they will earn rewards proportional to their contribution. Operators can set a fee that is deducted from these rewards. Note that only the first wallet that bonds owns the node and can manage these providers. See more in .
•
•
•
Geth is used within the as it provides Go libraires where as Erigon does not provide a native Go interface for embedding directly into Go applications. Node operators should be prepared for the increased resource requirements when using Geth.
You can only unbond when your node is in a and not part of a vault migration. To leave the network permanently, you must issue a LEAVE command and ensure all vaults are empty. See for more information.
After ensuring that your node has successfully churned out and your bond is fully returned, you can destroy your node setup. This involves using specific commands to remove all node resources securely. Destroying a node prematurely can result in significant financial loss. See for more information.
The roadmap is detailed in the article.
Approx. 330M with a max of 500M. Full details at or for a breakdown of the RUNE supply.
The protocol is perdominally determined by the size of the reserve. The formula is: Reserve/EmissionCurve/BlocksPerYear/
, thus gradually decreases every block. In early 2024, with an active reserve of 83m RUNE, the dailyinflation is around 28.5k RUNE. See the for more information.
Swap fees are dependent on the depth of liquidity pools, the deeper the pools (aka the more liquidity) the less the fee is. Swap fee also depends on the size of the deposit. Bigger deposits incur more swap fees. See .
You can many interfaces to interact with THORChain. See .
See
You can watch it at
Since Jan 2024, has been enabled to optimise the Outbound Throttling.
See The outbound_fee_multiplier
pararamter in the
See
See .
See .
Standard Fee endpoint.
video.
Yes, the or the page.
Transactions Per Second (TPS), can go up to 5000 TPS, but are rarely seen. The highest number of swaps in one day was 100k swaps. Current transaction data can be seen at and
The Soft Cap has been removed, so there should be no limit to the amount of liquidity entered. There is a hard cap in place to ensure the total pooled cannot exceed the total bonded, making the network unsafe however the makes this cap near impossible to reach.
Ordered Swaps, Delays and Swap Queues: Transactions (swaps) on THORChain are carefully ordered and processed with inbound and outbound delays. THORChain uses a that organizes swap transactions within each block to minimize MEV. It prioritizes transactions based on two key factors:
The minimum bond is currently: 300K Rune () - Minimum Bond In Rune for current value.
The actual bond required is set by the market (node operators) - see the average bond at
There is a set max of 100 active pools, and once achieved, deeper pending pools will be able to replace shallowest active pools. See for more information.
➜
THORChain alleviates this problem by having anonymous nodes that validating blocks. The constant churn process keeps node operators on their toes and keeps the network running at optimal levels.
THORChain has defined that all nodes adhere to, and hence the problem of mempool entries getting stuck is solved.
On THORChain, congestion attacks will be less impactful because of the use of chain-native oracles. More on how THORChain addresses MEV in the .
THORChain addresses this by only allowing for to be used to pay network/gas fees
are Native Assets (eg BTC) available on another L1 (eg THORChain if THOR.BTC). This allows the Native Asset to be sent, received and swapped on another L1 than it's native L1.
THORChain are fully collateralized while they exist and switch to a 1:1 peg upon redemption. This unique design combines the benefits of over-collateralization and pegging, ensuring capital efficiency and stability. The system aims for 100% collateralization but can handle drops below this without losing the peg, using fees to regain balance. Collateral comes from liquidity pools, with 50% in the asset and 50% in RUNE, rebalancing as prices change. Minting involves swapping RUNE or the asset into its synthetic form using pool liquidity, maintaining equal purchasing power.
, a new class of primitives on THORChain, offer double the capital efficiency of synthetic assets, enhancing arbitrage and high-frequency trading. They settle with THORChain’s block speed and cost, enabling 6-second finality swaps without high fees. Redeemable anytime with no slippage, Trade Assets emulate centralized exchange trading but maintain on-chain transparency and security. Custodied by THORChain outside of liquidity pools, they provide user credits while holding funds 1:1 as L1 assets until withdrawal, making THORChain more user-friendly for active traders.
See for more informaiton.
All L1 Assets and Selected Stables. See full list at
See the developer quick start guide
How THORChain facilitates continuous, incentivised liquidity.
Provides “always-on” liquidity to all assets in its system.
Allows users to trade assets at transparent, fair prices, without relying on centralised third-parties.
Functions as source of trustless on-chain price feeds for internal and external use.
Democratises arbitrage opportunities.
Allows pools prices to converge to true market prices, since the fee asymptotes to zero.
Collects fee revenue for liquidity providers in a fair way.
Responds to fluctuating demands of liquidity.
Assuming a working Swap Queue, the CLP Model has the following benefits:
The fee paid asymptotes to zero as demand subsides, so price delta between the pool price and reference market price can also go to zero.
Traders will compete for trade opportunities and pay maximally to liquidity providers.
The fee paid for any trade is responsive to the demand for liquidity by market-takers.
Prices inherit an "inertia" since large fast changes cause high fee revenue
Arbitrage opportunities are democratised as there is a diminishing return to arbitrage as the price approaches parity with reference
Traders are forced to consider the "time domain" (how impatient they want to be) for each trade.
THORChain allows users to choose their preferred trade strategy:
Time-optimised: Get the trade done quickly, regardless of the cost.
Price-optimised: Get the best price possible, even if it takes longer.
Previously, swaps were always executed as soon as possible (time-optimised), without user control. Manual optimisation of prices required breaking up swaps into smaller ones, incurring L1 inbound and outbound fees for each swap, reducing cost savings.
Streaming Swaps gives users control over the timeframe, enabling better price optimisation. Large swaps can be divided into smaller ones over specific intervals without additional L1 fees.
Streaming Swaps (Price-Optimised) is similar to a Time Weighted Average Price (TWAP) trade, limited to a 24-hour period.
Two important parts are:
The interval allows arbitrageurs enough time to rebalance the pool within the swap, ensuring capital requirements are met throughout.
The count enables the swapper to reduce the size of sub-swaps, minimising slippage for each execution.
A price-optimised swap experiences less slippage compared to a time-optimised swap, without losing capital to on-chain L1 fees.
A fully price-optimised swap can achieve a swap fee as low as 5 basis points (excluding inbound and outbound fees).
Swappers can set a price limit (minimum output). If sub-swaps cannot achieve the specified price during the swap stream, the total or partial inbound amount will be refunded.
x
input amount
X
Input Balance
y
output amount
Y
Output Balance
Start with the fixed-product formula:
Derive the raw "XYK" output:
Establish the basis of Value (the spot purchasing power of x
in terms of Y
) and slip, the difference between the spot and the final realised y
:
Derive the slip-based fee:
Deduct it from the output, to give the final CLP algorithm:
Comparing the two equations (Equation 2 & 6), it can be seen that the Base XYK is simply being multiplied by the inverse of Slip (ie, if slip is 1%, then the output is being multiplied by 99%).
The simplest method to exchange assets is the pegged model, (1:1) where one asset is exchanged one for another. If there is a liquidity pool, then it can go insolvent, and there is no ability to dynamically price the assets, and no ability to intrinsically charge fees:
The fixed-sum model allows pricing to be built-in, but the pool can go insolvent (run out of money). The amount of assets exchanged is simply the spot price at any given time:
The fixed-product model (Base XYK above), instead bonds the tokens together which prevents the pool ever going insolvent, as well as allowing dynamic pricing. However, there is no intrinsic fee collection:
The Fixed-Rate Fee Model adds a 30 Basis Point (0.003) (or less) fee to the model. This allows fee retention, but the fee is not liquidity-sensitive:
The Slip-based Fee Model adds liquidity-sensitive fee to the model. This ensures the fee paid is commensurate to the demand of the pool's liquidity, and is the one THORChain uses. The fee equation is shown separate (12b), but it is actually embedded in 12a, so is not computed separately.
The slip-based fee model breaks path-independence and incentivises traders to break up their trade in small amounts. For protocols that can't order trades (such as anything built on Ethereum), this causes issues because traders will compete with each other in Ethereum Block Space and pay fees to miners, instead of paying fees to the protocol. It is possible to build primitive trade ordering in an Ethereum Smart Contract in order to counter this and make traders compete with each other on trade size again. THORChain is able to order trades based on fee & slip size, known as the Swap Queue. This ensures fees collected are maximal and prevents low-value trades.
When a liquidity provider commits capital, the ownership % of the pool is calculated:
units = newly created pool units for the liquidity provider
r = rune deposited
a = asset deposited
R = total Rune Balance (before deposit)
A = total Asset Balance (before deposit)
P = total Pool Units (before deposit)
The liquidity provider is allocated rewards proportional to their ownership of the pool. If they own 2% of the pool, they are allocated 2% of the pool's rewards.
Balances of the pool (X and Y), are used as inputs for the CLP model. An amplification factor can be applied (to both, or either) in order to change the "weights" of the balances:
a
Input Balance Weight
b
Output Balance Weight
If a = b = 2
then the pool behaves as if the depth is twice as deep, the slip is thus half as much, and the price the swapper receives is better. This is akin to smoothing the bonding curve, but it does not affect pool solvency in any way. Virtual depths are currently not implemented
If a = 2, b = 1
then the Y
asset will behave as though it is twice as deep as the X
asset, or, that the pool is no longer 1:1 bonded. Instead the pool can be said to have 67:33 balance, where the liquidity providers are twice as exposed to one asset over the other.
Impermanent Loss Protection ensures LPs always either make a profit, or leave with at break even after a minimum period of time (set at 100 days), and partially covered before that point. This should alleviate most of the concerns regarding become an LP.
THORChain tracks a member's deposit values. When the member goes to redeem, their loss (against their original deposit value) is calculated and is subsidised with RUNE from the reserve.
There is a 100 day linear increase in the amount of coverage received, such that at 50 days, the member receives 50%, 90 days is 90% etc.
R0
RUNE Deposited
R1
RUNE to redeem
A0
Asset Deposited
A1
Asset to redeem
P1
is the pool ratio at withdrawal.
The coverage is then adjusted for the 100 day rule.
Then the extra RUNE added into the member's liquidity position to issue them extra liquidity units. The member then redeems all their units, and they will realise extra RUNE and extra ASSET.
An overview of the technologies that make up THORChain
There are multiple modules and protocols that makes up THORChain. The tech stack can be broken down in the following key pieces:
1-Way State Pegs: Syncs state from external chains to THORChain using the Bifröst Protocol.
THORChain State Machine (TSS) protocol: Coordinates asset exchange logic, delegates transactions and enables distributed threshold key-signing.
Bifröst Chain Client: Processes chain-specific transactions.
RUNEPool is a feature of THORChain that allows RUNE holders to join the Protocol Owned Liquidity (POL). By participating, users get a share of the liquidity that Thorchain owns across all its pools, earning Annual Percentage Rate (APR) returns and improving the protocol's liquidity efficiency, supporting Thorchain's growth.
RUNEPool matches external capital with various pools in the system. It manages multiple pools, distributing RUNE across them to smooth out price curves and reduce volatility. This makes Thorchain products more attractive to investors.
PoL-Enabled Pools: Defined via the mimir key POL-{Asset}, enabling all eight native assets and five USD stable coins.
RUNEPool Units (RPU): Represent a pooler’s share in the pool. When redeemed, the holder's share of the total POL size in RUNE is distributed.
Impermanent Loss Management (IL): Users experience aggregate IL across PoL-Enabled pools, reducing risk compared to any single pool.
RUNEPool simplifies user experience by focusing on the Incentive Pendulum and fees generated from the pools, allocating funds based on yield. This abstracts away complexities and enhances decision-making for users.
RUNEPool gathers idle RUNE from centralized exchanges and custodial services, moving them into Thorchain's decentralized infrastructure to generate yield. This enhances asset productivity and builds up POL through community participation.
Multiple dashboards are available to track RUNEPool performance:
Create a Transaction: Use a MsgDeposit
transaction with the memo pool+
.
RUNE Only: RUNEPool only works with RUNE.
Create a Transaction: Use a MsgDeposit
transaction with the memo pool-:<basis-points>:<affiliate>:<affiliate-basis-points>
.
Minimum Term: You can only withdraw after the minimum term defined by RUNEPoolDepositMaturityBlocks
.
All Holders: Use the rune_providers
endpoint to see a list of all RUNEPool holders.
Specific Holder: Use the rune_providers/{thor owner address}
endpoint to view the position of a specific RUNEPool holder.
Aggregate IL: Users experience aggregate IL across all PoL-enabled pools, reducing individual pool risks.
Idle RUNE: Undeployed RUNE reduces yield but also limits exposure to impermanent loss.
The PnL can be split into Global (for all providers) and Individual:
Global PnL: The /thorchain/runepool
endpoint returns the global PnL of RUNEPool, including details for the reserve and independent providers.
Individual Provider PnL: The /thorchain/rune_provider/{thor_addr}
endpoint provides position information for a single provider.
Instead of limit-order books, THORChain utilises (CLP). The CLP is one of THORChain's most significant features, offering the following benefits:
The salient point is the last one - that a liquidity-sensitive fee penalises traders for being impatient, however traders have a . This is an important quality in markets, since it allows time for market-changing information to be propagated to all market participants, rather than a narrow few having an edge.
The Slip-based Fee Model adds liquidity-sensitive fee compared to the model. This ensures the fee paid is commensurate to the demand of the pool's liquidity, and is the one THORChain uses. The fee equation is shown below:
The size of the swap and the desired timeframe are related. Impatient swappers who opt for a time-optimised swap will incur higher . Patient swappers achieve better prices but need to wait.
As per Impermanent Loss Protection has been removed for all liquidiy providers.
= 1440000 // 100 days
: THORChain is a leaderless vault manager with several components:
: Midgard is a layer 2 REST API that provides front-end consumers with semi real-time rolled up data and analytics of the THORChain network.
: The Cosmos SDK is an open-source toolkit for building multi-asset public Proof-of-Stake (PoS) blockchains. There are multiple benefits from building an application-specific blockchain using the Cosmos SDK: Flexibility, Performance, Security and Sovereignty
: CosmWasm is a smart contracting platform built for blockchains that uses the Cosmos SDK, Simply put, it's the Cosmos (Cosm) way of using WebAssembly (Wasm) hence the name. With CosmWasm, teams can deploy smart contracts on THORChain directly
: The Inter-Blockchain Communication Protocol (IBC) is a protocol that allows blockchains to talk to each other. With 100+ blockchains having enabled IBC, THORChain can tap into a wealth of native tokens moving in and out of the network using IBC.
Instructions: Refer to the "" section in the documentation for detailed steps.
Instructions: Refer to the "" section in the documentation for detailed steps.
For more detailed instructions, refer to the .
How THORChain enables synthetic assets with single asset exposure.
THORChain synthetics are unique in that they are 100% collateralised when they exist but switch to being 1:1 pegged at the time of redemption. Other synthetic or wrapped asset designs are either over-collateralised or pegged, never both. This means they are either capital-inefficient (requiring over-collateralisation) or capital-sensitive (can depeg if <100% collateralisation). The advantage of THORChain's design is that the collateralisation is managed by the system on a best-effort basis to be aspirationally 100%. However, when the asset is redeemed, it switches to being pegged 1:1, which means they can tolerate going below 100% collateralisation without losing the peg. The deficit is regained by liquidity-sensitive fees on the redemption so that the last holders of the asset can achieve re-collateralisation.
The collateral for synthetic assets is constant-product liquidity, always 50% in the asset, with the other 50% in RUNE. As the price changes, the pool rebalances on the curve, having much stronger inertia than if it were 100% collateralised by the endogenous asset (RUNE). The price-shift is subsidised by the other liquidity in the pool.
Synthetic Assets are created by swapping RUNE (or the Asset), into its synthetic counterpart, using the pool liquidity depth. This process is identical if the asset was swapped into the L1 instead. Thus when minting, the pool treats both the synthetic and its L1 as identical in purchasing power:
r = rune deposited
R = Rune Depth (before)
A = Asset Depth (before)
The total Synth Supply is then updated:
In the above swap - an asset was added to the pool (the RUNE or ASSET), but none taken out since the swap output is minted from nothing. Thus the pool has extra liquidity that needs to be isolated from other LPs. This is the purpose of Synth Units.
Synth Units represent the liquidity collateral value that is required to "back" the synths 100%, and stops other dual-LPs from claiming ownership of it. They are computationally derived at any point which ensures there is exactly enough at any time to represent the outstanding supply.
The ratio of Synth Units to Liquidity Units should be the same as the ratio of synth supply to the total value of the pool without the synths (since LP units are all pool units without the synth units).
U = Synth Units (what needs to be isolated to back the synthS)
L = Liquidity Units (dual-LPs)
S = Synth Supply (the synths to be backed)
A = Asset Depth (the assets in the pool)
Synth Collateralisation is done aspirationally. If the total value of the liquidity in the pool drops below the total value of the synths, then Synth Units minted will go to infinity, diluting the dual-LPs to 0%.
Synthetic Assets are redeemed by swapping the Synth across the pool. The synth is swapped using the same formula as though it was an L1 asset, thus the synth has the same purchasing power to the L1. It is therefore pegged.
s = Synths to Redeem
R = Rune Depth (before)
A = Asset Depth (before)
The Synth Supply is thus decremented, and this in turn updates the oustanding Synth Units since it is computationally derived.
Synth Swaps can be done as follows:
Layer 1 to Synth: L1 in, Synth Minted
Synth to Layer 1: Synth REDEEMED, L1 swapped out
Synth to Synth: Synth REDEEMED, RUNE moved between pools, synth MINTED
To specify the destination asset is synth, simply provide a THOR address. If it is Layer 1, then provide a layer 1 address, e.g. a BTC address.
All swaps pay fees, and a synth Mint or Redeem to an L1 is two swaps. Thus 10.0 btc/btc swapped across a pool of 1000 BTC.BTC will receive 10 - ((10/1000)*10)*2 = 9.8
minus any outboundFees. Is the synth pegged 1:0.98? No, because the same holder could swap 10 BTC in 1.0 BTC increments and receive 10*(1 - ((1/1000)*1)*2) = 9.98
minus 10 outboundFees. Both outboundFees and liquidityFees as a function of the swap size can be controlled by the user.
The dynamic synth unit accounting is to ensure that gain or loss caused by price divergence in the synths is quickly realised to LPs. If Synths as a function of Pool Liquidity goes to 100%, then dual-LPs are diluted to 0%.
Due to synths, Liquidity Providers are taking a leveraged position on the RUNE asset today. This can help them earn more rewards if RUNE outperforms the asset, but can also go the other way. The higher the percentage of synths that exist on the network relative to pool depth, the higher the leveraged position Liquidity Providers are taking.
The network can monitor the synth utilisation on a per pool basis, and add liquidity (asymmetrically addition of RUNE) if utilisation is greater than cap - 5%
(if economic security allows). If synth utilisation is under this figure, then the reserve would remove liquidity (if the PoL has an LP position in this pool).
cap = e.g. 1500 (in basis points)
range = 500 (in basis points)
PA = pool asset depth
S = synth supply
By having the reserve add rune into the pool, it de-risks LPs from over RUNE leverage, as the reserve takes on some of that risk. The Reserve is long on its own (and only) asset. This, in turn, creates synth space in the pool, more synth minting and more single-sided asset deposits in the form of synths to enter.
If an active pool that minted synths becomes staged, then swaps are disabled. However, synth holders can always redeem for RUNE, or the underlying asset, by specifying that on the way out.
The network launched with a set number of constants, which has not changed. Constants can be overridden via Mimir and nodes have the ability to and change Mimir values.
Constant Values:
Mimir Values:
Value details has been moved to the developer docs .
Synthetic assets are no longer actively used within THORChain. Since 04 Jan 2025, the withdrawal of Synthetics has been disabled. See for more information.
This is the .
Synth Units are issued to cover the new liquidity minted, but held by the pool (not owned by anyone). Pool Units are therefore the sum of + synthUnits.
Due to this, the minting of synths is capped to an upper limit of the total pool depth to protect Liquidity Providers and the network. The setting MaxSynthPerAssetDepth
setting controls the cap which is the asset depth percentage.
With the addition of there can be a high demand for minting synths that exceed the cap with normal liquidity. See the original . POL has been introduced to deal with a high demand for minting synths while maintaining a safe synth minting limit by using the RUNE within the .
The risks, costs and rewards of running a THORNode
Deciding to run a node should be carefully considered and thought through. While the payoffs/rewards can be significant, there can also be an equally significant costs.
Running a malicious node or stealing from the network results in a slashing of this bond. Here are the ways in which a validator’s bond can get slashed.
Double Sign (5% of minimum bond) - if it is observed that a single validator node is committing blocks on multiple chains. To avoid this, never run two nodes with the same node account at the same time.
Unauthorised transaction (1.5x transaction value) - if a node sends funds without authorization, the bond is slashed 1.5x the value of the stolen funds. The slashed bond is dumped into the pool(s) where the funds were stolen and added to the reserve.
Bond slashing takes directly from the bond and does not affect rewards.
When a node is active, it earns rewards from the network in RUNE. Sufficient rewards are required to be earned in order for a Validator to be profitable. Running an unreliable node results in rewards being slashed. Here are the ways in which a validator’s rewards can be slashed.
Not Observing (2 slash pts) - if a node does not observe transactions for all chains, while other nodes do, they get slash points added.
Not signing a transaction (600 slash pts) - if a node does not sign an outbound transaction, as requested by the network, they will get slash points added.
Fail to keygen (1 hr of revenue) - When the network attempts to churn, and attempts to create a new Asgard pubkey for the network, and fails to do so due to a specific node(s), they will lose 1 hr of revenue from their bond.
Slash points undo profits made on the network. For every 1 slash point a node receives, they lose 1 block of rewards. Rewards slashing reduces earned rewards and does not affect a validator’s bond.
Node Operators receive rewards if they are bonded and active on the network and are paid out in RUNE. While revenue is generated every block (approximately every 6 seconds) to each operator, those funds are not available immediately. Rewards can be accessed one of two ways:
If no Node Operator fee is set, 100% of rewards will be accrued back to the bond after each churn. A Node Operator must then either LEAVE or wait until the node churns out to unbond principal or rewards.
When a node joins the network the current block height is recorded. The system creates one block unit for every active node for every active block, and has a running total of the block units created. When a node leaves, it cashes in its block units for a portion of the bond rewards. The spent block units are destroyed.
For example, there are 10,000 RUNE in bond rewards outstanding. Node A has been active for 30 blocks, and has 33 block units, but accrued 3 slash points. There are 1000 block units in total. Node A leaves the network and cashes in its 30 block units (33 - 3). It receives 300 RUNE ((30/1000) * 10000), leaving 9700 RUNE in node rewards. Its 33 block units are destroyed, leaving 967 block units left.
Income for one node can be estimated based on a few inputs:
Number of active nodes
Reward emission rate
% of rewards allocated to nodes, set by the Incentive Pendulum
Price of RUNE*
These inputs should be plugged into the following formula:
An example with mainnet day 1 inputs:
33 nodes
3.06 million RUNE rewards emitted per month
67% of rewards allocated to nodes (stable Incentive Pendulum)
Depending on how the node was set up, it will likely cost between $2,000 and $3,500 per month using a hosting provider, potentially more as the blockchain scales and more chain integrations are added.
The main driver of costs is resource allocation to hosting the fullnode daemons required for each of THORNode's chain integrations.
To run a node, you must obtain a significant amount of Rune, minimums . This RUNE is sent into the network as “bond” and held as leverage on each node to ensure they behave in the best interest of the network.
Loss of Node Operator Key: The first address to bond to a new node is known as the node operator address. This is the only address that can UNBOND a Node Provider's BOND. If the private key is lost, a Node Operator may lose control of their Node and provided BOND. See for more informaiton.
Setting a Node Operator fee in basis points, which causes rewards to be paid directly to the Node Operator address after each churn. See for details on how to set a Node Operator fee.
Node Operators earn rewards relative to their bond; the more they bond, the more they earn, up to the effective bond cap (the highest bond of the bottom 2/3rd active nodes). Over time, this incentive increases the median bonded amount, increasing the security of the network and allows the network to grow. below for more details.
Rewards are affected by the and the . Over time, the Emission Schedule decreases the amount of RUNE allocated to nodes. The Incentive Pendulum increases and decreases the amount of RUNE allocated to nodes according to the security and capital efficiency of the network.
If using a there will be an up front hardware cost and then electricity costs on going.
Each THORNode is comprised of 4 major components.
thornode
- this is a daemon that runs the THORChain chain itself and a HTTP server, that gives a RESTful API to the chain.
bifrost
- this daemon creates connections to remote chains (like Bitcoin, Ethereum, Binance, etc) to both observe activity on those chains (incoming/outgoing transactions), and also sign/broadcast outgoing transactions (moving funds on remote chains).
gateway
: THORNode gateway proxy to get a single IP address for multiple deployments.
Full nodes - for every chain that is supported by the network, each THORNode operator will run their own full node of each chain (Bitcoin, Ethereum, Binance Smart Chain, Avalanche, etc).
THORNode operators may choose to run the following service:
midgard
- a layer 2 REST API that provides front-end consumers with semi real-time rolled up data and analytics of the THORChain network. Most requests to the network will come through Midgard. The Midgard API keeps the chain itself from fielding large quantities of requests, allowing THORNode to focus on validating and propagating blocks across the network. You can think of it as a “read-only slave” to the chain.
<tc:1317>/thorchain
:
<tc:1317>/cosmos
:
<tc:1317>/bank
:
There are three key-materials on a THORNode.
Your operator key, which sends BOND, UNBOND, LEAVE transactions, and you can run this in any THORChain wallet, asgardex, thorswap, vultisig. You can remotely manage your node and this can UNBOND to get funds out if you brick it. If you lose this key you will lose access to your BOND.
All key material related to the Cosmos validator, which does not hold funds, and signs off on blocks, as well as posting in messages to the state machine. These messages are gas-free; the state machine actually will give the node address a free gas-unit. If you delete this key you will brick your THORNode, stop sending observations and accrue slashpoints. You will then get churned out 3 days later for bad performance and will probably lose 3 days of rewards. make relay
also uses it, as it proves it owns the node pubkey when signing.
Ensure you back up your node keys so it can be recovered.
See the following references for more information
It is critical backups are created matinaned, if there are any questions, reach out in the #bare-metal-nodes channel within the Dev Discord.
Every few years, THORChain conducts a hardfork. During a hardfork, THORChain's data is moved to an archive, and the chain begins running on a new chain ID. This process ensures that the blockchain continues to operate efficiently and scales with the network's growth.
Hardfork History:
ChainId = thorchain: Blocks 0 - 4,786,559
ChainId = thorchain-mainnet-v1: Blocks 4,786,560 - 17,562,000
ChainId = thorchain-1: Blocks 17,562,001 - Current
To construct the full history of THORChain, data from all three of these chain IDs are required.
Full Nodes: Full nodes only store the most recent blocks, including the latest block. They allow participation in the network and provide up-to-date data but do not maintain the complete historical data, this do not chain data form previous chains.
Archive Nodes: Archive nodes store the entire history of the blockchain, including data from all past blocks and hardforks. These nodes are necessary for retrieving historical data and providing a comprehensive view of the blockchain's state over time.
Separate Node for Each Chain ID: Each Chain ID requires its own node to be run. You cannot run multiple Chain IDs on a single node. To maintain or access the full history of THORChain, separate nodes must be configured for each of the historical chain IDs.
If you require the full archive node dataset, you will need to request it via THORChain's Discord community. Due to bandwidth costs and DDoS concerns, this data cannot be offered publicly.
Running a THORNode
As new nodes join/leave the network, this triggers a “churning event”. Which means the list of validators that can commit blocks to the chain changes, and also creates a new Asgard vault, while retiring an old one. All funds in this retiring vault are moved to the new Asgard vault.
On every churn, the network selects one or more nodes to be churned out of the network (which can be typically churned back in later). In a given churning event, multiple nodes may be selected to be churned out, but never more than 1/3rd of the current validator set. The criterion the network will take into account is the following:
Requests to leave the network (self-removal)
Banned by other nodes (network-removal)
How long an active nodes has been committing blocks (oldest gets removed)
Bad behavior (accrued slash points for poor node operation)
On every churn, the network may select one or more nodes to be churned into the network but never adds more than one to the total. Which nodes that are selected are purely by validator bond size. Larger bond nodes are selected over lower bond nodes.
Types of node status:
Unknown - this should never be possible for a valid node account
Whitelisted - node has been bonded, but hasn’t set their keys yet
Standby - waiting to have minimum requirements verified to become “ready” status. This check happens on each churn event (3 days on average).
Ready - node has met minimum requirements to be churned and is ready to do so. Could be selected to churn into the network. Cannot unbond while in this status.
Active - node is an active participant of the network, by securing funds and committing new blocks to the THORChain blockchain. Cannot unbond while in this status.
Disabled - node has been disabled by use of LEAVE while in standby, and cannot re-join.
A node can only unbond if they are in the Standby state and not apart of a vault migration during a chrun out. e.g. (their pub key is not a part of a singer membership).
When you run a THORNode, each THORNode will have its own node account. An example node account looks like this:
To get node account information, make an HTTP call to your thornode
port which will look like the following:
Or use https://thornode.ninerealms.com/thorchain/node/<node address>.
Most importantly, this will tell you how many slash points the node account has accrued, their status, and the size of their bond (which is in 1e8 notation, 1 Rune == 100000000).
Make Relay can be used to send messages into the #mainnet
channel of the Dev Discord. This allows Node Operators to communicate with Discord members without having post as a Discord user, helping to protect their identiy.
Usage: make relay "{
Message you want to send}
"
Bond Providers can contribute to a Node Operator's bond. Node Operators have the option to add and remove bond providers and set a node operator' fee.
How THORChain's USD-pegged stablecoin TOR works.
All collateral, debt and repayments within Lending are converted to and accounted for in TOR.
TOR is anchored to a basket of USD-pegged stablecoins, such as USDC and USDT. The value of TOR is determined by taking the median price of these active USD pools, ensuring it remains stable and closely pegged to $1 USD. This median approach ensures that TOR is the most stable among the stablecoins in its basket, mitigating the risk of price volatility from any single stablecoin.
There is a RUNE<>TOR mechanism that operates as a two-way burn process. When TOR is minted, an equivalent value of RUNE is burned, and conversely, when TOR is burned, the same value of RUNE is minted. This process ensures that the creation and destruction of TOR directly impact the supply of RUNE, maintaining a balanced and inflation-resistant system.
The depth of the TOR pool is calculated as the sum of all TOR pools. However, it is sensitive to market volatility. During periods of high volatility, the pool depth contracts to increase slippage for swaps, discouraging users from trading during these times and protecting the system from manipulation. Conversely, during stable periods, the pool depth expands, reducing slippage and encouraging swaps. This dynamic adjustment helps maintain the stability and health of the TOR pool.
TOR is used for accounting with THORChain and to price assets, instead of using any specific stablecoin. While TOR is currently non-transferable, greater use of TOR is a possibility.
Asset Type to Integrate into the App Layer
While ETH.tc is pictured, that may change to ETH-ETH
.
Secured assets are x/bank tokens on the App Layer (Rujira) representing claim to the native asset on base layer (THORChain).
The native asset is secured to and from the app layer with the following flow:
Example shows the mint and burn process for BTC
Examples below explain how a user:
Swap a Secured Asset (SA)—BTC—to another Secured Asset—ETH
Swap a Secured Asset—BTC—to a base asset—ETH
Secured Asset Swapping, swapping the L1 under the hood
Lending allows users to deposit native collateral, and then create a debt at a collateralization ratio with 0% interest, no liquidations, and no expiration.
Debt can be partially repaid, but a borrower will only receive their collateral back when the debt is repaid in full.
Overpayments are credited towards the next loan the borrower opens.
Yes, it is best to open and close loans during times of low volatility. To protect the network from price manipulation, virtual pool depths for lending shrink during times of increased volatility, meaning liquidity fees can greatly increase. Managing loans during times of low price volatility on THORChain will yield the most desirable results. Patient borrowers pay the least fees.
You will receive your full collateral back upon repayment minus slip-based liquidity fees incurred from the loan opening and closing process. During low volatility periods, fees will be lower. During times of high volatility, fees will be higher due to the constricting virtual pool depth.
The lending protocol is initially supporting BTC and ETH. The functionality to support lending on all Layer 1 gas assets on THORChain is already available and simply needs to be turned on by the validators.
Debt can be repaid with any THORChain-supported asset. Assets used to repay loans will be sold for TOR to repay the debt, since debt is denominated in TOR.
Yes. There is a 5 bps default fee.
In this design, if collateral falls below the debt value, it’s not problematic since the collateral, stored as equity (RUNE), is the liability. Liability grows only when the RUNE-ASSET price drops and the loan is repaid. Liquidating collateral poses individual loan risks, worsens user experience, and makes users monitor RUNE’s price, conflicting with design objectives. Rather than liquidations, the protocol can bear a slight rise in RUNE supply (around 15m or 3%) before activating a circuit breaker, pausing the lending feature. With the RESERVE covering remaining collateral payouts and unchanging loan terms post-circuit breaker, a rush-exit becomes less probable.
Interest rates generate income on collateral but make users more likely to repay loans. THORChain’s design thrives when users opt for long-term loans or never repay. A 0% interest rate, being highly attractive, means users seldom repay as their principal remains intact. Users incur slip-based fees upon entering or exiting positions, which boosts yield for network participants and permanently burns RUNE.
The protocol wants to attract as much exogenous capital as possible (L1 assets like BTC and ETH) since it converts them to equity (RUNE IOUs). Eg, $1bn in collateral stored means $1bn in bought RUNE, minus the amount of sold RUNE to debt at the collateralization ratio, (if it’s an aggregate 300%, then around $300m has been sold), with a total net buy pressure of $700m. This $700m in stored equity is the liability, and THORChain does not want to be called on this liability, since it would have to sell RUNE. Thus there is no expiry.
THORChain has strict rules on economic security. Value at stake by the validators must always be greater than the value of the assets in the vaults, measured in RUNE. Due to Protocol-Owned-Liquidity and Savers, the network is likely to max out pooled RUNE and send all yield to nodes. The protocol stops scaling until RUNE can be added to the bond module, but this takes time. The lending design buys and burns RUNE from the pools, directly affecting the relationship between liquidity and security. Whilst the loan was opened, it creates a net reduction in RUNE in the pools, allowing more TVL to enter. It also bids on RUNE, allowing security to increase, so the network can securely store more exogenous capital.
The THORChain protocol and all RUNE holders are the counterparty to each loan. The RUNE burn/mint mechanism means RUNE concentration/dilution effects (among all RUNE holders) as loans are opened and closed. Liquidity providers and Savers are not directly lending their assets to borrowers. The pools are just the conduit to swap between collateral and debt. Savers and LPs also benefit directly from liquidity fees generated from these swaps.
How THORChain enables Trade Assets as a capital efficient alternative to synthetic assets
Trade Assets can be redeemed for native assets anytime with no slippage, making them ideal for arbitrageurs and high-frequency traders. Trade Assets emulate the experience of trading on a centralized exchange, without compromising on transparency or security. They represent a significant step in making THORChain more user-friendly for high-frequency traders. With twice the capital efficiency of Synthetic Assets, arbitraging pools becomes much more efficient, leading to tighter price spreads across exchanges.
In short, Trade Assets provide active traders with an experience akin to trading on a centralized exchange, but entirely on-chain, without compromising transparency or security.
Trade Assets are native assets custodied by THORChain but held outside of liquidity pools. Users receive a credit to their THORChain address, while the assets are held by a protocol-controlled module. Unlike synthetic assets, Trade Assets are not held directly by user wallets. Conceptually, Trade Assets resemble a deposit on a centralized exchange, but with the transparency of being on-chain. Funds are held 1:1 as L1 assets by THORChain until the user withdraws them back to self-custody.
Backed 1:1 by native assets secured by THORChain
Mint or redeem Trade Assets with no slippage (only L1 gas fees)
2x capital efficiency of Synthetic Assets
No outbound fee when swapping to a Trade Asset
Finality with THORChain block speed (6 seconds)
Not subject to outbound delays or confirmation counting
With THORChain's growth and increased decentralization, the network is now resilient to attacks that previously limited the feasibility of Trade Assets. The launch of Trade Assets presents new opportunities for arbitrage, order books, high-frequency trading, and P2P lending markets, leveraging the network's robust security and efficiency.
There are multiple dashboards to track the performance of RUNE added to the RUNEPool:
Trade Asset: Which asset minted as a Trade Asset
Price: Current price of 1 unit of the Trade Asset
Balance: How many units of the Trade Asset has been minted
Valuation: Price * Balance
Pool Ratio: How much the Trade Asset make up entire Trade Asset pool does this account for
To ensure the security of the network, if the combined pool and trade account value exceeds the total bonded value, trade assets will be liquidated to buy RUNE and deposited into the bond module. This safeguard ensures liquidity redistribution to Active Node Operators and occurs only if the Incentive Pendulum is underbonded.
Deposit L1 assets: Traders deposit L1 assets into the network, minting a Trade Asset in a 1:1 ratio within a Network Trade module.
Receive accredited shares: Traders receive accredited shares of this module relative to their deposit.
Swap/Trade assets: Traders can swap/trade assets with RUNE or other trade assets within the module.
Withdraw balance: Traders can withdraw from their Trade Account with an outbound delay.
Minting or burning trade assets involves using a specific memo syntax, prefixed with TRADE+
or TRADE-
. The asset name is inferred from the received asset, and no slippage fees apply, only L1 gas fees. For example, depositing 1 BTC.BTC will result in the crediting of 1 BTC~BTC (minus BTC network gas fees), and withdrawing 1 BTC~BTC will result in the crediting of 1 BTC.BTC (minus network fees).
To add to the Trade Account, send L1 Asset to the Inbound Address with the memo: TRADE+:THORADD
. Example:
This adds the sent asset and amount to the Trade Account.
Use the swap memo when swapping to and from trade assets. Example:
Swap (from RUNE) to Ether Trade Asset.
To withdraw, send a THORChain MsgDeposit with the memo TRADE-:ADDR
. Example:
Withdraw 0.1 BTC from the Trade Account and send to the specified address.
Balances can be verified using the Owner's THORChain Address via the trade/account/
endpoint. Example:
Arbitrage bots: Enhance trading efficiency.
Order books and high-frequency trading: Support advanced trading strategies.
P2P Lending market: Enable deposit of one trade asset and withdrawal of another, with dynamic reserve asset interest rates.
Providing liquidity on THORChain creates an opportunity for holders of stagnant assets (e.g. BTC, ETH, BNB) to earn a return or yield on their asset. Traditionally, with a CEX or 0x style exchange, trades require an order book of bids/asks (buys/sells) at a specific price, because if an investor wants to trade one asset for another, you need a buyer and a seller. Decentralised exchanges like UniSwap and THORChain utilise liquidity pools to provide more fluid access to trades. Liquidity pools are the way decentralised exchanges maintain a reservoir of assets, enabling buyers and sellers to exchange assets on demand. Liquidity Providers are therefore those network participants who deposit their assets into liquidity pools in exchange for a share of the trading fees generated by the trading of buyers and sellers.
Current Chains — BTC, ETH, LTC, BCH, DOGE, Cosmos, AVAX, BSC
Native gas/base assets on each chain
Not quite. “Providing liquidity” in THORChain is not the same thing as staking because even if you provide only 1 asset (asymmetrically add), THORChain will automatically be separated into 2 equal parts: 50% Assets and 50% Rune. You will always have exposure to both assets.
There is no minimum or maximum time or amount. Join and leave whenever you wish. There is however a required confirmation time before THORChain credits you with liquidity when adding or swapping to protect against Reorgs. Wait time is based on:
Total Asset amount (in a specific block of a specific blockchain)
Per block reward of the chain
No. IL protection has ended on THORChain.
Yes, because when you pool asymmetrically your asset is swapped into 50% rune and 50% asset. When swapping you are subject to slippage and fees. There are 2 types charged on asymmetrical deposits/withdrawals:
The on-chain deposit transaction fee (inbound tx)
The liquidity fee as a function of slip
Upon withdrawal, there will also be a transaction fee (outbound tx)
Are there slippage fees for symmetrical deposits?
No, there is only the deposit transaction fee.
If you deposit asymmetrically you can ONLY withdraw asymmetrically, to the same asset/address that was used for deposits.
You can withdraw your symmetrical deposit both asymmetrically (in either asset) and symmetrically.
Will all ERC20 assets be supported and listed on THORChain by default?
No. Only short tail assets with high MarketCap, good velocity and economic activity would have chances to win liquidity competition to get listed.
To deposit assets on THORChain, you need a compatible wallet with your assets connected to one of the many User Interfaces. Liquidity providers can add liquidity to any of the active or pending pools. There is no minimum deposit amount, however, your deposit will have to cover the deposit and later a withdrawal fee costs. The ability to manage and withdraw assets is completely non-custodial and does not require any KYC or permission process. Only the original depositor has the ability to withdraw them (based on the address used to deposit the assets). Note, every time you add liquidity, Impermanent Loss Protection time resets.
While Symmetrically additions are recommended, Asymmetrical additions are supported, below are the rules:
If you add symmetrically first;
You will be able to add asymmetrically with RUNE later
You will be able to add asymmetrically with ASSET later but it would create a new LP position
You will be able to add symmetrically later
If you add asymmetrically with ASSET first;
You will be able to add asymmetrically with RUNE later but it would create a new LP position
You will be able to add asymmetrically with ASSET later
You will be able to add symmetrically later but it would create a new LP position
If you add asymmetrically with RUNE first;
You will be able to add asymmetrically with RUNE later
You will be able to add asymmetrically with ASSET later but it would create a new LP position
You will not be able to add symmetrically later
There are four factors affecting returns:
Proportion of transaction volume to pool depth — If there is high volume compared to the depth of the pool then there will be higher rewards available to liquidity providers. If there is low volume compared to the depth of the pool then there will be lower rewards available.
Share of the pool — If you have a large share of the pool, you’ll earn higher returns. If a liquidity provider has 1% of a pool they receive 1% of the rewards for that pool.
Fee size — fees are determined by the underlying blockchain and the rewards from fees are proportional to the fees charged. A chain with higher fees will generate higher rewards for liquidity providers.
*Of significant note is that this mechanism of providing liquidity into the protocol; creates an opportunity for holders of non-yield generating assets (e.g. BTC, ETH) to earn a return on their investments.
How RUNEPool works, its use case, key components and how it enhances liquidity provision for RUNE holders
RUNEPool is a feature of THORChain that allows RUNE holders to join the Protocol Owned Liquidity (POL). By buying into the liquidity pool through RUNEPool, users get a share of the liquidity that Thorchain owns across all its pools. This participation helps users earn Annual Percentage Rate (APR) returns and improves the efficiency of the protocol's liquidity, supporting the growth of Thorchain's network.
RUNEPool offers a single product to gather idle RUNE from centralized exchanges and custodial services, moving them into Thorchain's decentralized infrastructure to generate yield. This enhances the productivity of these assets and builds up POL through community participation.
Adding RUNE to RUNEPool abstracts away user experience complexities, focusing on the Incentive Pendulum and fees generated from the pools. RUNEPool allocates funds based on the yield, simplifying decision-making for users.
PoL-Enabled Pools: POL-Enabled pools are defined via the mimir key POL-{Asset}. Currently, all (eight) native assets and five USD stable coins are enabled for POL. The exact list is within the mimir endpoint.
RUNEPool Units (RPU): Ownership in RUNEPool is tracked through RUNEPool Units (RPU). These units represent a Pooler’s share in the pool. When a Pooler redeems their units, the total PoL size in RUNE is assessed, and the holder's share is distributed.
Impermanent Loss Management (IL): Users experience aggregate IL across PoL-Enabled pools, reducing the risk compared to any single pool.
There are multiple dashboards to track the performance of RUNE added to the RUNEPool:
Provider: The wallet that provided the RUNE
Deposit: How much RUNE was provided by the provider
Value: How much RUNE is currently possible to withdraw from the RUNEPool by a particular wallet.
PnL: The difference between the Value and Deposit is the profit that a provider has made by adding RUNE to the RUNEPool
Latest Deposit: Block # when the last deposit was made by the provider
Lastet Withdrawal: Block # when the last withdrawal was made by the provider
Withdrawn: How much RUNE was withdrawn by the provider
Adding to RUNEPool
Create a Transaction: Use a MsgDeposit
transaction with the memo pool+
.
RUNE Only: RUNEPool only works with RUNE.
Instructions: For detailed steps, refer to the "Add to the RUNEPool" section in the documentation.
Withdrawing from RUNEPool
Create a Transaction: Use a MsgDeposit
transaction with the memo pool-:<basis-points>:<affiliate>:<affiliate-basis-points>
.
Minimum Term: You can only withdraw after the minimum term, defined by the RUNEPoolDepositMaturityBlocks
configuration.
Instructions: For detailed steps, refer to the "Withdraw from the RUNEPool" section in the documentation.
Viewing RUNEPool Holders
All Holders: Use the rune_providers
endpoint to see a list of all RUNEPool holders.
Specific Holder: Use the rune_providers/{thor owner address}
endpoint to view the position of a specific RUNEPool holder.
PoL-Enabled Pools
Enabled Assets: POL is enabled for all eight native assets and five USD stable coins. The exact list can be found in the mimir
endpoint.
RUNEPool Units (RPU)
Ownership Tracking: RUNEPool Units (RPU) represent your share in the pool.
Redemption: When you redeem your units, you receive a share of the total POL size in RUNE.
Deposit Process
Deposit: When you deposit, the balance moves to the runepool
module.
Pending Units: Units are added to PendingPoolUnits
.
Reserve Exit: The reserveExitRUNEPool
function moves units from PendingPoolUnits
to PoolUnits
, reducing ReserveUnits
.
Withdraw Process
Pending Units Check: If PendingPoolUnits
is insufficient, the reserveEnterRUNEPool
function moves RUNE from the reserve to make up the difference.
Reserve Increase: ReserveUnits
are increased, and units move from PoolUnits
to PendingPoolUnits
.
Withdraw Limit: Withdrawals that would exceed POLMaxNetworkDeposit + RUNEPoolMaxReserveBackstop
are not allowed.
Impermanent Loss Management
Aggregate IL: Users experience aggregate impermanent loss across all PoL-enabled pools, reducing individual pool risks.
Idle RUNE: Undeployed RUNE reduces yield but also limits exposure to impermanent loss.
Global PnL: The /thorchain/runepool
endpoint returns the global PnL of RUNEPool, including details for the reserve and independent providers.
Individual Provider PnL: The /thorchain/rune_provider/{thor_addr}
endpoint provides position information for a single provider.
This guide should help you understand and utilize RUNEPool effectively. For more detailed instructions, refer to the respective sections in the documentation.
Overview of THORNodes
To understand more about running a THORNode, see the below links:
THORNode information can be viewed at the following dashboards:
Running a THORNode is no simple task. As an operator, you will need to run/maintain multiple linux servers with extremely high uptime. It is encouraged that only professional systems engineers run nodes to maintain the highest quality reliability and security of the network. The simple question to know if you have the skillsets to run a THORNode is:
Have you used pagerduty before?
Advanced knowledge of Linux server administration and security
Advanced knowledge of Kubernetes
Advanced experience running a host of nodes on a hosted platform such as AWS, Google Cloud, Digital Ocean, etc
Knowledge of running full nodes for other chains such as Bitcoin, Ethereum, and Binance.
Willingness to be “on call” at all times to respond to issues when/if your node becomes unavailable
To set up a node, you have two choices:
Set up manually (not recommended unless you are an expert)
Set up via Kubernetes (recommended)
You can create a bare metal node with your own hardware or use the the cluster launcher section for step by step guides using a host provider:
A node can vote at any time on any key value.
A node's vote is valid as long as they are active (and removed if they are not).
2/3rds of active nodes need to agree for the change to happen
If 2/3rds consensus is not reached, Mimir admin takes priority, or a constant if present.
A node can change their vote anytime.
A node can delete their vote by using -1 value
Voting costs one native transaction fee, which is deducted from their bond.
Setting up a Kubernetes Cluster with Hetzner Dedicated Servers
This guide for Hetzner Bare Metal is WIP and not currently recommended. Proceed with caution until an update is released and this warning removed.
Executing the scripts in combination with some manual procedures will get you highly available, secure clusters with the following features on bare metal.
Clone this repository, cd
into it and download kubespray.
Create a Python virtual environment or similar.
Install dependencies required by Python and Ansible Glaxy.
Create a deployment environment inventory file for each cluster you want to manage.
Edit the inventory file with your server ip's and network information and customize everything to your needs.
This will install and use Ubuntu 20.04 on only one of the two internal NVMe drives. The unused ones will be used for persistent storage with ceph/rook. You can check the internal drive setup with lsblk
. Change it accordingly in the command shown above when necessary.
Create a pristine state by running the playbooks in sequence.
Instantiate the servers.
Setting up a Kubernetes Cluster with GCP (GKE)
GCP account
gcloud
and GCP credentials configured
kubectl
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a THORNode from a Linux VPS.
After the installation perform the steps outlined below. This will authorize the SDK to access GCP using your user account credentials and add the SDK to your PATH. It requires you to login and select the project you want to work in. Then add your account to the Application Default Credentials (ADC). This will allow Terraform to access these credentials to provision resources on GCP. Finally, you need to enable the Compute Engine and Kubernetes Engine API services for your GCP project.
You will be asked for you Personal Access Token with read/write priveleges (retrieve from API Panel from the GCP web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely!
Use the commands below to deploy an GKE cluster:
During the deploy, you will be asked to enter information about your cluster:
Project ID
Zone -- gcloud compute zones list
Confirm yes
Now that you've provisioned your GKE cluster, you need to configure kubectl. The following command will get the access credentials for your cluster and automatically configure kubectl.
This replaces the existing configuration at ~/.kube/config.
Once done, you can check if your cluster is responding correctly by running the following commands.
You are now ready to deploy a THORNode.
Endpoints can be accessed at .
The THORNode daemon contains three endpoints that run on port 1317
or can be access via the public URL .
This endpoint deals specifically with THORChain's native modules and functionality. It provides access to THORChain-specific data such as liquidity pools, nodes, and network configurations. This is where you'll find THORChain-specific operations and data that aren't part of the underlying Cosmos SDK but are unique to THORChain. contains Swagger documentation for the thorchain
endpont.
This endpoint interfaces with the . It provides access to Cosmos SDK endpoints that THORChain inherits by being built on the Cosmos SDK. The endpoints are version specific and the CosmosSDK version THORChain uses can be found at . Tendermint informaiton can also be accessed via cosmos/base/tendermint
- .
The bank
module in Cosmos SDK handles token transfers and balances. The <tc:1317>/bank
endpoint allows you to interact with accounts, check balances, and transfer assets. See example .
TSS key-material, which does not hold funds, and simply signs TSS. If you delete this key you will accrue and get churned out. This key is encrypted and backed up in the chain itself every 3 days. It is encrypted with point 2, so you should backup point 2. The reason for this is something really bad happening on kubernetes that causes TSS key material to be 0'd out globally, which would permanently brick the vaults. this allows the network to reboot by distributing software to THORNode to extract the stored key-material on-chain and decrypt using the mnemonic for each node.
Chain ID: The current chainid
can be accessed via or by querying the <tc:26657>/status
endpoint on a specific node.
Normally, a churning event happens roughly every 2 1/2 days (43,200 blocks or ).
Nodes that targged for the next churn in and out can be seen . The next churn interval can be seen .
Nodes that do not meet the minimum version requirement (capped by )
See
To understand within THORChain fully, one needs to understands the mechanics of TOR
.
TOR (thor.tor
) is a non-transferable unit of account within THORChain designed to match the value of $1 USD and has been in use since . It cannot be exported anywhere and always has a market cap of $0. TOR is valued by taking the median price of the active USD pools.
You can find the addresses for various stablecoins on specific networks (TORANCHOR) that make up TOR pools on :
Secure Assets allow L1 tokens to be deposited to THORChain, creating a new native asset, which can be transferred between accounts, over IBC and integrated with CosmWasm smart contracts using standard Cosmos SDK messages. They also replace .
See the for a more detailed description. Also see for generic Cosmos information. What notation will they have?
The for Secured Assets is a dash '-'.
E.g. ETH.ETH
is L1. ETH-ETH
will be a secured asset.
Find more information about in the Rujira Docs or in the .
TOR (thor.tor
) is a non-transferable unit of account that debt is always denominated in within THORChain. TOR maintains its stability by anchoring to a median value of a basket of USD-pegged stablecoins (USDC, USDT, BUSD), ensuring it stays closely pegged to $1 USD. The RUNE<>TOR mechanism works through a two-way burn process: minting TOR burns an equivalent value of RUNE, and burning TOR mints the same value of RUNE. See more under .
See the developer quick start guide
A new class of primitives, known as Trade Assets, has been introduced on THORChain. These assets offer twice the capital efficiency of , enhancing the effectiveness of arbitrageurs with the same capital. Trade accounts settle with THORChain's block speed and cost, enabling swaps with 6-second finality without excessive network fees.
Trade Assets allow faster and more capital-efficient arbitrage of the pools compared to . Synthetics adjust one side of the pool depth, causing only half the price movement, while Trade Accounts use full capital efficiency for price corrections. For example, a $100 RUNE → BTC swap requires $200 of Synthetic BTC to correct the price, whereas Trade Accounts only need $100 to achieve the same correction. This enables quicker restoration of price deviations with less capital.
Dashboards for Trade Assets continuously evolve as Thorchain expands, but taking the example of you will find the following in the dashboard:
Trade Assets are the first to be held outside liquidity pools on THORChain. This means that not all native assets in TSS Vaults are paired with RUNE. To maintain network economic security, the now considers the value of all assets in the vaults, not just those in pools, when distributing rewards between Nodes and LPs. If the value of vault assets exceeds bonded value, Trade Accounts may face negative interest rates until the value ratio is balanced.
Trade Accounts
Relevant PRs: &
— held most weeks,or wherever you get your podcasts
— educational content, monthly posts, &server
— update and explanation videos
See full list at or
Block time Required confirmations = Total Asset Amount (in a specific block of a specific blockchain) divided by the chain's per block reward Then that is multiplied by block time to get the approx "wait time". See .
➜
Liquidity providers can withdraw their assets at any time and without any cooldown period, aside from the confirmation time. The network processes their request and the liquidity provider receives their ownership percentage of the pool along with the assets they’ve earned. Fees do apply when withdrawing, see .
You can see your position if you connect to THORChain via an Interface you can use .
➜
Synth leverage — With the introduction of and , Liquidity Pool providers underwrite the Synths’ share of the pools. Thus Liquidity Pool providers has a leverage effect based on the RUNE:Asset price ratio changes and Synth utilization level
RUNEPool dynamically matches external capital with various pools in the system. Managing 13 different pools, each on its price curve, RUNEPool aggregates and distributes RUNE across these pools. By using the , RUNEPool smoothens out price curves, reducing volatility and making Thorchain products more attractive to investors.
Dashboards continuously evolve as Thorchain expands, but taking the example of you will find the following in the dashboard:
This section provides a simple guide on how to use RUNEPool, including adding and withdrawing from the pool, and viewing your position. You can find full technical docs under
THORNodes service the THORChain network. Each THORNode is comprised of several independent servers in a cluster. All THORNodes communicate and operate in cooperation to create a cross-chain swapping network. Running a node is a serious undertaking. While Node Operators are well for running a node, there are also , and .
See the to learn more before running a node.
- Comprehensive THORNode dashboard
- THORNode information and network statistics
- THORNode information within the block explorer
- Earning distribution and other historical data
If the answer is no, it’s probably best that you do not run a node and participate in the network in other ways, such as a or a The following skill sets are required to be an effective node operator.
Once created, follow the , and pages.
THORNodes have the ability to vote on settings. This is important when voting for and important network changes.
Mimir settings have specific . The process for voting from a node is:
Mimir keys and values are listed in the .
Checkout the repository to manage a cluster of dedicated servers on Hetzner.
The scripts in this repository will setup and maintain one or more clusters consisting of dedicated servers. Each cluster will also be provisioned to operate as a node in the network.
(based)
Internal NVMe storage (/)
Virtual LAN (also over multiple locations) ()
Load Balancing ()
Acquire a couple of as the basis for a cluster (AX41-NVME
's are working well for instance). Visit the and name the servers appropriately.
Refer to the to properly initialize them.
Create a and order an appropriate subnet (it may take a while to show up after the order). Give the vSwitch a name (i.e. tc-k8s-net
) and assign this vSwitch to the servers.
Checkout the for help.
Note: does not work with ansible collections and the strategy must be changed (i.e. strategy: linear
).
Check out for more playbooks on cluster management.
In order for the cluster to operate as a node in the THORCHain network deploy as instructed . You can also refer to the , if necessary, or the THORChain as a whole.
Visit the and put each server of the cluster into rescue mode. Then execute the following script.
Use Windows Subsystem for Linux - ****
Firstly, clone and enter the . All commands in this section are to be run inside this repo.
Then install the :
Install Terraform:
The allows you to manage your GCP services.
Use the package manager to install the GCP CLI.
You must install and configure the Kubernetes CLI tool (kubectl). **To install kubectl** , follow , or choose a package manager based on your operating system.
Use the package manager to install kubectl.
You also need wget and jq, follow , or choose a package manager based on your operating system.
Use the package manager to install wget and jq Note: You most likely have these installed already.
Setting up a Kubernetes Cluster with Azure (AKS)
Azure account
az
and Azure credentials configured
kubectl
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a THORNode from a Linux VPS.
Install Terraform:
You will be asked for you Personal Access Token with read/write priveleges (retrieve from API Panel from the Azure web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely!
Use the commands below to deploy an AKS cluster:
During the deploy, you will be asked to enter information about your cluster:
Location -- az account list-locations -o table
Name
Confirm yes
Now that you've provisioned your AKS cluster, you need to configure kubectl. Customize the following command with your cluster name and resource group. It will get the access credentials for your cluster and automatically configure kubectl.
This replaces the existing configuration at ~/.kube/config.
Once done, you can check if your cluster is responding correctly by running the following commands.
You are now ready to deploy a THORNode.
Setting up a Kubernetes Cluster with Hetzner Cloud (hcloud)
This approach is only recommended for experienced operators because the kubernetes control plane among other things needs to be managed manually.
hcloud account
hcloud
and hcloud credentials configured
kubectl
ansible
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a THORNode from a Linux VPS.
Install Terraform:
You will be asked for you Personal Access Token with read/write priveleges (retrieve from API Panel from the hcloud web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely!
Initialize the git submodule.
Use direnv
, venv
or whatever you prefer to manage a python environment inside the hcloud folder.
Install dependencies required by Python and Ansible Galaxy.
Use the commands below to deploy an hcloud cluster:
During the deploy, you will be asked to enter information about your cluster:
Name
Token
Confirm yes
Now that you've provisioned your hcloud cluster, you need to configure kubectl. Customize the following command with your cluster name and resource group. It will get the access credentials for your cluster and automatically configure kubectl.
You are now ready to deploy a THORNode.
Deploying a THORNode and its associated services.
Now you have a Kubernetes cluster ready to use, you can install the THORNode services.
Running Kubernetes cluster
Kubectl configured, ready and connected to running cluster
Clone the node-launcher
repo. All commands in this section are to be run inside of this repo.
Install Helm 3 if not already available on your current machine:
To deploy all tools, metrics, logs management, Kubernetes Dashboard, run the command below.
To destroy all those resources run the command below.
You need to give the deployment a namespace name, thorchain
is used in the example below.
If you are successful, you will see the following message:
If there are any errors, they are typically fixed by running the command again.
It is important to deploy the tools first before deploying the THORNode services as some services will have metrics configuration that would fail and stop the THORNode deployment.
You have multiple commands available to deploy different configurations of THORNode. The commands deploy the umbrella chart thornode-stack
in the background in the Kubernetes namespace thornode
by default.
If successful, you will see the following:
You are now ready to join the network:
Use the following useful commands to view and debug accordingly. You should see everything running and active. Logs can be retrieved to find errors:
Kubernetes should automatically restart any service, but you can force a restart by running:
Note, to expedite syncing external chains, it is feasible to continually delete the pod that has the slow-syncing chain daemon (eg, binance-daemon-xxx).
Killing it will automatically restart it with free resources and syncing is notably faster. You can check sync status by viewing logs for the client to find the synced chain tip and comparing it with the real-world blockheight, ("xxx" is your unique ID):
thornode: Umbrella chart packaging all services needed to run a fullnode or validator THORNode.
thornode: THORNode daemon
gateway: THORNode gateway proxy to get a single IP address for multiple deployments
bifrost: Bifrost service
midgard: Midgard API service
prometheus: Prometheus stack for metrics
loki: Loki stack for logs
kubernetes-dashboard: Kubernetes dashboard
Setting up a Kubernetes Cluster with Linode (linode)
a Linode account
linode-cli
and linode credentials configured
kubectl
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a THORNode from a Linux VPS.
You need to have pip (python) on your system.
Use the API token to grant linode-cli access to your Linode account. Pass in the token string when prompted by linode-cli.
MacOS:
Windows:
MacOS:
Windows:
Use the commands below to deploy a Kubernetes cluster.
You can run the make command that automates those command for you like this:
Or manually run each commands:
Now that you've provisioned your Kubernetes cluster, you need to configure kubectl.
To configure authentication from the command line, use the following command, substituting the ID of your cluster.
This replaces the existing configuration at ~/.kube/config.
Once done, you can check your cluster is responding correctly by running the command:
To destroy and remove previously created resources, you can run the command below.
Or run the commands manually:
THORFi Savings - Single-sided asset exposure using Synthetics
Firstly, the User mints a Synthetic asset - this is an asset that retains 1:1 purchase rights on the underlying L1 asset. Then the User locks this synthetic asset in a Savings vault, and they are issued Saver Units - units that track their ownership of the total vault balance. The protocol monitors the yield the underlying Synth liquidity is earning, and pays that yield directly into the vault. The user can then reclaim their principle and earnings at any point later.
Savers take on significantly less risk than an LP; therefore, they earn a proportion of the yield generated by the synth collateral, with the rest captured by the LP.
Savers Yield is dynamic, depending on the system utilisation. The higher the synths utilisation in the pool, the lower the Savers Yield will be.
Savers Yield is calculated as:
Every time a swap is made in the L1 pool, the fees and rewards that were meant to be added to the pool are divided against the Synth Yield Basis Points, then divided against the depth of the Savers' Vault vs. the Depth of the Pool (in terms of asset quantity), then paid directly into the vault.
Every time a swap is made in the L1 pool, the fees & rewards that were meant to be added to the pool is divided against the SynthYieldBasisPoints, then divided against the depth of the Savers Vault vs the Depth of the Pool (in terms of asset qty), then paid directly into the vault:
At any point later, the Saver can re-claim their share of the vault, which would be their principle, plus all the yield they are entitled. The asset being claimed is a synth quantity, which is then swapped out to the L1 asset.
Swap fees and liquidity rewards.
The Saver holds Saver Units, which is a claim on a Vault Balance, which holds Synthetic Assets, which is a claim on L1 Liquidity, which can be swapped at 1:1 purchasing power to the L1 Asset. So, they are holding a claim on an L1 asset.
There may be an economic bug in Synths, leading to breakdown in the accounting of the claims. The risk of this goes down everyday, and to date no bug in Synths has been found since they were turned on in June 2022. There may be a technical bug leading to a loss of L1 assets in the vaults. This risk is non-zero and all custodians (decentralised or centralised) contain this risk.
Savers pay a liquidity fee to enter and exit, as well as network fees to pay for gas. Liquidity fees are demand-responsive and prevent economic attacks. Network fees to pay for gas ensure the system is sustainable.
How to join THORChain as an Node.
Now that you have a THORNode deployed in your Kubernetes cluster, you need to start operating your node to join the network.
Do not import your node menonic in a wallet. Nodes will have their own address.
There are a couple of steps to follow.
The first step would be to make sure your deployment was successful and your node is running correctly. _**_To check the current status of your node, you can run the command status from the node-launcher
repository on your terminal:
You will get an output along those lines, the example below is for a mainnet node:
Before sending the BOND, verify that your THORNode is fully synced with connected chains. Connected chains such as Ethereum & Bitcoin may take a day to sync. If your node is fully bonded and is selected to churn in to THORChain as ACTIVE without fully syncing all connected chains, you will immediately get slashed for missing observations, and lose money. It is normal to see Ethereum sit on 99.999% for many hours - be patient.
Only the original wallet that did the first BOND will be able to LEAVE/UNBOND. You can top up BOND using a different wallet but make sure you keep the private key to the original BOND wallet secure and accessible.
To be able to set up the node IP address, you first need to get it whitelisted in the chain by sending your BOND.
Give the network 3-5 seconds to pick up your bond. To verify it has received your bond, run the following:
If you run make status
again, you should see this:
As you can see, it is in standby but does not have an IP registered yet. This is needed for peer discovery.
You must tell THORChain your IP-Address for its address book and seed-service to run properly:
If you run the status command again, you should now see a different message for the Preflight section saying you need to set your node keys.
Do not import your node menonic in a wallet. Nodes will have their own address.
Tell THORChain about your public keys for signing sessions:
If you run the make status
command again, you should now see that your node is in status “ready” and is now ready to be churned in the next rotation.
Make sure your node broadcasts its latest version, else you won't churn in since THORChain enforces a version requirement. This version will appear in your make status
. If you are on 0.0.0
then you haven't set your version:
If you followed steps 1-5 above, your preflight will be saying:
If you finally run make status
you should see this, with keyword "Ready":
Although your node is ready to be churned in, it doesn’t mean it will be the next one to be selected since someone else could have posted a higher bond than you. To maximise chances of a quick entry, monitor Midgard to see what everyone else is bonding and try to outbid them.
This endpoint will show data on average, median, total, minimum and maximum bond amounts. For fastest entry, bond higher than the current active median.
At any time during standby, you can bond more by making an additional BOND transaction with memo:
BOND:<thornode-address>
Setting the Node Operator fee 10000
causes all rewards to be paid back each churn.
Setting the Node Operator fee to 5000
causes 50% of rewards to be paid back to the Node Operator address and 50% to be accrued back to the bond.
BOND:<node address>:<bond wallet address>:<operator fee in basis pts>
Setting up a THORNode & Midgard
The term fullnode describes a basic setup of a synced THORNode daemon and optionally Midgard and is meant to provide API endpoints for private or public use. Because the THORNode doesn't take part in the chains consensus other chain clients aren't needed.
Deploying a THORNode with Kubernetes
In order to deploy all the different services and provide a high availability environment to operate your node, Kubernetes is the preferred scheduling platform. Any production-grade Kubernetes cluster can be used to run and deploy a THORNode. You need your Kubernetes provider to offer external load balancers services type features. Azure, Digital Ocean, GCE, OpenStack are compatible with external load balancers.
This Terraform deployment will deploy a Kubernetes cluster using your VPS provider credentials and EKS service. The cluster will have autoscaling capabilities, which means you don’t have to deal with how many nodes you need to deploy to run your THORNode services.
All the default configurations used in these instructions are for a production environment with enough resources to run your THORNode in good conditions.
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a THORNode from a Linux VPS.
There are three important steps to getting your node set up, deployed and churned in.
Your repository can be organised as follows:
All of your set up commands are run in cluster-launcher
and all of your deploying/joining/managing/leaving commands are run from node-launcher
To prevent a catastrophic mistake in handling multiple nodes, set them up on different machines, or use different user profiles on your machine, or in the least, use different repos:
It is heavily advised to not set up nodes on the same provider. Deploy 1 node on Azure, 1 node on Digital Ocean etc.
Use Windows Subsystem for Linux - ****
Firstly, clone and enter the . All commands in this section are to be run inside this repo.
Then install the :
The allows you to manage your Azure services.
Use the package manager to install the Azure CLI.
You must install and configure the Kubernetes CLI tool (kubectl). **To install kubectl** , follow , or choose a package manager based on your operating system.
Use the package manager to install kubectl.
You also need wget and jq, follow , or choose a package manager based on your operating system.
Use the package manager to install wget and jq Note: You most likely have these installed already.
Use Windows Subsystem for Linux - ****
Firstly, clone and enter the . All commands in this section are to be run inside this repo.
Then install the :
The allows you to manage your hcloud services.
Use the package manager to install the hcloud CLI.
You must install and configure the Kubernetes CLI tool (kubectl). **To install kubectl** , follow , or choose a package manager based on your operating system.
Use the package manager to install kubectl.
You also need wget and jq, follow , or choose a package manager based on your operating system.
Use the package manager to install wget and jq Note: You most likely have these installed already.
If necessary, request a quota increase .
make help
will list all commands available. See for more information.
Get real-world blockheights of external blockchain at or a block explorer like mempool.space.
This should be the only chart used to run unless you know what you are doing and want to run each chart separately (not recommended).
Use Windows Subsystem for Linux - ****
To install the linode-cli (Linode CLI), follow .
Create a Linode API token for your account with read and write access from your . The token string is only displayed once, so save it in a safe place.
To install the kubectl (Kubernetes CLI), follow or choose a package manager based on your operating system.
Use the package manager to install kubectl.
Use the package manager to install kubectl.
To install the wget, follow or choose a package manager based on your operating system.
Use the package manager to install wget.
Use the package manager to install wget.
Note: If the above linode-cli
command is broken you can download the file from the web for the respective cluster.
Since 04 Jan 2025, the withdrawal of Savers has been disabled. See for more information.
Users can gain yield with single sided asset exposure using . See the PR and article .
MaxSynthsForSaversYield = 60%, set by
SynthYieldBasisPoints = 80%, set by
Synths Per Pool =
The code for that is here:
- THORChain Medium
- LP University
- GrassRoots Cryoto
Your node is running but as you can see in the `Preflight` section, your node is not yet ready to be churned in and currently is in standby , since your node has no IP address setup yet.
Do not proceed until your node is fully synced al chains. You can see the required external chain hights and the THORChain chain height . Continue to run make status
untill all chains are synced.
You will do a "Deposit" transaction using RUNE. This is an internal MsgDeposit transaction (different from a MsgSend to another wallet). There is no destination address -- use an appropriate wallet such as . The Bond is locked in a module controlled by the state machine.
Deposit your using the memo BOND:<thornode-address>
(or use an appropriate GUI that does this memo for you). Send a small amount of RUNE to whitelist the node, the bond will be picked up.
To address this, send the remaining bond, that is higher than the minimum bond, currently 300K RUNE set by a network setting, look for MinimumBondInRune
. See for how much bond to send.
You will need to be greater than the minimumActiveBond.
Bonding more than bondHardCap
will not result in more . medianActiveBond
is a good target to get and stay active.
Some useful community sites to assist monitoring your node are , .
You can also whilst you are on , using the UNBOND memo.
To set a Node Operator fee, send a deposit transaction with the following :
See for full information.
See for more information about the different node types.
The installation guides for running a fullnode via Docker or directly on Linux are not officially supported by the development team. The preferred and supported way is by using .
Use Windows Subsystem for Linux -
All of your commands can now be run separately. See docs for more information.
Setting up a fullnode with Docker
Install all packages needed for running and configuring the THORNode container
Prepare work directory
For joining the network, the correct genesis file is required
The fastest way to join the network is by downloading a current snapshot and sync from it.
Start the thornode container
Accessing Logs, Metrics and more
The Makefile provide different commands to help you operate your THORNode.
There are two types of make commands, READ and WRITE.
Read commands simply read your node state and doesn't commit any transactions.
To get information about your node on how to connect to services or its IP, run the command below. You will also get your node address and the vault address where you will need to send your bond.
Opens a shell into your thor-daemon
deployment: From within that shell you have access to the thorcli
command.
Display stream of logs of THORNode deployment:
This will print your node mnemonic (phrase). Use this to ever rescue your node funds if something goes wrong.
Note: Your bond is held at ransom in order to prevent you from stealing funds from this vault. Your bond will always be more valuable than funds on this vault, so you have no economic reason to touch these funds.
A keystore file that secures your private keys is also stored on the THORNode. The password that is used to decrypt it can be printed by the following command
Restart a THORNode deployment service selected:
Reset a THORNode deployment service selected, including deleting the persistent volume. This command is destructive and will reset the chain back to 0%. You would use this for unrecoverable issues that make restart
did not solve.
Write commands actually build and write transactions into the underlying statechain. They cost RUNE from your bond, currently 0.02, but you can check this on the /constants
endpoint "CLICOSTINRUNE". This will post state in the chain which will be now updated globally. The RUNE fee is to prevent DDoS attacks.
Send a set-node-keys
to your node, which will set your node keys automatically for you by retrieving them directly from the thor-daemon
deployment.
Send a set-ip-address
to your node, which will set your node ip address automatically for you by retrieving the load balancer deployed directly.
In order to update your THORNode to a new version, you will need to update the docker tag image used in your deployments. Depending on your choice of deployment this can be done differently.
For Kubernetes deployments, you can edit the deployments of the different services you want to update using the commands below.
To update your thor-daemon
, thor-api
and bifrost
deployment images to version 0.2.0:
To update your `midgard` deployment image to version 0.2.0
You can then follow the deployments restarting status either by checking your Kubernetes dashboard or using the CLI command below:
Once the deployments are all in the ready state again, you need to broadcast to the network that you are running a new version using the command below:
Note, all of these should already be installed from make tools
. However you can install them separately useing the DEPLOY tabs below.
To access the tools, navigate to the ACCESS tabs below.
All of these commands are to be run from node-launcher
It is recommended to deploy a logs management ingestor stack within Kubernetes to redirect all logs within a database to keep history over time as Kubernetes automatically rotates logs after a while to avoid filling the disks. The default stack used within this repository is Loki, created by Grafana and open source. To access the logs you can then use the Grafana admin interface that was deployed through the Prometheus command.
You can deploy the log management automatically using the command below:
This command will deploy the Loki chart. It can take a while to deploy all the services, usually up to 5 minutes depending on resources running your kubernetes cluster.
You can check the services being deployed in your kubernetes namespace loki-system
.
Access Grafana
See previous section to access the Grafana admin interface through the command make grafana
.
Browse Logs
Within the Grafana admin interface, to access the logs, find the Explore
view from the left menu sidebar. Once in the Explore
view, select Loki as the source, then select the service you want to show the logs by creating a query. The easiest way is to open the "Log browser" menu, then select the "job" label and then as value, select the service you want. For example you can select thornode/bifrost
to show the logs of the Bifrost service within the default thornode
namespace when deploying a mainnet validator THORNode.
Destroy Loki logs management stack
It is also recommended to deploy a Prometheus stack to monitor your cluster and your running services.
You can deploy the metrics management automatically using the command below:
This command will deploy the prometheus chart. It can take a while to deploy all the services, usually up to 5 minutes depending on resources running your kubernetes cluster.
You can check the services being deployed in your kubernetes namespace prometheus-system
.
We have created a make command to automate this task to access Grafana from your local workstation:
Login as the admin
user. The default password should have been displayed in the previous command (make grafana
).
Access Prometheus admin UI
We have created a make command to automate this task to access Prometheus from your local workstation:
As part of the tools command deployment, you also have deployed a Prometheus stack in addition to the Elasticsearch in your Kubernetes cluster. All CPU, memory, disk space, and THORNode / THORChain custom metrics are automatically being sent to the Prometheus database backend deployed in your cluster.
You should have available different dashboards to see the metrics across your cluster by nodes, deployments, etc, and also a specific THORNode / THORChain
dashboard to see the THORChain status, with current block height, how many validators are currently active and other chain related information.
You can also deploy the Kubernetes dashboard to monitor your cluster resources.
This command will deploy the Kubernetes dashboard chart. It can take a while to deploy all the services, usually up to 5 minutes depending on resources running your kubernetes cluster.
We have created a make command to automate this task to access the Dashboard from your local workstation:
View your kubernetes dashboard by running the following:
You should backup your THORNode in case of failures. By default, if you are using the Kubernetes deployments solution, all the the deployments are automatically backed up by persistent volume disks. Depending on your provider, the volumes are usually available in the provider administration UI, for example in AWS, you can find those volumes in your regular console, in the region you chose to deploy your Kubernetes cluster.
Again by default, with Kubernetes, by using persistent volumes used in the default configuration, you are already protected again restart failures at container level, or node failures. As long as you don’t specifically use the destroy commands from the Makefile or manually delete your Kubernetes deployments, your volumes will NOT be deleted at any time.
It is still recommended, as any project, to have different backups on top of those volumes to make sure you can recover in admin error deleting those volumes or other Kubernetes resources that would imply deleting those volumes.
Also see the Create and Validator Backup guide.
For AWS, you can easily setup in your console to have snapshots of your cluster volumes be taken every day. For other provider there can be different ways to achieve this as well either manually or automatically.
It is up to the node operator to setup those extra backups of the core volumes to be able to recover in any kind of failures or human errors.
Some volumes would be more critical than others, for example Midgard deployment are also by default backed up by persistent volumes, so it can recover in case of container restarts, failures or node failures and the deployment being automatically scheduled to a different node, but if you were to delete the Midgard volume, it would reconstruct its data from your THORNode API and events from scratch. For that specific service having extra backups might not be critical, at the time of the writing of that document, Midgard implementation might change in the future.
At minimum you should also securely backup your node keys: node_key.json
and priv_validator_key.json
. Do this as follows:
Copy the thornode pod name, e.g. thornode-abcdefg-hijkl
and replace with {thornode pod name}
below:
The following are attack vectors:
If anyone accesses your cloud credentials, they can log in and steal your funds
If anyone accesses the device you used to log into kubernetes, they can log in and steal your funds
If anyone accesses your hardware device used to bond, they can sign a LEAVE transaction and steal your bond once it is returned
If anyone has your Yggdrasil make mnemonic
phrase, including in logs, they can steal your funds
If any GitLab repo is compromised and you git pull
any nefarius code into your node and run make <any command>
, you can lose all your funds.
Prior to git pull
or make pull
updates, review node-launcher repo diffs:
RUNNING A NODE IS SERIOUS BUSINESS
DO SO AT YOUR OWN RISK, YOU CAN LOSE A SIGNIFICANT QUANTITY OF FUNDS IF AN ERROR IS MADE
THORNODE SOFTWARE IS PROVIDED AS IS - YOU ARE SOLELY RESPONSIBLE FOR USING IT
YOU ARE RESPONSIBLE FOR THE CODE RUNNING ON YOUR NODE. YOU ARE THE NETWORK. INSPECT ALL CODE YOU EXECUTE.
When running a node, it is quite common to get slashed. The network relies on slash points to rate node quality. When your node is slashed, the first thing you need to do is run make status
, and make sure all your chains are 100% in sync. If any of the external chains are not 100% in sync, then it will cause node to be slashed due to missing observations.
The best prevention is to have a cluster with lots of fast resources (cpu, memory, IO, network) and good backups/redundancy to prevent downtime.
Unfortunately even when your node is fully in-sync, it is still possible to be slashed due to external chain events.
Problem: Sometimes bifrost fails to forward observations to thornode, due to an account number / sequence number mismatch. Here is what you need to check:
run make logs
, and choose bifrost
Search your bifrost logs for {"level":"error","service":"bifrost","module":"observer","error":"fail to send the tx to thorchain: fail to broadcast to THORChain,code:32, log:account sequence mismatch, expected 26806, got 26807: incorrect account sequence","time":"2021-05-30T07:28:18Z","message":"fail to send to THORChain"}
3. Solution: make restart
and choose bifrost
THORFi Lending within THORChain
Lending allows users to deposit native collateral, and then create a debt at a collateralization ratio (CR). The debt is always denominated in USD (aka TOR
), regardless of what L1 asset the user receives.
Limits on collateral for the network and each pool
Slip-based fees when opening and closing loans
A circuit breaker on RUNE total supply
Lending allows users to:
Create a loan using native assets as collateral
Hold a loan without the risk of liquidation
Be short on USD and long on crypto assets such as Bitcoin
Lending benefits the protocol by:
Increased capital efficiency of the pools which increases system income and real yield.
Increased trading volume
Increased total bonded, allowing THORChain to scale.
Providing an attractive sink for capital
Collateral will be restricted to BTC and ETH only on launch. The Minimum Loan Term will be 30 days on launch.
The user provides Bitcoin collateral and can receive the debt in any asset however it is all accounted for in TOR.
The user sends in collateral (BTC.BTC -> RUNE, RUNE -> THOR.BTC)
THOR.BTC is held as collateral in the Lending module
Convert THOR.BTC value to TOR terms
Calculate debt in TOR based on CR and collateral TOR value
Mint TOR
TOR -> RUNE, RUNE -> L1 out (e.g. - ETH)
Users can repay loans at any time, with any amount in any asset. Repayment is converted into TOR.
L1 -> RUNE (optional, user can also pay back with RUNE)
RUNE -> Mint TOR
Burn TOR (amount deducted from loan debt)
Burn Derived Asset (THOR.BTC) (amount is the same percentage of collateral as a percentage of loan debt paid) -> Mint RUNE
RUNE -> BTC.BTC (loan originator)
Collateral is not returned until the loan is fully repaid. The user will always have the right to have their returned collateral if they repay the loan.
Derived pools are created for each derived asset, including TOR, to allow swapping between L1 assets and derived assets va RUNE. Their depths expand and contract to throttle the amount of slippage users pay when swapping from an L1 asset to a derived asset. In periods of volatility, pool depth contracts to increase the slippage on swaps during this period of time. This incentivises users to wait for a period of lower volatility to exit/enter lending and protects the system against pool manipulation.
The TOR pool is a derived asset pool and operates the same as other derived asset pools except the TOR price comes from the medium of the four pools instead of one L1 Asset Pool.
The totalRuneDepth
is the sum of all RUNE in anchor pools (i.e. - USDC, USDT, BUSD-BD1 for TOR or just BTC.BTC for the L1)
MaxAnchorBlocks
Protocol Setting, blocks to accumulate slip
DerivedMinDepth
Protocol Setting, Min derived pool depth
DerivedDepthBasisPts
Protocol Setting, increase/decrease derived pool depth
MaxAnchorSlip
Protocol Setting, Max allowed slip on derived pool
Update RUNE depth to constrict based on slip:
Where r
is the RUNE depth of the pool and health
is derived_depth_bps.
The derivedPoolRuneDepth
and derivedPoolAssetDepth
can then be used to calculate the swap output for the derived pool.
The difference between the swap outputs of the derived and L1 pools quantifies the reduction due to the variable depth of the derived pool.
Lending is capped by limited the collateral that can be received by the protocol. The lendingLever
throttles the amount of RUNE available for lending, in basis points.
totalAvailableRuneForProtocol
is distributed among pools available for lending based on their RUNE depth. For each lending pool, the totalAvailableRuneForPool
(tarfp
) is:
totalAvailableAssetForPool
is converted from RUNE to Asset value. This imposes a collateral holding limit for each pool, a new loan cannot be opened if the new gross collateral exceeds this amount.
Since Feb-2024, a flat CR of 200% has been implemented by setting both MinCR and MaxCR to 200%.
A dynamic CR increases as loans are opened within a pool and reduces as loans are repaid.
a
Current pool collateral + new loan collateral
b
TotalAvailableAssetForPool
MinCR
Ratio in basis points, (LTV = 1/CR)
MaxCR
Basis points, protocol setting
Debt is calculated based on the collateral provided and the CR of the pool.
CollateralValueInTOR
Collateral Value in TOR
CR
Collateralization ratio
The TOR debt is swapped to the requested L1 asset and then sent to the user, slip fees apply.
The protocol setting loanRepaymentMaturity
defines the number of blocks before a loan can be repaid/closed. There is no option for repayment before this period.
The formula to calculate MaxLoanStreamingQty
is as follows:
This gives the following effect:
100%: Infinite
99.99%: 10,000
99.9%: 1,000
99%: 100
98%: 50
95%: 20 (20 streams means a $1m loan is 50BPS)
90%: 10
80%: 5
70%: 3
60%: 2
50%: 2
0-50%: 1 (e.g., no streaming)
This limits the streaming swap for Lending for open and closing loans during highly volatile times.
Opening new loans creates a deflationary effect on the $RUNE asset, whereas closing loans creates an inflationary effect on $RUNE.
If the value of $RUNE relative to $BTC is the same when the loan is opened and closed, there is no net inflationary effect on $RUNE (same amount burned as minted minus the swap fee). However, if the value of the collateral asset increases relative to $RUNE between the time the loan is opened and closed, there will be net inflation of $RUNE supply.
Lending controls are in place to address these concerns.
Block Science reviewed the lending mechanisms exhaustively. The Output of their research includes:
Setting up a Kubernetes Cluster with Digital Ocean (DO)
DO account
doctl
and DO credentials configured
kubectl
homebrew
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a THORNode from a Linux VPS.
Install Terraform:
You will be asked for a Personal Access Token with read/write priveleges (retrieve from the API Panel in the Digital Ocean web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely! You will need this token twice more for setup and if you navigate away from the API web console it will not be displayed again.
DO Droplet Limit
You will need to increase your Droplet Limit if you get an error like this:
On the Digital Ocean web console (Settings > Team > Droplet Limit) you will be able to request the Droplet Limit
be increased. 10 Droplets is the default limit, request 25 to begin with.
Use the commands below to deploy a DOKS cluster:
During the deploy, you will be asked to enter information about your cluster:
Name
Confirm yes
Final success message: Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
Now that you've provisioned your DOKS cluster, you need to configure kubectl. Customize the following command with your cluster name and region.
If successful, you will see:
Test this configuration,
To verify, run this, and check the status is "Ready":
You are now ready to deploy a THORNode.
Setting up a Kubernetes Cluster with AWS
AWS account
CLI and AWS credentials configured
AWS IAM Authenticator
kubectl
wget
(required for EKS module)
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a THORNode from a Linux VPS.
Install Terraform:
You will be asked for you AWS access credentials (retrieve from AWS IAM from the AWS web console.)
IAM -> User -> Security Credentials -> Create Access Key.
Make sure you handle your secrets securely!
Use the commands below to deploy an AWS EKS cluster. You can run the make command that automates those command for you like this:
During the deploy, you will be asked to enter information about your cluster:
Name
Confirm yes
Or manually:
Final success message: Apply complete! Resources: 30 added, 0 changed, 0 destroyed.
This is done automatically during provisioning. To configure authentication from the command line, use the following command. It will get the access credentials for your cluster and automatically configure kubectl in case you need to to manually reconfigure kubectl.
Or get your kubeconfig file manually:
To verify, run this, and check the status is "Ready":
You are now ready to deploy a THORNode.
Once your node is running, use the following command to automatically backup the Persistent Volumes for your Kubernetes cluster. This may help in recovering your node in the event of a disaster.
Enable backups:
Disable backups:
Setting up a fullnode on Kubernetes
How to manage a pooled THORNode with separate Operator and Providers.
Skilled Node Operators who don't individually have enough $RUNE to run a node themselves can use the Bond Provider feature to collect bond from other $RUNE holders.
Node Operators can define up to 100 THOR addresses as Bond Providers. These addresses will be able to bond and unbond to the node, earning rewards proportional to the amount of bond they contribute. Node Operators define an operator fee in basis points, which defaults to zero and must be set explicitly when bond providers are added. The Node Operator fee is taken from rewards and paid directly to the Node Operator address after each churn.
The minimum $RUNE needed to churn in as a THORNode is currently set at 300K - but with bond competition, this number could be much higher.
Not many people in the world have both the technical skills to run a validator AND at least 300K $RUNE, which limits the supply of Node Operators who secure THORChain.
Pooled THORNodes provide a way for a skilled Operator to enter a trusted agreement with known Bond Providers to bootstrap enough capital for running a THORNode. The Network's security increases, and more RUNE holders have access to yield-bearing bond-space.
At first glance it might seem Pooled Validators contradict the economic security model of THORChain (i.e. that Node Operators put up twice the value in slash-able bond as the assets they secure). With Pooled Validators it is possible for the Node Operator to individually put up less bond than the value of the assets that the node secures. However this nuance only exists within the relationship between the Node Operator and the Bond Providers. The Network only considers the THORNode as single entity thus the economic model is intact.
It would be disastrous to THORChain if operators could collect unlimited bond quantities from anon/retail providers. Malicious Operators could start marketing campaigns collecting RUNE and then rug-pull their users, or worse, access economies of scale and take over the network. This is why Pooled THORNodes are invite-only and limited to 100 per node to moderate this.
Add a bond provider using a BOND transaction with a modified memo from a wallet you control (ledger, desktop, thorcli):
BOND:<NodeAddress>:<BondProviderAddress>:<NodeOperatorFee>
Example: BOND:thor1agftrgu74z84hef6dt6ykhe7cmjf3f8dcpkfun:thor1tfm4q8u57qzsznpvh02s8j483aga63cl02k6jt:2000
NodeAddress - THORNode address (prefixed by thor
)
BondProviderAddress - Bond Provider address to whitelist (prefixed by thor
)
NodeOperatorFee - fee in basis points to be taken from rewards and paid directly to Node Operator's address after each churn.
RUNE TX Value - 1.02 minimum (anything over 1.02 is added to the Operator's Bond).
A Node Operator is the first on-chain bonding transaction to a new node. You cannot change the operator address after the fact.
The Operator is also added as a Bond Provider.
While the node is churned out, A Node Operator can remove a Bond Provider using an UNBOND transaction with a modified memo:
UNBOND:<NodeAddress>:<Amount>:<BondProviderAddress>
NodeAddress - THORNode address (prefixed by thor
)
Amount - amount of Bond Provider's bond to refund
BondProviderAddress - Bond Provider address to refund/remove (prefixed by thor
)
RUNE Tx Value - 0.02 minimum
This command will refund the Bond Provider their bond and remove them from the Bond Provider list only if Amount
constitutes all of the bond the Bond Provider is owed.
Node operators can set a fee that is paid to them from the earnings each churn.
To set a Node Operator fee, send a deposit transaction with the following memo:
BOND:<node address>:<bond wallet address>:<operator fee in basis pts>
Example: BOND:thor1agftrgu74z84hef6dt6ykhe7cmjf3f8dcpkfun:thor1tfm4q8u57qzsznpvh02s8j483aga63cl02k6jt:2000
To adjust the Fee, The no operators can send:
BOND:<node address>::<operator fee in basis pts>
Example: BOND:thor1agftrgu74z84hef6dt6ykhe7cmjf3f8dcpkfun::4000
to see the fee to 40%.
Fees can range from 100 to 9900 basis pts. Setting 10000 causes all rewards to be to the node operator each churn. Setting it to 0 causes rewards to accrue to the bond.
Once whitelisted, a Bond Provider can Bond and Unbond from the node as normal.
Adding Bond:
BOND:<NodeAddress>
NodeAddress - THORNode address (prefixed by thor
)
RUNE Tx Value - Amount of RUNE to bond
Removing Bond:
UNBOND:<NodeAddress>:<Amount>
NodeAddress - THORNode address (prefixed by thor
)
Amount - Amount of RUNE to unbond
RUNE Tx Value - 0.02
Operators and Providers all have a bond amount registered to the node. Operators can start at 0.00 bonded. This on-chain bond amount is summed to the total bond, and thus everyone has a fair share in the THORNode's principle + rewards.
The Operator Fee is distributed to the Node Operator address from all RUNE rewards earned by a node after each churn.
If an Operator LEAVES, all the bond is fairly distributed.
Setting up a fullnode on Linux
Install all needed packages for building and configuring the THORNode daemon
Add the application user that is used to run the THORNode application
Checkout the latest code and build the binary
As thornode
user run:
Note: The build process currently expects to have a docker binary available, which isn't needed for building the thornode
binary, so providing it a fake docker command via symlink is just a hack around that limitation.
Before running the fullndode the first time, the configuration files and directory layout need to be created.
As thornode
user run:
Seeds provide a list of active thorchain nodes, which are needed to join the network.
As thornode
user run:
Thorchain doesn't use the cosmos-sdk default ports. Technically this step isn't needed, but it is meant to stay in line with all other THORNode deployments.
As thornode
user run:
For joining the network, the correct genesis file is required
As thornode
user run:
The fastest way to join the network is by downloading a current snapshot and sync from it.
As thornode
user run:
Create a service file to be able to manage the thornode process via systemd
Reload systemd config
Start the daemon
Setting up Midgard on Linux
Install all needed packages for building and running midgard
Add the application user that is used to run the thornode daemon
Run the PostgreSQL package setup script
Add the TimescaleDB package
Install the TimescaleDB GPG key
Update your local repository list and install TimescaleDB
Tune your PostgreSQL instance for TimescaleDB
Restart PostgreSQL
Connect to the database
Add TimescaleDB to the database
Check that TimescaleDB is installed
As midgard
user run:
As midgard
user run:
Add midgard config
Create a service file to be able to manage the Midgard process via systemd
Reload systemd config
Start the daemon
Alert Channels & Monitoring Software
To listen for update announcements, join the following channels:
A monitoring application for THORNodes.
A Vǫrðr or warden is a guardian spirit who will follow the soul of a living person from birth until death.
All chains are monitored for Health
and Sync Status
every minute
THORChain version is monitored every minute
Kubernetes pod restarts are monitored every 5 minutes
Kubernetes pod logs of all chains are aggregated
Slash points are monitored every minute
Jailing is monitored every minute
Chain observations are monitored every minute
Make API/RPC available externally
One easy way to make thornodes and midgards API or RPC endpoints available ecternally is by using a reverse proxy, a webserver that accepts all HTTP(S) requests and forwards them to the specific application.
The reverse proxy needs a way to distinguish between the endpoints that it needs to address. One way to do this is by using different DNS records for each service, for example: api.yourdomain.com
, rpc.yourdomain.com
, midgard.yourdomain.com
The default page is not needed and can be removed:
When using a self built version of THORNode, the API endpoint is disabled by default and needs to be enabled in the thornode app config.
Thornode needs to be restarted, for the changes to take effect.
Create the required proxy configurations
How to leave THORChain
Outgoing:
Nodes wishing to leave, and/or
The most unreliable node(s), and/or
The oldest node
But a maximum of 1/3rd the network
Incoming:
Churned out nodes will be put in standby, but their bond will not automatically be returned. They will be credited any earned rewards in their last session. If they do nothing, but keep their cluster online and up-to-date with the latest THORNode version, they will be eventually churn back in.
Alternatively, an "Active" node can leave the system voluntarily, in which case they are marked to churn out first.
It is assumed nodes that wish to LEAVE while on Standby will be away for a significant period of time, so by permanently jailing their address, it forces them to completely destroy and re-build before re-entering. This also ensures they are running the latest software.
If a Node Operator wants to retrieve part of their bond & rewards (such as deciding to take profits), they can simply Unbond. This keeps their Node on standby, ready to be churned back in.
To unbond from the system, simply send an UNBOND transaction.
Example, this will draw out 10k in RUNE from the bond, as long as the remaining amount is higher than the minimum bond.
UNBOND:<node address>:1000000000000
Only the address that originally bonded the funds can UNBOND or LEAVE. This ensures you can safely leave this system if you no longer have access to your node (but it is still running).
If you can't UNBOND, it means your Yggdrasil vault still has funds on it. This means your node spent more gas than it was supposed to during the cycle (various reasons) and is partially insolvent. To fix this you need to rectify your node's insolvency first (send it the missing funds directly) before doing anything.
If a node issues a LEAVE while Active, they are eligible to churn back in on the next churn
If a node issues a LEAVE while on Standby, the node is considered Disabled and will never churn back in.
To leave the system, send the following transaction from your original bond address to the Vault Address: LEAVE:<ADDRESS>
with at least 1 RUNE.
Example:
LEAVE:<node address>
⏱ Wait a few hours, verify on the /nodes endpoint that you are now Disabled
👀 Then send another LEAVE:
LEAVE:<node address>
⏱ Wait a few minutes, verify you have received your bond back 👀 - make status
should show BOND 0.00
and your wallet should get the full Bond back.
🔥 Commence destroying your node 🔥
If your node is both offline and inaccessible, then it will be unable to automatically return any assets in its Yggdrasil vaults and it will be slashed 1.5x the value of those assets.
Example: If your node has a $5m bond (in RUNE), but has $1m in assets in its vaults it can't return, it will lose $1.5m in RUNE from its bond. The Node will only get back $3.5m of its bond.
If your node is completely offline or destroyed, you will have to perform a manual return of Yggdrasil funds in order to prevent 1.5x bond fine. Ensure you have reviewed this procedure and have all tools ready to go in case you need to do it in anger. This is a time-critical event - you have a few hours to return all funds before the network assumes you have stolen them.
Requirement: You have your make mnemonic
Yggdrasil mnemonic available. If you do not have this, you cannot manually return funds.
Options: 1. Coming Soon: Use ASGARDEX for Manual Return. 2. Coming Soon: Check Discord Dev channels for manual return cli tool. 3. Extract Private Key + Manual return each asset using wallets:
Do not cache inbound_addresses. These are only valid for a short period of time. Always refresh to get the latest before sending funds.
Use the address field. Chains with a router present such as ETH need to send funds via the router smart-contract. Paste the router address into etherscan, click "Contract" and "Write Contract" and use a Web3 wallet to connect.
The memo required is YGGDRASIL-:<BlockHeight>
. For example YGGDRASIL-:782412
. The block height can be found from the status_since
field here:
You should complete this checklist before you do the next step:
Have you sent a final LEAVE transaction and have you received your BOND back - ie 1,000,000 RUNE, and can your account for any slash points or rewards?
If yes, then proceed:
To destroy and remove previously created resources, you can run the command below.
Destroying your cluster will completely destroy your node, including purging all keys on it.
DO NOT DO THIS UNTIL YOUR NODE HAS CHURNED OUT AND YOU HAVE VERIFIED YOUR BOND IS COMPLETELY RETURNED
IF YOU DESTROY A NODE PREMATURELY, YOU MAY LOSE A SIGNIFICANT AMOUNT OF FUNDS
First, destroy the node and tools, this will delete your node then your tooling 1-by-1. Do this from the node-launcher
repo:
Then destroy the cluster from the cluster-launcher
repo:
You will be asked to confirm:
DO NOT DESTROY YOUR NODE UNTIL YOU HAVE CHURNED OUT AND HAVE RECEIVED YOUR FULL BOND BACK IN YOUR CUSTODY
IF YOU DESTROY YOUR NODE WITH FUNDS LOCKED UP - YOU WILL LOSE A SIGNIFICANT QUANTITY OF FUNDS
This page describes how to react in a network-wide emergency (funds-at-risk).
THORChain is a distributed network. When the network is under attack or a funds-at-risk bug is discovered, Node Operators should react quickly to secure and defend.
Even during emergencies, Node Operators should refrain from doxxing themselves. Staying pseudo-anonymous is critical to ensuring the network is impartial, neutral and resistant to capture.
Description of the bug
Steps to reproduce
If funds are at risk
Once the bug has been verified, admin should make a decision on the level of response, including any mimir over-rides and announcements:
The network cannot upgrade until 100% of active nodes are on the updated version. This can be accelerated:
Naturally, by allowing the network to churn out old nodes
Assertive, by waiting until a super-majority has upgraded (demonstrating acceptance of the upgrade) then banning old nodes
Forced, by hard-forking out old nodes.
During a natural upgrade cycle, it may take several days to churn out old nodes. If the upgrade is time-critical, the network may elect to ban old nodes. Banning a node will cycle them to be churned, kick them from TSS and eject them from the consensus set. That node will never be able to churn in again, they will need to fully leave, destroy their node, and set up a new one. Hard-forking out old nodes is also a possibility, but comes with significant risk of consensus failures.
The network will not be able to recover until the upgrade is complete, any mimir over-rides are removed, and TSS is re-synced. Additionally, there may be a backlog of transactions that will need to be processed. This may take some time. If external chain daemons were stopped, re-syncing times may also be a factor.
All wallets and frontends should monitor for any of the halts and automatically go into maintenance mode when invoked.
Run make help
at any stage to get an exhaustive list of help options and how to interact with the system. See for an overview of each command.
Open in your browser.
Open in your browser.
For a more in-depth introduction of Grafana, please.
Open in your browser.
For full disaster recovery (complete loss of cluster), it is possible to issue LEAVE command from the original BOND wallet and manual return of funds from your Yggdrasil. In this case you need a secure backup of make mnemonic
(Yggdrasil mnemonic) and a working wallet that did the original BOND. See .
Regularly review patches in GitLab:
When chain clients have updated tags (version number or sha256), inspect the GitLab diffs for the relevant image in and ensure the CI build checksum matches the expected. This ensures you are executing code on your node that you are satisfied is free from exploits. Some images such as Ethereum use the 'official' docker image, e.g. .
Since Sept-2024, the opening of new loans has been disabled as per Node consensus. Since 04 Jan 2025 closing of loans has been disabled. See for more information.
All loans have 0% interest, no liquidations, and no expiration. Since ADR 012 was implemented in Feb-2024, a flat 200% CR (or 50% Loan-to-Value, LTV) was implemented. Risk by:
with full Lending details was released and approved by Node Operators.
- setting CR to flat 200%, and burning Standby Reserve to increase collateral cap.
Derived assets, such as thor.btc
andthor.tor
, are algorithmic coins that are backed by the liquidity of RUNE, and the liquidity of that is based on the RUNE-ASSET pair. Derived assets are swapped from or swap to L1 assets, via RUNE, using that are based on the equivalent L1 pools. Unlike, Synthetic Assets, derived assets are independent of Liquidity Pools and all swap fees are burnt. Derived assets are for accounting and there are no plans for them to be exportable or held by users.
TOR (thor.tor
) is a non-transferable unit of account within THORChain designed to match the value of $1 USD and has been in use since . It cannot be exported anywhere and always has a market cap of $0. TOR is valued by taking the median price of the active USD pools.
All collateral, debt and repayments within Lending are converted to and accounted for in TOR. To understand TOR in depth, go to the dedicated .
The depth of the derived pool will fluctuate depending on the amount of the trading volume within a time window determined by the variable , currently about 15 hours. This will reduce the output of swaps from derived pools compared to L1 pools. The API endpoint contains 'derived_depth_bps
' which shows the derived pool depth relative to the L1 pool depth. For example, 'derived_depth_bps:9091
' this means the pool is 90.91% depth of the L1 Bitcoin pool. To quantify the impact this has to swaps across the derived pool, you first need to calculate the derived pool's RUNE depth using the following formula:
Next, multiply derivedPoolRuneDepth
by (the ratio of RUNE to Asset) to determine the derivedPoolAssetDepth
.
are enabled on Lending; however, the number of streaming sub-swaps is subject to the maximum loan streaming quantity which determined by the health of the system. The loan streaming quantity (MaxLoanStreamingQty
) is calculated based on the health of the system, represented by the ratio of to real depth (x
).
Loan Streaming Swap Interveral is set to 1 via
Use Windows Subsystem for Linux -
Firstly, clone and enter the . All commands in this section are to be run inside this repo.
Then install the :
The allows you to manage your DO services.
Use the package manager to install the doctl
.
You must install and configure the Kubernetes CLI tool (kubectl
). To install kubectl , follow , or choose a package manager based on your operating system.
Use the package manager to install kubectl.
You also need wget and jq, follow , or choose a package manager based on your operating system.
Use the package manager to install wget and jq Note: You most likely have these installed already.
DO Region -- see valid (use lower-case)
Use Windows Subsystem for Linux - ****
Firstly, clone and enter the . All commands in this section are to be run inside this repo.
Then install the :
In order for Terraform to run operations on your behalf, you must install and configure the AWS CLI tool. ****To install the AWS CLI, follow , or choose a package manager based on your operating system.
Use the package manager to install the AWS CLI.
You also must install and configure the AWS IAM Authenticator tool. ****To install, follow , or choose a package manager based on your operating system.
Use the package manager to install the AWS IAM Authenticator.
You must install and configure the Kubernetes CLI tool (kubectl). ****To install kubectl , follow , or choose a package manager based on your operating system.
Use the package manager to install kubectl.
You also need wget and jq, follow , or choose a package manager based on your operating system.
Use the package manager to install wget and jq Note: You most likely have these installed already.
AWS Region -- see valid
For deploying Thornode and Midgard on Kubernetes, follow the instructions for and .
Instead of TYPE=validator
, use TYPE=fullnode
at the step.
See for more details.
When the node is standby, active or not churning, bond amounts can be increased/decreased.
You can tell the network is migrating if there are retiring
Asgard Vaults.
THORNode Announcements (Telegram):
THORChain Community Devs (Discord):
Vǫrðr is a community developed monitoring app for THORNodes. It's fully open-source at . This is 3rd party software outside of the scope of THORSec.
See on how to run Vǫrðr in the Kubernetes cluster.
Approximately every 2 1/2 days (43,200 blocks or ) the system will churn its vaults and nodes.
The node(s) with the highest bond (2 or ).
Yggdrasil vaults have been deprecated, see . They may be used again in the future. Nodes that were active before ADR-002 need to leave as described below.
Your Yggdrasil make mnemonic
phrase is used to generate the m/44'/931'/0'/0/0
private key which is used for all chains. Pasting the mnemonic into common wallets will not work as they will be looking under a different "standard" HD Path. Instead, go to and paste in your mnemonic, select RUNE from the Dropdown list and in the bottom table, copy the m/44'/931'/0'/0/0
private key string. Use this to import into wallets.
The next step is to find the latest inbound addresses. Use
You will be asked to enter your cluster name and region (the same as what you ).
You will be asked to enter your cluster name and region, as well as your Personal Token (the same as what you ).
There is a formal in place for reporting bugs. If you have discovered a bug, you should immediately DM the team or any other admins and/or report via the bounty program. If the bug is deemed to be serious/criticial, you will be paid a bounty commensurate to the severity of the issue. Reports need to include:
Bitcoin
Bitcoin (BTC), Litecoin (LTC), Bitcoin Cash (BCH), Dogecoin (DOGE)
Ethereum
Ethereum (ETH), Avalanche (AVAX)
Cosmos
Cosmos (ATOM), Binance (BSC), THORChain (RUNE)
Some node operators may desire to run multiple validators within the same cluster, while sharing a single set of daemons among them to save resource cost. This can be performed via the following method. These instructions are relevant for mainnet at the time of writing, but please ensure that correct network and current set of daemons are used.
Deploying a custom stagenet to have a developer-controlled environment
THORChain uses multiple network environments to move from an idea to mainnet deployment, each with a specific role:
Mainnet: The live production network where real assets are transacted. Security and reliability are ensured through validator consensus, with only well-tested changes deployed to minimize risks.
Stagenet: A pre-production network mirroring mainnet, used to test new features and chain integrations with real assets and participants. Changes require consensus, providing real-world validation but slower testing.
Devnet / Mocknet: A developer-managed environment for rapid testing and iteration. Validators and participants are fully controlled, making it ideal for testing new chains like TON, TRON, Optimism, or Arbitrum before advancing to the official stagenet or mainnet.
A devnet offers developers full control over the THORChain environment to test without impacting live networks. Key benefits include:
Autonomy: Configure without consensus delays.
Rapid Iteration: Test and refine quickly.
Risk Mitigation: Isolate changes to ensure live network stability.
THORChain supports gRPC for enhanced communication between clients and servers. This feature is available in the Stagenet environment for testing and development purposes.
Enabled gRPC Endpoint: A gRPC endpoint has been deployed and can be accessed at thornode-grpc.defiantlabs.net:443
.
CPU: 8 cores
Memory: 32 GiB
Storage: 256 GiB
kubectl: Kubernetes CLI [v1.31.1 or later]
Helm: Manage Kubernetes deployments with Helm charts.
Minikube: Local Kubernetes cluster for testing.
THORNode Binary: Core THORChain binary for managing nodes.
Install kubectl
Install Helm
Install Minikube
Install THORNode Binary
Save the faucet address for funding RUNE transactions in the stagenet.
Modify Deployment Configurations
Clone the node-launcher repository:
Edit thornode-stack/stagenet.yaml:
Enable Gaia Daemon only for testing:
Adjust resource allocations (CPU/memory) and persistence sizes.
Add environment variables for the faucet and chain configuration:
Deploy with Minikube:
Start the genesis validator:
Start additional validators:
Trigger network churn:
Verify connectivity:
Access API:
Custom Configurations: Use custom seed phrases or faucet wallets.
Enable Chains: Modify the docker-compose.yml or stagenet.yaml file to include more chains.
Deploy Custom Contracts: Override environment variables to test unique configurations.
For more details or if you encounter any errors in above steps, check out the docs in Gitlab directly:
New Feature Development: The addition of gRPC support is being tracked in , which adds the required functionality to the node-launcher repository.
Minikube simulates a environment locally.