Skip to content
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

Add customizable option for dynamically determining underlying tokens weights #5331

Open
3 tasks
LefterisJP opened this issue Jan 2, 2023 · 0 comments
Open
3 tasks

Comments

@LefterisJP
Copy link
Member

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

  • 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:
@LefterisJP LefterisJP added this to the 1.28.0 milestone Jan 2, 2023
@LefterisJP LefterisJP modified the milestones: 1.28.0, v1.30.0 May 16, 2023
@LefterisJP LefterisJP modified the milestones: 1.30.0, 1.33.0 Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant