Thorchain vs. Chainflip
Thorchain
Thorchain is a Tendermint blockchain & uses the Cosmos SDK. The chain is secured by Thornodes (up to 100) who are mandatorily anonymous. Thorchain continuously removes nodes and increases the churn rate to ensure they are censorship resistant. They do not support delegation. Overall, the system is privy to 4 types of users: liquidity providers, swappers, traders and node operators.
Thorchain currently supports ETH, BTC, BSC, Bitcoin Cash & Litecoin.
Liquidity providers will provide liquidity in Asset/$RUNE 50-50 with a yield which is calculated per block & paid out at withdrawal. Yield rewards for LPs vs. validators are adjusted according to the total staked capital in the system (i.e., incentive pendulum). LPs receive swap fees and Rune rewards.
Traders will monitor the network and continuously rebalance the system. They pay the fees to LPs but are expected to earn profits from the arbitrage opportunities.
Swappers are users of the platform who will also pay fees and trade with the AMMs.
The incentive pendulum ensures a balance of liquidity pools and the Thornode’s bonds. The network will dynamically adjust the rewards in favour of the scarcity hoping to incentivise a flow of liquidity.
Since the system rigorously re-targets a 67-33% RUNE split, the value of the bonded rune will double the value of the pooled rune. Since LPs deposit 1:1 Rune and connected assets;
value of assets in the network = value of pooled capital rune
Total market value of RUNE = bonded rune (2x) + value of pooled rune (x) = 3x value of connected assets on the platform
Continuous liquidity pools in Thorchain charge dynamic slippage fees based on the market depth of the deposited assets.
Thorchain Attack of July 16th, 2021
Thorchain’s LPs experienced a loss of 4,000ETH from their vaults. Subsequently, $RUNE lost 15% in its FDV. The TVL on the platform was apx $485M on Tuesday, 13th July and is down to $435M post-attack. The remaining robust $435M in liquidity is likely because of the halt of any trading activity on the network.
Users of Thorchain also experienced issues when they attempted to transfer assets into their Thorchain wallets. While their source wallet showed a successful withdrawal, they did not receive a deposit in their Thorchain wallet. The issues regarding this are still unclear.
The attack was caused due to a custom smart contract being introduced by the attacker to the router. The router was modified with how it interacts with the smart contracts to improve composability within the network. It allows the router to be called by another smart contract in which the “To” field is changed without the approval of Thorchain/Thornodes. This functionality was further exploited to withdraw 4K ETH from the Vaults.
The treasury currently has sufficient funds ($18M) to sufficiently compensate the ETH LPs. Currently, the team has also requested the hacker to refund the hack in return for a bounty.
The team took necessary steps to secure the network detailed here.
Chainflip
Similar to Thorchain, Chainflip uses Substrate-based framework to create its state chain. The state chain is secured by validators - vault nodes & quoters. Their native token will be $FLIP, ERC20. Chainflip will support ETH, BTC, DOT & SOL at launch.
To prevent some of the defi attacks they have in place slippage limits & a transaction ordering algorithm which limits and prevents front-running attacks at the gas fees levels. The validators will use the timestamp of the trader’s quote to order the transaction rather than the gas fees.
According to the team’s responses on Discord, their AMM model is similar to Uniswap V3 but written in Rust. They will allow for asymmetrical liquidity provision once a certain level of market depth is reached. The settlement currency in the system is USDC as compared to Thorchain which uses RUNE.
The design of the is comparable to Thorchain with a few distinct features:
Cryptography
Thorchain uses ECDSA which allows it to be compatible with any blockchain. On the flip side, Chainflip uses EdDSA which makes its vaults more customizable to each blockchain but adds additional complexities during the integration stages. The trade-off is the speed of key generation & signing which would be faster than Thorchain’s GG20.
Wallet Agnostic Approach
Thorchain manages the complexities of managing wallet addresses across multiple chains by using its own wallet called the Thorchain wallet. The wallet has successfully integrated with xDEFI as well. Chainflip wants to remain wallet agnostic & hence provides its users (traders, swappers & LPs) with a deposit address per quote. This address & quote is facilitated by a decentralized network called quoters. The reason for a new deposit address is because Chainflip uses Heirarchical Deterministic Wallets (HD wallets) which is connected to each vault. To reduce the operational burden on all vault nodes to manage keys for every transaction in the vault’s 28-day lifecycle, each vault will implement the HD wallet system where a master key pair is used to generate new deposit addresses in each vault.