Open bedeho opened 2 years ago
It seems to me the best tradeoff here would be something that never is really bad, but works Ok in a wide range of circumstances, which would be Linear? It's also way easier for people to understand. I think we should just pick a single type of curve for our first implementation, adding additional curves in the future will be very easy, no migration needed, and it will be with the benefit of more concrete information.
Linear would stand somewhat in the middle of all described tradeoffs. I think it is a good choice for initial experimentation since it is not largely exposed to one risk in particular
When it says that Initial Liquidity bootstrapping capabilities are very good, does this not mean that its simply really cheaply selling off the tokens to buyers, which is at the expense of the issuer?
No I used that term to specify that price growth is the fastest in the beginning of a project. So early investors can benefits of larger price upswings with respect to early investors. This is effectively an incentive to buy early rather than late. This effectively doesn't keep CRT price low for long, if selling initial CRT for cheap is desired polynomial curves are more suitable.
Price based slippage constraint seems most direct and simple, but is it the same as is used on say Uniswap? may be wise to just stick with their exact same version of slippage tolerance, as people already know this.
Yes Uniswap, Pancakeswap and similar (constant product market makers) use the same slippage protection mechanism, namely tolerance % + execution deadline. (Uniswap allows you to set these parameters in expert mode)
The following research
https://github.com/joystream/atlas/issues/2728
y(x)=ax+b
.b
, namely initial $JOY price.f
which is used to set a=f(Q)
where Q
is the issuance, otherwise the curve will not make sense. To me f(Q) = p/Q
for some global stored p
.p
? a
if Q=0
a
if Q
is some low number, like 2 ?I suspect the way a
is picked needs some work.
If you look at the mathematical proof for the Bancor formula it looks to me with alpha = 1
(in their notation)
their value for a
would be initial supply / initial_price
i.e. is an arbitrary constant.
I would suggest:
a = 1
value
The formula seems to suggest that are no value better than others
b
ok
it should be possible to turn off an AMM any time if you are issuer, $JOY is burned
Will it be possible for a issuer to also restart the AMM anytime after or the issuer can just start and turn off the AMM only once in the CRT lifetime?
vesting schedule for AMMs should be optional specified by issuer, and it is aligned with point of purchase of $CRT
Does this means that after any account purchases amount X
from the bonding curve (=> supply is increased by X
at one time) X
is then vested to the account over a block period ?
Some questions/thoughts:
Question: Do we want new CRT to be minted during AMM or do we want AMMs to be backed by existing CRT, just like sales?
I think the latter is preferable, because otherwise we're introducing another possibility of minting and diluting existing tokens, other than the patronage (which has a clear, predictable yearly rate, so it's not really a problem). This opens up a lot of opportunities for misuse, for example, creator can do the initial sale and then "take back" the the channel reward cut by diluting tokens through series of AMMs, where he can cheaply buy (mint) his own tokens.
If we were to force AMMs to be backed by existing CRT, another advantage of that would be that in this case creator cannot sell any tokens that were used to back the AMM, unless he buys them back himself, meaning that the creator doesn't have to opt into a vesting schedule during issuance to prove he's not going to "rug pull", he can just start an AMM backed by all the tokens he issued and he would only be able to participate in the AMM on the same conditions that everyone else can (ie. if he buys, he will be bound by a vesting schedule specific to that AMM).
it should be possible to turn off an AMM any time if you are issuer, $JOY is burned.
If the JOY from the AMM is burned, this means there is almost no incentive for the creator to sell tokens through AMM, other than to find out how much JOY are people willing to pay for his CRT before selling it through Token Sale.
Question: Do we actually expect the AMMs to be treated only as means to measure the demand before starting Token Sale, not as an actual source of revenue for the creator?
My initial understanding was that we want the creator to be able to earn JOY for the tokens sold through AMM, same way he can earn JOY when doing a Token Sale.
There are actually two ways the creator could possibly earn from the AMM:
Claiming all the funds when closing the AMM (assuming the creator needs to provide his own CRT to the AMM first)
Thoughts: Linear curve vs. predictable CRT issuance / AMM backed by existing tokens.
I suppose that regardless of whether we require AMMs to be backed by existing CRT or we allow minting new CRT through AMM (which as I mentioned before, is probably not a good idea), we would have some limit of how many tokens can be bought on a given AMM.
For simplicity I'll assume we just have AMMs backed by existing CRT, so if someone starts an AMM with 1_000_000 CRT
on sale, then obviously no more than 1_000_000 CRT
can be bought.
If we want to stick to linear curve I can see two options and both have their pros an cons.
First let's define some variables:
i(C)
- CRT issuancei(J)
- JOY issuancec
- number of CRT "backing up" the AMMf(x) = a * x + b
- our linear curvef(x)
- price of CRTx
- number of tokens "taken out" of the AMM (ie. if the AMM started with 1_000_000
CRT and now there is 300_000
CRT remaining in the AMM then x = 700_000
)b
- starting priceNow on how to determine a
:
Option 1: a
is enforced
If we want the runtime to enforce a
(instead of the creator having any impact on it) I think it makes sense to just assume that no CRT will have a market cap greater than the market cap of JOY, in which case a reasonable price to reach as x
approaches c
would be i(J) / i(C)
JOY. From that we can simply calculate a
knowing b
, c
, i(J)
and i(C)
(which the runtime will know):
f(c) = i(J) / i(C)
i(J) / i(C) = a * c + b
i(J) / i(C) - b = a * c
(i(J) / i(C) - b) / c = a
(we assume c
is not 0
and b < i(J) / i(C)
, which should be enforced anyway)
The problem with this approach is that for almost any CRT this curve will be too steep (in the sense that the actual price that people will be willing to pay will be reached way too quickly and most of the CRT will end up just "stacked" in the AMM, providing no useful liquidity), since we're basically relying on "highest possible" market cap for CRT, as the runtime doesn't have enough information to make any assumptions about it's value.
Option 2: Creator specifies both starting_price
/min_price
(b
) and some max_price
, based on which we derive a
Here we're mitigating the problem described in Option 1 by forcing the creator to provide additional input based on which we would derive a
. In this case the creator is able to provide a more reasonable max_price
according to his judgement, which will in most cases by much lower than i(J) / i(C)
.
Since we allow the creator to specify starting_price
(effectively min_price
), I think there's no good reason as to why he shouldn't be able to provide both min_price
and max_price
.
The benefit from this is that if the creator can estimate the price range well, the liquidity he provides to the AMM may end up beeing used way more effectively (as the curve could be made much less steep).
Replying to @ignazio-bovo here
we allow (advanced) users to specify his preferred value of `a'
I don't think this really fits with our user base and context. We are dealing with users that are not sophisticated traders, this is why we have an AMM design to begin with, and they are just trying to buy/sell easily. If there is a diversity of a
values out there, it can be hard for people to understand how buying into different tokens may be very different. So we really shuold try to avoid a situation where AMMs are very different from each other.
However, this does beg the question, what if the $USD price of $JOY is drifting substantially over time, then then in those terms, the curve may be getting steeper or more shallow. I don't see an easy way to avoid this until we have a stablecoin integration, and anyway there seemed to be no reprots of this being a problem in DeSo or Rally.
Will it be possible for a issuer to also restart the AMM anytime after or the issuer can just start and turn off the AMM only once in the CRT lifetime?
Yeah I guess so. I am not sure we really need a direct restart feature, like as an extrinsic, directly.
Does this means that after any account purchases amount X from the bonding curve (=> supply is increased by X at one time) X is then vested to the account over a block period ?
It was intended to mean that we have the exact same arrangement, with cliff+linear vesting period, as if when someone buys X from a sale with a vesting condition, but that the vesting is aligned at point of purchase, not termination of sale.
Replying to @Lezek123
Do we want new CRT to be minted during AMM or do we want AMMs to be backed by existing CRT, just like sales?
So the former in our and those other designs.
I see the case for the other variety, but my hunch is that the benefit of the AMM model is that it provides long term liquidity without running out or tying up the creator assets in perpetuity, but I am speculating. Given that we already have the sale model, and the other deployed models people are happy with, I think its best to stick with it.
creator can do the initial sale and then "take back" the the channel reward cut by diluting tokens through series of AMMs, where he can cheaply buy (mint) his own tokens.
I see your point here, but
and we can also make this much harder if we block starting an AMM which has a starting price lower than any previous AMM on that channel with at least one sale
, unless an explicit governance decision is made to lower this number for this specific channel.
What do you think?
If the JOY from the AMM is burned, this means there is almost no incentive for the creator to sell tokens through AMM, other than to find out how much JOY are people willing to pay for his CRT before selling it through Token Sale.
I did not understand why you say this, perhaps you missed that the burning happens when you "shut off" the AMM, not during normal purchasing of $CRT, and its only the creator who can do this.
Does you question still hold?
Do we actually expect the AMMs to be treated only as means to measure the demand before starting Token Sale, not as an actual source of revenue for the creator?
They are not a source of revenue, because $JOY used to purchase $CRT is just held by AMM, its not sent to creator. Token sales are a source of revenue though.
I expect them to be used as the most convenient way for an audience to get exposure to interesting assets, either because a sale is too much work, or its in the past, or because the demand at any given time is too low and unpredictale to warrant the overhead, etc. The user research has really confirms that people do find it solves their problem on this front.
My initial understanding was that we want the creator to be able to earn JOY for the tokens sold through AMM
No they cannot.
There are actually two ways the creator could possibly earn from the AMM
Yes, but we have no included any of those.
we would have some limit of how many tokens can be bought on a given AMM.
That is not clear to me, why can't the AMM just sell more and more at increasing marginal prices?
Option 1 vs Option 2
I think for similar reasons to my answer to @ignazio-bovo, we have to go with standardization and enforcement here.
The other issue here is you are assuming there is a c
, which is not part of any of the AMM designs for such tokens, and I am not sure we should deviate.
I still have a couple of questions, after reading Leszek response.
If we allow AMM to be opened after a sale, the following situation might happens:
A
buys 10 CRT by paying 1 JOY (via Sale @ unit price = .1 JOY/CRT)A
gets his total CRT amount (10 CRTs), either immediately or he waits until the vesting period is overa = 1
and b = .1
B
bonds 10 CRT for 50 + 1 = 51
JOYs (I have used the pricing mechanism for linear curve)A
unbonds his 10 CRT and gets 51 JOYs
A
profits by 41 JOYs
B
loses by 51 JOYs
Creator profits by 10 JOYs
Is this acceptable
The CRT total supply gets modified by one of the following event accross CRT lifetime:
a. initial creator allocation
b. patronage credit minted
c. tokens burned by creator
d. tokens unbonded
e. tokens bonded
Now amm_supply = (d) - (e)
creator_share = (a) + (b)
, hence CRT total_supply = amm_supply + creator_share - (c)
There is the possibility of a creator having creator_share
liquid CRTs for which he can attempt a rug pull, independently on how many CRTs have been bonded/unbonded
Should we allow AMM to be opened after Sales?
Yes.
If we allow AMM to be opened after a sale, the following situation might happens:
I did not really understand the principle involved in this example, where a & b values are coming from, which we have not 100% settled yet. But certainly, if starting price for an AMM is not constrained, then you can start a new AMM with arbitrarily low price, which undercuts a prior sale. This is not in principle incorrect or bad, but it can be abused in some cases. But see my comment in reply to @Lezek123 above
we can also make this much harder if we block starting an AMM which has a starting price lower than any previous AMM on that channel with at least one sale, unless an explicit governance decision is made to lower this number for this > specific channel.
There is the possibility of a creator having creator_share liquid CRTs for which he can attempt a rug pull, independently on how many CRTs have been bonded/unbonded
I don't really understand the question here? Are you asking if the creator can sell into AMM with liquid $CRT? yes. Can this be abused, yes. Does this mean we should not do AMMs or somehow try to block the creator from selling liquid $CRT to AMM? I don't think so.
I also want to point at that (a) does not impact AMM, as its before, and (b) will be constrained to be small in relative terms. Also keep in mind anyone can burn tokens, not just creator.
a
& b
Revisiting this topic, so I think we must really stick with a platform enforced values here, and there has to be away to both set and constrain these which has some sort of semantic content that operators can reason about. That is what I am trying to suggest here.
The market maker is constructed so as to charge pruchasing for $JOY in accordance with some hypothetical fair market value of the creator asset based on its fundamental potential for revenue cashflows.
We start with the assumptions that
F
.R
in [0,1]
.Q
.y(q)=aq + b
.y(0)=b
.q
value for the curve is the net minted $CRT supply minted from this AMM from when it was launched. It starts at q = 0
, and can both increase and decline.Let C
denote the total cost, in $JOY, of purchasin Q
units starting from q=0
, which means that
C
= Integral[y, 0 , Q]
= Q*b + Q*a*Q/2
Now observe that if you do this purchase, you hold 50% of the total $CRT supply, meaning you have a claim on F*R/2
via revenue splits, hence based on our idea we say
C = F*R/2
From this equation we can find a formula for a
, namely
Q*b + Q*a*Q/2 = F*R/2
<->
Q*a*Q/2 = F*R/2 - Q*b
<->
a = 2*(F*R/2 - Q*b)/Qˆ2
Notice that this equation also yields a bound on b
in order to make a
> 0, namely
a > 0
<->
2*(F*R/2 - Q*b)/Qˆ2 > 0
<->
F*R/2 - Q*b > 0
<->
-Q*b > -F*R/2
<->
b < F*R/2Q
F
.Q
and R
during issuance, and Q
can evolve through normal dynamics.b
>= 0 when launching AMM, and chain ensures b < F*R/2Q
, and then sets curve to have a = 2*(F*R/2 - Q*b)/Qˆ2
.F
is set by governance, being same for all AMMs started at any given time, just because its simple. It does however imply that over time, F
can change.Q
units, but we can ignore this to keep the analysis simpler.Please verify the math is correct
The math is correct
The $JOY denominated fundamental value market cap of the coin is F.
Suppose creator wants to start AMM at block height t
then F
will have the following semantics
revenue up to block
t
for creator (from nft sales, royalties etc...) + (discounted) expected value of future earnings
If F
is as above then the methodology proposed is correct on paper. Here's the drawbacks that I think comes with this:
EDIT: In the above method basically $a = a(R, F)$, where:
$R$ is established by the creator. I am not sure if we want to vary or to be constant across splits
Is immutable after issuance, this has already been decided long ago, split code has already been merged as well.
$F$ is chosen by the governance, which might be wrong in computing the channel fundamental values at the outset. This is a risk for the creator.
Yes, I agree. We could allow the creator to set when creating AMM, and for example have a default vale used if one is not set, and this default is set by governance?
Consider the scenario Suppose we have fixed a curve $ax + b = f(x)$ for the AMM functionality. This will result in
$$ \frac{a}{2} x^2 + b x + c = F(x)$$
The above situation becomes even more complicated when considering interplay between several rounds of patronage minting, sales and revenue splits, and it is not possible to fix a AMM equation that works for the scenario.
Background
Great work with this overview @ignazio-bovo
https://hackmd.io/@msgSgRNqSKmkYgN4EoybcA/BysDdI8Iq
First thoughts
Linear
? It's also way easier for people to understand.Initial Liquidity bootstrapping capabilities
are very good, does this not mean that its simply really cheaply selling off the tokens to buyers, which is at the expense of the issuer?