You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some composite tokens have dynamic ratios of the underlying tokens. Such as the exchange rate of cbETH or the ratio of stETH. The user can be updating the weights of the underlying tokens manually but that's a bother.
We can instead add an option for a customizable dynamic function to determine the weights.
Specification
Add an optional customizable dynamic function to determine the weights of underlying tokens for composite tokens. For now this will only work for evm chain. This should consist of:
A contract address, on the same chain as the token's chain ID.
A function to call (can also just be a public getter)
Any arguments to give to that function (optional)
Implement the changes required in the code to use the optional function if given to determine the weights each time the token's balance is queried. Think ... should cachign be used here?
Pre-populate these functions for some popular tokens:
Abstract
This has been suggested to us by a discord user.
Some composite tokens have dynamic ratios of the underlying tokens. Such as the exchange rate of cbETH or the ratio of stETH. The user can be updating the weights of the underlying tokens manually but that's a bother.
We can instead add an option for a customizable dynamic function to determine the weights.
Specification
The text was updated successfully, but these errors were encountered: