-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
post_processing: add token_k_value and TVL to p_df #45
Comments
- added token_k_value - added TVL - should automatically pull list of tokens from pool to be simulated
|
|
post_processing(): rewrite and added new columns as requested in #45
I agree with @markusbkoch. An additional note, the invariant view also makes it relatively easy to see the impact of add/remove liquidity events as different from the the steady growth in the "invariant" side note, we use the term "invariant" as the price regulation in the bonding surface is derived from holding this function V invariant for swaps but in practice, the fees cause the value of V to increase for swaps. This is how the LPs make money over time. On the other hand the add and remove liquidity mechanisms explicitly increase and decrease V, while preserving price. Furthermore, the awesome balancer feature "asymmetric" liquidity add/remove is actually a composition of a swap and a liquidity add. |
@markusbkoch
Which one is correct, and why? |
The white paper defines it in terms of the normalized weights (such that the sum of all normalized weights is 1) - so 0.8 and 0.2 in that case. As for the why, it's not explicitly stated in the white paper, but from eq 10 in this proof we see that Wn must be a number between 0 and 1 (since 0<Vn<V by definition). |
Update post-processing:
|
What do you think about stating it as metric "Pool Size V"? @markusbkoch |
I agreed the term "invariant" causes confusion. I think this is a good opportunity to clarify it though. The practical reason why the function is called "invariant" is because the basic mechanism for swapping one token for another is derived from asserting In my paper on using state space models to derive economic properties, i called The functions When a liquidity provider adds liquidity they are explicitly "charging up" increasing I hope this helps improve your understanding of both where the term invariant came from (derivation of the swap mechanism), and why we still use it (the energy conservation analogy). |
@mzargham thank you for such a detailed description! |
Aha! This is a very good mental model (energy)! Given that, this irritation with the Invariant is most welcome. Initially, we were looking for a better metric to express "liquidity" or "market cap", since these metrics are not well defined (sometimes refering to $USD value, sometimes a more general term for "size"), The Invariant certainly is. |
Hi @markusbkoch and @AngelaKTE I added invariant calculation like this:
The results i get are...invariant. Am I missing something? |
|
@mzargham I wonder how weights changes fit in here, since it violates energy conservation? Depending on the current value distribution, a change of weights (without adapting balances) will either destroy energy (black hole?) - or more energy is available, like in nuclear fission. |
@AngelaKTE I think dynamic weights changing in the live pool does not violate energy conservation but re-distributes energy between pool components. Let's imagine AMM that has an external controller that changes weights trying to minimize arbitrage gap -> 0 (tracking prices on external markets "ideally" and de-facto changing weights according to these changes). So, basically invariant wouldn't be changed, but weights of components will. |
I've created a tiny series of weights and the impact on Invariant V, please take a look at how Invariant V changes. However, I get your point, I think it's just not redistributing energy within the pool, rather charging up/off according to external signals. I've added all our fresh insights to this article, feel free to comment @everyone: |
The text was updated successfully, but these errors were encountered: