EP 34: Economics of Cross-chain DEX with Sifchain

Welcome back to a new chapter at Economics 
Design today we're going to talk about   something different today we're going to talk 
about cross-chain DEXs we talked about DEXes  before decentralized exchange we talk about them 
on a specific chain so usually built on Ethereum   you have stuff like Uniswap you have stuff like 
Balancer you have stuff like Curve so they're   exchanging between ERC20 assets we also talked 
about a different kind called Bancor and they   do different kind of crypto assets so it could 
be ERC20 it could be on EOS it could be on Tron   today we're going to do something a little bit 
different we're going to look at cross chain   DEXs so it has a different component an 
additional set of players and participants   to think about and we will dive deep into that 
so this specific project is called Sifchain and before I start I want to give a 
disclaimer that this is in collaboration   with BlockScience and Sifchain and 
BlockScience helped a lot in the discussion   and helped me to understand what they're doing 
and then this project is planned to be launched   in mid-January once again this is not investment 
advice everything is just purely educational   so today we'll cover 5 main things the first one 
is what is what is cross chain AMM or what's cross   chain DEXs how is it different from the usual DEXs 
that we are comfortable with and we talked a lot   about then we're going to do a bit of a whiteboard 
session so we're going to talk a little bit about   the big picture understanding of what Sifchain 
is about how do we look at validators liquidity   providers different traders then we're going 
to see the economics behind all these different   mechanisms we're going to come back and 
talk about the economics of the token itself   and lastly I’m going to run through 
some FAQs that you probably ask   so let's get started with cross chain versus 
the usual AMM that we're comfortable with   as I mentioned in AMMs or in DEXes primarily 
we're always talking about a typical AMM   so that is built on a specific Layer One 
so you don't have to think about how do I deal with validators to validate these 
transactions because that is done by someone else   it's a different protocol it's a different set of 
people it's a different company different project   different open source smart contract they're 
all Layer One so that's being done over there   and for typical AMMs they're just building a 
platform to transit between the crypto assets   so for example on Uniswap you can transact 
between Ethereum or Ether and Wrapped BTC Ren BTC SBTC SETH you know there are all 
these different assets available that's ERC20   that you could trade and swap around with so that 
is your typical AMMs that we are comfortable with   and we've talked a lot about you can go up and 
check more I’ll link them in to figure out what   am I talking about I think it's chapter Episode 19 
that discussed a little bit further into that then   we have another type where things at two episodes 
ago where we went to deep dive into Bancor   and Bancor it's different because it's similar to 
Uniswap so it allows you to trade between assets   and it expands a little bit further because you 
can also trade known ERC20 assets so it could be   assets that is listed on EOS or in Tron something 
else so if you think about it think of each   Layer One as a country so in Ethereum you know 
everything is built in the US so only US stocks   are being traded over there Bancor is where you 
can trade stocks that is from the UK you live in   the US and you can trade with UK stocks that's the 
rough idea and lastly we have this thing called   which is also cross-chain but slightly 
different that's what I want to talk about today   and it adds in a Layer One solution 
so it has its own Layer One solution   where it will validate each of these transactions 
as well there are a lot of pros and cons to that   you know pros generally being it's probably a lot 
faster it's a lot cheaper and you can control a   bit more of the different behaviors and different 
incentives to affect the different kind of   behaviors that you want to have in your ecosystem 
because you can control or you can incentivize   actions in the validators layer and the 
liquidity provider layer so the application layer   so the cons is that you know because you have two 
focuses now it's important to balance them and   balancing will be one of the big things that we're 
talking about in this episode so we're going to   the main difference between this Sifchain which 
is also includes its own Layer One is that it will   consider validation it would consider incentives 
and it will consider stuff like block rewards that   you're comfortable with in Bitcoin so let's go 
and chat a little about comparing the technology   of something with Bitcoin because Bitcoin 
is something that we're all comfortable with   so I want to show you the comparison of 
Sifchain with Bitcoin because that is quite   a similar idea so blockchain is really 
blocks and then you line them up in a   chain it can't be more straightforward than 
that so let's say this is Bitcoin right and so you have block one block two and block 
three within each block you have to validate what   do you validate you validate your transactions 
so this transactions is where all your this is   Bitcoin is all about P2P payment you have P2P 
payment between person A and person B so every   time it's done you know these are transactions 
that we validated will be input into the block   and then it will be minting the next block so this 
is where validators exist and you know in Bitcoin   how do we create Bitcoin Bitcoin is created 
when every block is validated you will issue Bitcoins now is 6.25 Bitcoins 
about 6 months ago it was it was   12.5 Bitcoins or I don't know one of them 
and then a few years ago it was 25 Bitcoins   and then 50 because so every four years it 
half right I’m sure you already know this   so every time a valley data this only one person 
validates yeah one winner he validates this block   and he gets I think right now it's 12.5 blocks 
12.5 Bitcoins so he gets he gets 12.5 Bitcoins   so this exists and this is how Bitcoin is 
being minted it's extra Bitcoin is coming   into the system so it means and validates each of 
these blocks and then it gets these transactions   so this is what we call Layer One so it's really 
the foundational layer the foundational layer that   that checks what's going on that validates 
all the different transactions that's going on   now what happens on top of Layer One okay we call 
this the dApp layer so the application layer so   the decentralized application layer and this is 
what I meant by your P2P payment P2P transaction   so if you pay me in Bitcoins which if you 
want I’m always happy to give you my address   so let's say you give me one Bitcoin to this 
company or to this company okay so this person   gives one Bitcoin to a company and this is on the 
application layer and so all these little details   will go into this block and be validated so that 
this in general how Bitcoin works right it's your   Layer One and then your application now let's go 
back to Sifchain so Sifchain as you can imagine is   also quite similar it has your Layer One solution 
and it has your little box to be validated so if we go back to the Layer One again 
you have block one block two block three   that will be validated so block one is when you 
have all these different transactions and then   you also have validators that will be getting 
your tokens and their tokens is called Rowan r-o-w-a-n so they will also be getting the rowan
tokens and these rowan tokens are basically your   block rewards and the key difference which we 
will go into a bit later is that in Bitcoin   your block reward is fixed it only changes 
every four years but here the block rewards   changes every single time a transaction occurs 
because it's dynamic it's dynamically increasing   and it's dynamically calculated so the Bitcoin the 
rewards the block rewards for every block that's   minted by validators they change and so Layer One 
is the validators which is same as Bitcoin then   what about the dApp layers in Bitcoin the dApp 
layer was P2P payment right so I’m paying you   you're paying me and that kind of currency payment 
in the dApp layer for rowan the thing is exchanges exchange or swap that means if I have one Lisa 
token and I have one Rowan one token and during   this during block one I trade ten Lisa tokens for 
ten Rowan tokens and someone else trades eight   Rowan tokens for eight Lisa tokens and whatever 
and all these different exchanges are going to be   added into this block which will be validated 
by your validators and they will get Rowan  tokens in return so this is the general idea 
this is the main difference so now that we have   that out of the way now that we understand what 
is the main difference between this cross chain application your cross chain decentralized 
exchange then let's dive a little bit deeper   to understand what are the mechanisms and 
economics behind Sifchain because it's   quite interesting and different you 
don't see this in the market yet   so that's why I want to talk about it so if you 
can see this little drawing that I have over here   as you can imagine we have two different layers 
right the first layer is your Layer One which is   your validators as you can see this happy person 
over here and then you have the other layer which   is your liquidity providers which is the other 
happy person over here and now I mentioned that   rebalancing is going to be very important in this 
aspect why because we have to balance between   the validators and liquidity providers in this 
ecosystem in all the other examples Uniswap and   Curve and Balancer in Bancor you're just going 
to focus on liquidity providers you're going to   figure out what is the rewards to give them you're 
going to figure out the math behind the exchange   you don't have to figure out the validation 
because it's done by someone else   so this is where Sifchain is different so what 
we want to balance now is to balance validators   and liquidity providers why because people have to 
make decisions so if I have some Rowan for example this is me and I have some Rowan tokens now I can make a decision if I have Rowan
tokens I can make 3 types of decisions one   I can be a validator two I can decide to be a liquidity provider or three I can just be a trader so I use 
the Rowan token to trade for something else   so these are the three different functions that I 
could hold and I could be to be a validator it's   the same thing as to be your BTC miner because 
you're validating transactions you're a miner   you're mining for additional tokens so if you're 
a validator you're basically like a BTC miner   if you're a liquidity provider then it's same as 
the you know your different LP tokens on Uniswap   on Balancer on Curve so if you're 
a liquidity provider then you could   it's the same as the same concept of 
liquidity provider in other projects   and lastly if you're a trader then it's the 
same thing you know you're a trader which means   you exchange tokens you exchange tokens between 
different kind of tokens so you could be   a user on Binance on Huobi on Kucoin on 
Uniswap Balancer Curve Bancor whatever   so me is a Rowan token holder I have to 
decide between these three and how do   people make decisions this is where economics 
comes in right all the opportunity cost so   if I’m a trader so there're 3 different functions 
that we could be a trader so if I’m a trader it   means that I want the price right now if Rowan 
cost one ETH I want the price of one ETH right   now if the Rowan cost 0.5 ETH I want 0.5 ETH 
right now so that's how you become a trader   if you are a liquidity provider it means that 
I want to put up my liquidity into the pool   so people can exchange and what can I do with 
it I can be earning additional money I can be   earning additional tokens by being a liquidity 
provider because I’m earning the fees   so this is something like I put money 
in the bank and I earn interest rates   right and lastly you have validators so it's also 
a similar concept I put money in the bank and then   I get different kind of interest rates and this 
interest rate is basically your block rewards   so in general we want to focus more on validator 
and liquidity provider mainly because you get   returns on that people like it when people like 
it people want to put more money in there because   if you're a trader yeah you get money right now 
but if there's potential that you're going to get   a lot more money in the future then you usually 
want to use the other systems instead so in this   episode we want to focus more on validators and 
liquidity providers so going back to the drawing   board what we have over here so now I will make 
a decision I don't care about traders so let's   say I really believe in the system and I want 
to earn more money based on the additional this   the current Rowan tokens that I have so either 
be a validator or liquidity provider so this is a   decision that I have to make and in economics it's 
about decision it's about making decisions right   so making decisions are your behaviors you want to 
understand how do people behave and what can we do   to affect this behavior and this is where rewards 
come in yes we all like rewards right rewards are   basically incentives and this is very good so 
you want to decide between being a validator or   liquidity provider well there's nothing that's 
free in the world you can't just get rewards   by not doing anything we do something 
by staking so if you are a validator you   have to staked tokens and if you're a liquidity 
provider you have to provide liquidity which is   different kind of staking so this is the decision 
you make do I staked or do I provide liquidity   now how do we decide other than all the different 
risks that you're considering one of the ways to   decide is in a very objective way is to look at 
incentives which are your rewards and now the   system has two forms of rewards you have rewards 
to liquidity providers and rewards to validators   so if you think about it you have a big bowl 
of rewards or presents because it's Christmas   time and then you have you can either put all the 
rewards inside here so you can be total rewards   and then you allocate it every time someone 
does something good so every time a validator   does something good you give rewards to validator 
if every time a liquidity provider does something   good you give rewards to liquidity providers from 
this reward pool in general yes you can do that   you can you can combine them together but 
if you look deeper into the whole mechanism   that we'll talk about a bit later what you 
want to do is that instead of one big box   you cut it into half so half is for 
liquidity providers one is for validators so the all the rewards inside here 
will only be given to liquidity   providers and all the rewards inside 
here will only be given to validators   because they're separate why are they separate 
because they exist on two different ecosystems   they're two very separate things that we want 
to encourage the two very different behaviors   to very different outcomes to the behaviors and 
that is why we have to separate their rewards   into two big segments into two separate segments 
okay so now that we have two different segments   how will the rewards be affecting validators the 
first part to validator is either the mint or burn   so as you can imagine this is something 
like you know the proof of staked  thing in Ethereum if you don't know what it is 
it's that you staked your tokens and then you will   get rewarded based on your staked and if you are a 
bad actor so if you validate some bad transactions   then your stakeds will be burnt okay so that's it 
when it's burnt the tokens just disappear it'll   be gone you can't touch it anymore nobody in the 
ecosystem nobody in the world can touch it if you   mint it that's where you have additional tokens 
there is the block rewards that we talked about   something like the Bitcoin that we talked 
about block rewards okay and what about   liquidity providers liquidity providers comes 
from few ways the first one is fees so as you   can imagine every time you make transactions you 
have to pay a small amount of fees so this fees is   calculated and this fees goes to the liquidity 
providers and it also depends on how frequent the volume is how because that affects the total 
amount that is given to the liquidity providers   and lastly it's also subsidy so subsidy is if 
you want to call it you can call it yield mining yield farming liquidity mining liquidity or yield
mining farming so this is subsidy  which is where your rewards you actually 
put some rewards in here where the system also rewards liquidity providers right okay 
so when we look at fees and volume servicing   in the top half of this line this is by users so 
users traders that we talked about just now every   time they transact then they will also give some 
fees to liquidity providers the main difference   with subsidy as you can imagine subsidy is given 
out by the protocol itself the system itself so   this is to the liquidity providers it's the same 
thing it's money given to me but from a back end   point of view it's different because decent fees 
comes from traders subsidy comes from the system   so why do I want to talk about this the fact is 
that at the end of the day we need to balance   this we need we need to balance between 
these two different circles because   once again if we have a big circle of 
total rewards we can we want it to be 50% to validators and 50% to liquidity 
providers why this is very important to   keep balancing this because as I mentioned 
it all goes back to the fundamental question   me as an individual over here I want to decide 
either staking or to provide liquidity and the   only reason I’m going to decide one of them is 
based on my returns that I get right your ROI   so your ROI is really based on your rewards 
and so if my rewards if the rewards is higher   in validators then everyone will go and be a 
validator and there'll be no one being liquidity   providers if there's no one being liquidity 
providers there's no traders going to be trading   and there's nothing to be validated and if there 
are too many liquidity providers every or too much   rewards to liquidity providers everyone wants 
to be a liquidity provider and there wouldn't be   enough people to be validating these transactions 
so it's not a very good system then so how do we   make sure that this system is good by rebalancing 
by balancing validators and liquidity providers so in this whiteboard session 
we're going to talk about 3 things   the first one is validator we want to dive 
a little bit deeper into understanding   the validator system then I also want 
to talk about liquidity providers   so there are two ways liquidity can 
be provided you can do it in symmetric and then you can do it in asymmetric so these have different formulas these have 
different mechanisms behind them and so I do want   to talk about them so we're going to start with 
validator system on this side then we're going   to move on to liquidity providers so let's get 
started with the validator system in the validator system it is pretty straightforward 
because so we have the total supply of tokens and as I mentioned before there are two 
ways we can do with just the total supply we can   either mint or burn so mint is where we have 
additional block rewards so a plus over here   or a minus where you burn if you're a bad actor 
so this will affect the total supply and so your   minting is basically a block rewards every time 
a Bitcoin is validated you get additional block   rewards so how do we split the total supply though 
the total supply is split into two different   things one is staked by validators and one is 
circulating supply as you can imagine so in staked   by validators this is stuck in your Layer One 
and in the circulating supply this is basically   in your dApp which is your application 
layer so there are two different layers now in the staked by validators we call them v 
small v and then in the circulating supply we   call them c small c and in the circulating supply 
we can use them in two other ways the first one is   to be used by liquidity providers and the second 
is other on-chain activities so to be a liquidity   provider you have to staked your Rowan tokens 
to have liquidity right because every time we   talk about decentralized exchange we talk about 
autonomous market maker you're basically trading   with the reserve and this is part of the reserve 
the onchain activities will be probably governance   different kind of voting or you're basically 
just trading or peer-to-peer exchange you   know paying in Rowan tokens so these are the two 
different kind of systems that we're talking about   now we want to dive a little bit deeper into 
understanding what are the different parameters   that will affect the validator system and the 
reason why I’m talking a little bit more on the   validator side is because number one I’ve not 
talked about Layer One in the entire podcast   series yet so I want to show you a little 
bit more about Layer One and the second thing   is that all the application layer is pretty 
much similar in concept so I don't want to go   and repeat the same thing all over again because 
you probably already have understood what it is   okay so when we talk about validator 
system there are two main things that we   are discussing we're discussing I and we're 
discussing A so imagine I is your inflation and this A is your accumulated block 
reward so it's your total block rewards so if you think about it you know 
they're pretty much the same thing   inflation is the additional of new 
assets that's entering the system   and A is the total number of assets 
that is introduced in the system per   year the main difference is that inflation 
is in percentage and A is in whole numbers okay per block and A is whole numbers and total amount so this is the main difference and this is 
your inflation is your amount per blocks   and this is your total block rewards over a 
period of year over entire year so you know   the thing about inflation is that as you can 
imagine inflation is the amount of new tokens   being introduced into the system now you have to 
balance this as well this is another balance that   we have to talk about and you there's minimum 
and maximum inflation so let's say this is time   so there's a minimum and maximum 
inflation that's fixed and in general you can fix this in a smart contract and so every 
time inflation is recalculated because this is   dynamic it calculates all the time it has to be 
within this threshold within this max and min bar and so these are Lisa constraints 
that we have included in the system   and what does that remind you of remember we 
talked about Ampleforth which I’ll also link up   and Ampleforth is an algorithmically rebalancing 
stable token or pegged to USD soft pegged to USD   with this upper and lower bound of 5% so 
it's you know it's really the same concept   the thing about all these different economics 
and all these different episodes is that you have   the same concept applied differently across 
all these different projects and protocols   how cool is that so you just need to learn a 
few and then you realize you learn everything   okay so let's do a little bit of math 
for the inflation part it won't be too   complicated I promise you so as I 
mentioned this is the rate right so this is the percentage rate so 
let's look at the annualised rate so the annualised rate and let's 
look at the change in inflation   so we call this positive change I plus one minus over rho v over gamma v times I over beta 
okay so what does this mean and   this is also within our range that we talked about 
I mean and I max okay so what is this formula it's   really not that complicated let's look at what it 
is okay firstly what is rho v and what's gamma v so rho v and gamma v remember I told you that 
one of the cool things about the validator system is that it's not a fixed 
supply it's that every time a block reward and every time it's being minted 
the block reward is dynamically calculated so how do we calculate this dynamic calculation 
it's a bit complicated to understand right you   can't just say something is dynamic and suddenly 
it's dynamic no we can turn this dynamic thing   this word dynamic into the language 
that mathematics can understand   and then when mathematics can understand your 
code and your smart contract can also understand   okay so let's look at what this is so we when we 
look at rho v and then gamma v so rho v is the   actual percentage staked gamma is the ideal 
percentage staked okay so remember I told   you that there's this 66% I don't write things 
here for nothing okay 66% is the ideal stakedd   so if we have 100 million tokens I want 
66 million to be stakedd by validators and then the other percent doesn't matter it will 
just exist somewhere else with other use cases   so this is something that we want to balance 
66% and this is fixed okay this is the only   thing that's not dynamic it could probably 
change in the governance layer after that   but it's okay it's fixed for now 66% 
so this ideal percentage staked 66% and the actual percentage staked will be 
you know your amount of v over your total   and this would be your whatever percent 
so let's say this is less than 66%   and so that means this ratio okay so there's 
three situations where this ratio will be   different or there are only three stakeds this 
ratio could be so it could be less than one it   could be equals to one it could be more than one 
so when it's equals to one that means goal reached   why because the ratio between actual staked and 
ideal staked is the same that means the extra   staked will be 66% which is exactly what we want 
and so it's one so the change in inflation will be   zero there will be there will be no additional 
rewards because it is really what we want   and then there'll be change of and then people 
will behave and react accordingly and then you   can change after but the change in inflation 
so the additional inflation will be zero so   the inflation will be whatever it is before now 
what happens when it is less than one less than   one means we want more validators why because 
it means that the actual amount stakedd is less   than your ideal amount stakedd that means maybe 
I have 50% stakedd of which I want 66% and so   this is less than one right you can obviously see 
it's less than one because 50% is less than 66% so if this is less than one this entire thing 
will be will be positive and so this change   in annualized interest rate or an annualized 
inflation rate will increase and so you will have   minting you'll be minting new block rewards 
because you'll be increasing the inflation rate   and what happens when it is less than 
one it means we want less validators   what does it mean that when it's more than one it 
means let's say we have 100% in your rho v so 100% is completely stakedd and 66% is what we 
want so that means this is more than one   obviously because 100% is more than 
66% so we want but less validators   how do we do that we can't just tell 
people hey stop being a validator   people listen to instructions people respond to 
incentives this is what all economics is about   so what how do we do we so this is more than one 
that means one minus something more than one is   negative right it's a negative number and so this 
entire thing will be less so this entire equation   will be a negative sign and so we will reduce the 
rates that means we will reduce the minting will   have less block rewards and no block rewards will 
reduce the previous inflation rates that we have   so this is in a situation when that happens 
whatever we talked about here right as you   can imagine this is your annualized inflation rate 
this is your total block rewards so this is from   an annual perspective now this is good for you 
to understand when you're making a decision   whether you want to be a validator or liquidity 
provider now what we're going to do next is to   look at each individual block reward because 
I told you block rewards are very important   it helps you to make a decision whether you 
want to be a validator or liquidity provider   and so we want to change this we want to 
decide this so block rewards only makes sense   if we look at these values as an individual 
block not annual rates let's look at that we have so A is the total 
additional mint per year right so let's say you're going to mint 20 
million and A will be 20 million tokens   that's basically what A means and then 
you have Beta which is your total blocks per year okay so can you see where I’m getting it 
now so beta is the total blocks per year that is   defined by the system you can't really change that 
it's defined already so what we want to do now   is look at small b which is A over beta so 
what we want to do is small b is the rewards   per block small b is the total additional mint 
per year divided by the total blocks per year   and you get block rewards per block it's as simple 
as it is okay so it's a very basic a very basic   thing it's just A divided by beta and well how do 
we get A A is your additional mint so A is really   your inflation rate that we talked about because 
inflation is percentage multiply by your supply   right because inflation is a percentage multiplied 
by the supply that is whatever that's out there   in the total supply and you get your tokens the 
specific number the whole number tokens may we   added into the system so what does that mean it 
means that b equals I times let's call supply S   over beta okay and what we want to do now and 
okay the specificity of the math I will link   it in the description box below but what you 
get at the end of the day is this thing called so v is really the validator 
and dot is just multiplication   so it's how do we get to a 
situation where this is term A these two are the same terms and then 
you have an additional thing behind   okay and this is where the fun stuff of this 
whole dynamic rebalancing happens so let's   jump a little bit into details 
now what you can see over here is where do we see this value  this value is you see is the amount 
stakedd right this is your actual stakedd by validators and sv is your no actual amount 
so this is percentage this is ideal staked Ideal stakedd so what we're trying to calculate 
over here is that the inflation rate multiplied   by the ideal stakedd times the actual amount 
versus the inflation this is multiplication sorry   multiplication times the actual amount 
stakedd and what do we get so like the fraction that we have just now we 
have 3 different scenarios so we have   when something minus something it could be it 
could be smaller than one it could be equal zero   it could be bigger than one so equals zero is that 
they're the same thing right if equals zero it   means that the ideal amount stakedd and the actual 
amount stakedd is the same so again we get goal reached and that's a good 
thing because this equals zero   so we don't have to change anything about 
the individual specific block that is minted   on the other hand when it is less than 
one it means this thing the front one   is smaller than this so less than one it 
means that the actual stakedd is too much okay so what happens when the actual 
the too many validators in the system   then you want to reduce your individual block 
rewards so less individual block rewards   and you want to disincentivize people 
from staking on the other hand let me use   a different marker on the other hand 
when you have more than one so that means   the first one is bigger than the second it means 
that we want to have more people as validators so we want more validations if it's like 
it's more than one so if it's more than   one this entire thing becomes positive and so 
we have more b so that means when there isn't   enough validators in the system the system 
will automatically rebalance to give out   more block rewards per individual so 
that is the gist of the validator system   I hope that makes sense and now we're going to go 
on to the liquidity provider which is a completely   different sub-segment a different ecosystem from 
what we talked about before so the base case of   symmetric addition is everything that you see in 
Uniswap and all the other AMMs out there and it is again we have our liquidity pool and I have two tokens so I have my Rowan token 
and I have my Lisa tokens symmetric addition   means that I’m adding in Rowan tokens and 
I am adding Lisa tokens and what do we get   we get Rowan tokens Lisa tokens and then 
additional new Rowan tokens and new Lisa tokens   and you can see that these are both liquidity 
pools and the cool thing is this remember we   talked about invariant long time ago in episode 
19 I will link it up there and invariant means something that is kept 
constant so this is what invariant is   so what we have in invariant is that in 
these different liquidity pools you have   you know you have your X times Y equals K
model this is really X 0.5 times Y 0.5 equals K   I also have the video I’ll link it above you 
want to go check out all the specific details   but that's a general idea X times Y equals K 
and so when we increase them proportionally   because this is a proportional thing then you will 
still get the same thing okay you're still this X times Y equals K X times Y equals K
because they're proportional so this is what   symmetric addition is symmetric addition is really 
adding the same quantity into the liquidity pool so that is the main thing that I 
want to talk about in symmetric   addition and I also want to talk a little 
bit about the fees because the fees is quite   interesting I’m going to give you the big 
gist first and when we talk about fees these are your transaction fees transaction 
fees that is embedded within the system and not   additional calculation after your transactions 
what do I mean I mean if I have Rowan tokens   I have Lisa tokens I want to 
trade if we have an external fee it could be something like 
you know a fixed fee of 0.03   Rowan per transaction or 
we can have an internal fee where we embed the fees into transactions so 
for external fees that's in general what you   get for a lot of these systems out there so 
for example Bancor Uniswap they have a fixed   fee for every transaction so it makes sense if 
you are a big trader arbitrage trader you trade   a lot a lot of fees and then you're just paying 
a fixed fee of a small amount whereas internal   fee it depends on the size of your trade 
it depends on the depth of the liquidity   and it benefits differently so external fee you 
know it's good for traders especially big traders   and then our internal fee is 
good for liquidity providers okay so this is the main big difference 
your internal fee and your external fee   now that we got that out of the way let's 
look at how they decide to deal with this fee of course nothing is so easy and then I’ll tell 
you what the answer is because the reality is that   the fees have a spectrum your fees is a spectrum 
so we have our constant market maker spectrum   and so this would be like your Uniswap where your 
fee is external fee external fee zero internal fee and then the other on the other end of 
the spectrum you have CLP continuous   liquidity provider I think that's what's 
called a liquidity provision and this is   I think it's zero external fee but you have yes internal fee and example of this would be Thorchain someone 
asked me to do thought chain like long time ago I   will get back to that just a lot of things on 
the list of episodes to make okay so basically   what Sifchain does is that this is the 
lower bound so this is your lower bound and this is your upper bound so your fees will be somewhere in between 
this line do we know what the exact fee   is it really depends and what 
does it depend on let's see so   I’ll just show you what the formula is because 
as always I will link them in the description   below for you to get more details of 
the specific math because I filmed this   and it took one hour and I don't think 
anyone is going to sit through one hour so I’m just going to summarize and refilm 
it this is the third time I’m re-filming   and summarize it instead so I am going to show 
you what the formula is and I’ll explain the   formula instead because it makes more sense to 
explain it and give you the intuition of what they mean okay so this is the fee and Q is the 
quantity R is Rowan tokens L is Lisa   tokens so we're exchanging and then we're 
paying Rowan tokens so we're basically   changing Rowan tokens to Lisa tokens and this is a 
fee formula and what I want to say is that if you   go back to the formula the episode that I have 
I’ll link it up as well the episode that I have   on how do you calculate impermanent loss this is 
your Uniswap model so this is your no internal fee model in which you it's 
basically the Uniswap model so this Uniswap model is your internal no 
fee and you're basically calculating the   difference so small q is the change 
in in tokens that you receive and   you're basically figuring out how much how much 
Lisa tokens you get in exchange for Rowan tokens   that you put in this is the internal no fee 
model and this is your internal fee model and the key difference over here 
is this thing right if we have   if they're equal so if we make this equal then 
we will just go to a full no internal fee model   and we also add some parameter over here so that 
you can have more form of customization more   variables to play around with to affect the fees 
payable and you can so this variable over here   we can have it in 3 different scenarios as 
well equals zero equals one more than one so if it's zero so you know this can be 
whatever it is dependent on this parameter   and this parameter can be zero and it means 
that we use the no fee model and that means   we use the Uniswap model if it equals to one 
that is we use the yes internal fee model and if it's more than one we have huge fee 
and these fees are bad for traders but good   for liquidity providers because one of the biggest 
things that as I also talked about in the Bancor episode is that liquidity providers are usually 
at a huge risk at a huge vulnerability when there   is a huge arbitrage going on so for example if 
a trader knows that there's a huge arbitrage   opportunity coming up they're going to be making 
huge trades and usually this goes to the detriment   of the liquidity provider because they are the 
ones suffering the loss it is a zero-sum game in   the scenario so how do we prevent that we prevent 
that by giving a big fee so increasing this   parameter to be a huge one so this fees
it goes back to liquidity providers and arbitrage   traders I mean they're earning anyway so they're 
actually sharing the profit back to the liquidity providers who exist in a good way to allow this 
opportunity to be given to arbitrage traders does   that make sense it basically this huge fee is just 
profit sharing for arbitrage traders that's it so   that's the general scenario and that's what I want 
to talk about because the symmetric addition it's   the same everywhere I’ve had two long episodes 
talking about AMMs I think you are tired  about hearing it so I want to give you a 
different perspective to talk about which is   your internal fees external fees how do we look 
at internal fees how do we affect internal fees   how do we change internal fees so that it is a bit 
of a more fair system so that liquidity providers   are not constantly suffering impermanent loss this 
thing is basically to make up for impermanent loss   period so that's symmetric addition now 
let's move on to asymmetric addition   okay so let's get started with asymmetric addition 
I’ll use picture again because that's very easy   step one we have Rowan tokens we have Lisa tokens   step two somebody wants to add 
additional Rowan tokens inside well that's basically it what 
does asymmetric mean right asymmetric means that you're only adding one side   so how does the system deal with that 
firstly do you remember when we talked about asymmetric addition we talked about it in Bancor 
so Bancor’s version 2.1 talks about asymmetric   addition when the protocol itself will be 
pairing up or be adding the other side of   liquidity now we go a step further to see how 
the asymmetric addition can be added into the   liquidity pool and equalize the composition let's 
see it's actually really easy in visually I mean so step one is to fully add the tokens inside   okay so remember we have the X times Y equals K
model this works if we do X times Y get K model   does not work because they are not proportional 
so what do we do then we go to step three so okay it's not equal what do we need to do to 
equalize it so that we get X times Y you get K   again so it basically sees this Rowan token and 
then it takes away this part using the liquidity   in the pool itself to trade it for Lisa tokens 
so that it's balanced again so it is once again   it's the same thing Rowan and Lisa tokens 
inside and then you also have proportional Rowan  token and Lisa token inside the key difference 
is that the system itself will rebalance   the one side that liquidity you add in so that 
it balances out that's it so just now we talked   about liquidity providers we talked about 
the fees chargeable to liquidity providers   in this scenario it's quite interesting because 
number one you have to pay a fee to do this Rowan   to Lisa token exchange at the same time because 
you are if you already are a liquidity provider   in the system then you also earn fees when this 
happens because it gives to the liquidity pool   so it's a very interesting dynamic because you're 
adding and removing you're paying and getting some   subsidy almost back into the system so it might 
be it really depends but it could be cheaper   if you're just adding one side and because 
you can potentially get to earn as well so okay in general this is the idea I’ll just 
do one last very simple method to show you   how it works so it will make 
more sense when you're reading   the math stuff if you want to go into that stuff so this is the change in quantity of Rowan so it's the change in Rowan plus okay so this will be the last small part   the change in Rowan token so that 
means this is your addition you know this black box so this black box will be 
divided into add add is this one and swap  so swap is this red thing add is this black thing 
and so when you're adding it into the system   the system both the smart contract 
you know it's all defined by math   will decide how much is swapped how much is add so 
how much is the add here how much is the swap here   plus some error term so dust is usually an 
error term and this error term exists in a   lot of mathematical models because we can't do 
everything perfectly sometimes there's some bits   and bobs here and there and so we put the error 
term inside and that's it for the ecosystem   so let's take a deeper dive into the economics 
of that the design of the Rowan token   so now we're back talking about the economics 
of the Sifchain token which is the Rowan token   and I just want to emphasize some points that I’ve 
really talked about on the whiteboard when we look   at market design one of the main important things 
before we even design tokens the tokens have to   be used by someone there must be a reason that 
the tokens exist for it could be a rules kind of   game where the tokens exist for but people have 
to use it there must be someone using the tokens   and so we have to start off with this actors and 
participants because at the end of the day tokens   are just a medium a medium to incentivize people 
to behave in the way you want them to behave so   who are these people we're talking about when we 
go back in when we do a recap of what we talked   about just now the first thing is validators so 
these validators will be like your Bitcoin miners   your liquidity providers or your validators your 
liquidity providers as well as your traders or   people who just exchange tokens these are the 
3 main actors and the two actors that we want   to focus on is the validators and liquidity 
providers because this is where we can use   the tokens to affect them the most and how they 
decide to allocate or where do they decide to   allocate their tokens they could allocate it to 
be to the validators pool to become a validator   or they can allocate it to the liquidity 
pool to become a liquidity provider   and it really depends on the 
rewards that's given to them   so in the validator segment the firstly the 
block rewards are determined dynamically as   we have seen we ran through just now it depends 
on how many blocks minted and it depends on the   number of validators in the system it depends on 
the kind of inflation that we're talking about   it depends on the comparison between the actual 
number of validators we have in the system versus   the ideal number of validators we want which is 
66% so 2/3 and on the liquidity provider side   it depends on the fees earned as well as the token 
rewards so in Sifchain the first 12 weeks that   they start they roll out and they're planning 
to roll out in mid January you're going to do a   12-week subsidy which is what you probably call 
yield farming or liquidity mining where you all   where the system the protocol will also subsidize 
some rewards given to the liquidity providers   it's quite similar to a lot of these yield 
farming liquidity mining systems that's   out there just that it's not long 
term it's very specific to 12 weeks   so let's look at the Rowan token design itself so 
the few factors affecting the Rowan token first   one is the percentage staked by validators 
as I mentioned there is the validator staked   the ideal versus the actual staked so that 
would be one of the main key difference   the second is the staked by liquidity 
providers because in of the 1/3  that's not stakedd by validators 
then people either use it trade it   or become a liquidity provider and so 
you want to balance that as well then   you want to balance the rewards between liquidity 
providers and validators because there'll be   rewards given to them and if one of them is too 
much people will all flock to the other side   and the system will not be so robust remember 
if too many people become liquidity providers   there isn't enough validators transaction fees 
would be very expensive people could exploit   the system this is where you could have your 51% 
attack if there's too many people being validators then there isn't enough liquidity providers 
there isn't enough transactions that's going on   and that will be a bit silly to be validator 
because there's nothing to validate   so that's the other problem so how do you balance 
both of them then you also have your minting   schedule to the validators which is your minting 
and burning structure in general a way to reduce   the amount of there's a fixed supply and the way 
to reduce the amount of tokens is through burning   and burning is when a validator is a bad actor or 
you can it can be more people staking so you have   less circulating around and then otherwise it's 
just the minting reward schedule the block rewards   and lastly it's your LP tokens your LP 
rewards so that as I mentioned it's a   12 week subsidy program that Rowan 
the Sifchain will get started with and one of the things that you realize that keep 
talking about in this entire whiteboard session   is rebalancing we have rebalancing in two main 
ways the first one is where you are balancing   the rewards between validators and liquidity 
providers so that you have a correct amount of   people in or a correct amount of participation 
in both systems on the other hand we also have   rebalancing in the liquidity pool because you can 
have asymmetric addition to the liquidity pool   and the liquidity pool will balance itself out 
to make sure that it is the same amount again   and so yeah there are a few things to balance to 
make sure that the system is robust on its own   as well as dynamically taking in a lot of 
variables so that it constantly rebalances itself   that's about it for the
project Sifchain will probably start the schedule   day of launch is in mid-January and I think this 
system is quite interesting I was very interested because it adds a new dimension a new layer 
to such systems one of the problems with all   these different systems built on this Ethereum 
blockchain is that transactions get very expensive   yes it's true that a lot of ERC20 tokens can 
be traded and there's more demand to it but it   can also be very expensive when so many users 
are trying to make transactions so you have   other systems like on Thorchain on other 
Layer One blockchain but they don't exactly   interact with ERC20 tokens which is where most 
of your demand and trade will come from anyway   so Sifchain resolves that by having both 
validators to validate your transactions   and also the liquidity providers 
that's in existence on their system   so think of it like a Layer Two solution 
building their own dApp application in the   Layer Two it's this very similar concept so 
other Layer Two protocols will be like NEAR  I don't know if Silica is considered Layer Two but 
they use sharding in their Layer One in their your   system to make it faster make it cheaper and you 
have a lot of other you know ZK roll up mechanisms   so right now one of the problems in Layer Two 
solutions which I’ve talked about in the previous   episode is that it is still quite fixed you know a 
lot of Layer Two solutions they're not as it also   depends if you're talking about side channels 
or child chains right they're quite limited   in the amount of epic complex applications 
that they can run and they can host and so I   thought Sifchain might be a very interesting 
example that I could share with you guys   where it doesn't have that kind of problems that 
you have in child chains and side chains at least   right now which is your the whole data side 
of things and right now it's just looking at   validators validating transactions and the 
application instead of being a P2P currency   like Bitcoin it really focuses on P2P exchange 
and decentralized exchanges so that is it for this   week's episode I hope that makes a lot more sense 
I wanted to talk a little bit more about the math but I realized that a lot of the step-by-step 
things already out there and I’ve really talked   about the math side of AMMs quite a few times 
so I really don't want to be repeating myself   I don't want to be wasting your time so I wanted 
to go into the general understanding as well as   the different mechanisms and considerations 
to look at when you're designing the system   especially rebalancing which is a very key 
component when you're designing rebalancing   of the economics of the entire system and the 
entire two subsystem which is the validators   and liquidity providers so that's all 
for this week I really hope you enjoy it   the token economics book is also out 
if you're interested you can just go   to book.economicsdesign.com the eBook version is 
coming out in a couple of weeks I’m just getting   it redesigned so that you could highlight you 
can add notes you can read it in dark mode and   you can have more hyperlinks in between the 
chapters till then I’ll see you next week bye you

You May Also Like