Open mz7mz7mz7 opened 1 year ago
Balancer AMM could work for us in a pool of X:Y:Underlying where X and Y are the smart tokens
The Smart Pool
ampleforth is using is a bit deprecated i think,
We can use the managed pools for our use cases and we ll have a lot of freedom accordingly.
https://docs.balancer.fi/concepts/pools/managed.html#examples
Let's also explore 4-tokens pool: X:Y:Underlying:USDT/C
Here are some simulations @haidarally prepared: https://docs.google.com/spreadsheets/d/1AlclSm4ZTqxWmbF2-h4FltTUWIxZaCdJIC3WwYIakLo/edit#gid=810205788
@mz7mz7mz7 One Project of interest could be KassandraFinance
The built a factory to deploy custom(or managed pools with certain limitations for their own interest) They also got a grant from balancer for this https://github.com/KassandraFinance/kassandra-core-v2/blob/master/contracts/KassandraControlledManagedPoolFactory.sol
Gradual Weight Changes implies the following the pool stores a start/end time and stores start/end weights as well. if the current time is between the start and end times, the price is the linear interpolation between start and end weights. Otherwise if it's before start time it's start weights, and if it's after end time it's end weight
Gulp/reSync internal pool balance function seems to be missing in V2 code/docs, i am awaiting a response from balancer support https://balancer.gitbook.io/balancer/api/api#gulp
Tests/Simulations are paused, Sepolia/Goerli -> Issues with depositing token Arbitrum/Polygon -> pool creation is stopped on the official deployed factories
Note:
The only way you can do something like that is by having a token wrapper. For example, this is why Lido's stETH is wrapped into wstETH in the Vault. Additionally, it's why Aave Boosted Pools use Aave token wrappers
- The only way of using V2 with rebase tokens
@mz7mz7mz7 Thread on discord: https://discord.com/channels/638460494168064021/739109162536927385/1128760047393054821
Ampleforth, as a rebase protocol, uses Balancer as the AMM for its liquidity. Every time when they rebase their token (ie, every 24h in their case), they are calling, atomically, 4 post-rebase transactions as documented here: https://forum.ampleforth.org/t/technical-implementation-of-the-rebase-operation/578/2 Some more details: https://blog.ampleforth.org/ampl-usdc-smart-pool-on-balancer-be8eed9a264a https://docs.balancer.fi/concepts/pools/weighted.html
In our case, we would want to create a pool with always RiskOn and RiskOff tokens and optionally some 3rd token (ie, underlying)? This way, when the rebase happens, and RiskOff is created (or RiskOn is created) for a given liquidity pool wallet address, that liquidity pool is already aware of both Risk smart tokens. What would need to be done is the adjustment of weights of these tokens in the pool. Something that https://github.com/ampleforth/ampl-balancer/blob/master/contracts/AmplElasticCRP.sol seems to actually do, for AMPL tokens. Here is a similar implementation from Balancer directly: https://github.com/balancer/configurable-rights-pool/blob/master/contracts/templates/ESPFactory.sol
Task: Let's explore this whole setup a bit more and decide if Balancer AMM could work for our smart tokens.