Thorchain Affiliate Fees
THORChain is a cross-chain liquidity protocol. There are three layers to it:
- The Interface (ASGARDEX)
- The Public API (Midgard)
- The State Machine (THORChain)
Importantly, users do not talk directly to THORNodes, they query Midgard to display data, then broadcast transactions via third-party nodes to external chains. THORNodes then respond to these transactions.
This means, anyone can simply interact with THORChain simply by broadcasting a transaction on a connected chain. Interfaces are simply mechanisms for building transactions and displaying data. Indeed, exchanges, wallets, custodial services and more, can all facilitate access to THORChain by simply wrapping the experience in a user-friendly UI.
Thus, it is important that there are incentives to do so — that every wallet, exchange and custodial service provider has clear incentives to integrate THORChain, in addition to the utility of cross-chain swaps.
Affiliate Fees are the solution to this, and THORChain’s solution is non-custodial, decentralised and transparent. A wallet developer simply adds their affiliate address, as well as fee rate, to the transaction before the user signs it. The user can review it, as well as see the fee rate to be taken. When THORChain sees the transaction it will skim off the fee and pay it directly to the affiliate immediately.
To add a fee to a swap, simply add your affiliate address and fee (in Basis Points; 0–1000 0%-10%) on the end of the memo. The fee will be swapped into RUNE and sent to your address. Over time, your affiliate address will build up with RUNE.
> Due to missing MEMO data from Liquidity addition transactions, only Swaps will be considered for Affiliate analysis.
Format
SWAP:CHAIN.ASSET:DESTINATION:LIMIT:AFFILIATE:FEE
Getting the data
The data we require is to be taken from thorchain.swap_events
table. As the data we need is in the MEMO, we filter out the MEMO and then scrape from it.
In the MEMO, we break it into its components in an Array format using ':'
as the separator. Then the 5th and 6th element will give us the required data.
However, a shortcut can be used. A normal transaction will involve two swaps, one from Asset1 - RUNE and the second one as RUNE-Asset2. However, those transactions that are through an affiliate have a third transaction, a Asset1-RUNE transaction that is used to fund the Affiliate address. This can be tracked by filtering the Asset1-RUNE transaction and selecting the one with lower volume, as fee paid will be less than the volume transacted.
Then this can be aggregated and RUNE prices from thorchain.prices
can be used to calculate the RUNE value held.
Flipside provided 3 Affiliates. This combined with using the ThorName service, we were able to identify 5 different Affiliates
thor1a427q3v96psuj4fnughdw8glt5r7j38lj7rkp8
: THORWalletthor1zw97zhhgwy3u99rxpn7cyelj44y733ntgg30e8
: Defispotthor160yye65pf9rzwrgqmtgav69n6zlsyfpgm9a7xk
: THORSwapthor198d7hmxx9xptw8w3vswys30ss074selch3jw2p
: Decentral Fithor1qaum3rs98wzh7f66js0jveq6c99yegvpksdr2g
: Broken TNS
Looking at the overall data, we get around 40 Affiliate Addresses leveraging Thorchain Cross chain Swap functionality by providing UI. However, only one winner exists and its clear. THORSwap is the most popular DApp leveraging Thorchain. THOR Wallet has a competitive number of swaps, but the rather small size of the swaps, as most of the users tend to be retail users, THORSwap has the larger volume. So far, THORSwap has generated 5 Million USD or 1.6 Million RUNE worth of fees. This is impressive considering most DApps operate on sub 1% fee, which implies THORSwap has had atleast 500 Million USD volume since inception. THOR Wallet has generated around 100,000 USD worth Fees.
Looking at THORSwap alone individually, we can see most volume coming in during individual days. May 11 and June 11, the days of Terra Death Spiral and ETH’s downspiral to 800$. DEXes usually see alot of activity during these days, when arbitrageurs try to profit and thus ensure price if even across exchanges. On days of high volatility and extreme price movements, we see that as a spike in Fees generated. This suggests that smart money (or big money) tends to prefer THORSwap over other available avenues. As expected in the previous section, THORSwap has maintained a Uniswap v2 like 0.3% Fee charge.
THOR Wallet seems to have higher range of data, probably suggesting that the Team enabled affiliate fees much earlier. Once again, days of volatility has brought in the most fees. December 27 being the day of ETH dropping from 4000 USD. However, being a wallet provider, THORWallet targets a different kind of audience, i.e HODLers, hence volumes are generally less, even during day of extreme stress. Probably due to this, THORWallet levies a varying fee structure, ranging from 0.1 to 1%.
DeFi Spot is one of the smaller fishes here. DeFi Spot has generally made sub 1 RUNE Fee generation. Days of activity like the Terra Death spiral did bring in volume, and increased Fees as high as 1000 RUNE. DeFi Spot also levies a slightly higher 0.4% Fee on the Swaps made via its UI.
On a Further note, Broken TNS will not be analysed, as the activity exists for one day only.
Decentral Fi, currently doesn’t charge any fees ontop of the THORchain DEX, probably in a bid to attract users.
Its interesting to see that THOR Wallet is processing almost half the number of swaps as that of THORSwap, but the volume is lack lustre. Also, looking at the Fee rates of the 4 remaining Affiliates, THORSwap seems to be providing 0.3% Fee rate, while DeFi Spot provides a steady 0.4%. THOR Wallet rates seem to be varying , as the 0.65% looks weird. Broken TNS, despite 10% charge, has only one day of activity.