Maybe there's someone here that can help me.
i'm trying to create a redeemable index token that represents various other tokens held by another contract/wallet
What im trying to do is sweep the excess returns of investments held by my treasury into a redemption contract. Users with the index token would then be able to redeem for the underlying tokens by interacting with the redemption contract. So in my specfic project users would stake the main protocol token, LAVA, and rather than receiving additional LAVA as a reward they would receive nLAVA, a token representing an index of the treasuries excess returns across all investments. Users would be able to redeem lava for the actual underlying assets, based on the ratio of treasury investments and the the proportion of the users nlava relative to the entire pool.
so here's an example scenario i thought of so far. Let's say the treasury has a fixed initial dollar value that doesnt change - $1million. All assets in the treasury are invested equally in 3 protocols, let's call them x, y, and z, and and the apy for each is as follows:
1000 protocol x tokens: 5% apy
1000 protocol y tokens: 10% apy
1000 protocol z tokens: 20% apy
Since the initial amount invested is the same for all 3, the weight would be the same - ~33.%
Say there are a total of 1000 nlava in existence.
if a user has 1 nlava he should be able to redeem his nlava for
1/1000* 1000* .05 protocol x = .05 x tokens
1/1000* 1000* .10 protocol y = .1 y tokens
1/1000* 1000* .20 protocol z = .2 z tokens
So something like this, but in reality it get's a lot more complicated since investments are given different weights depending on their share of total investments. Also the treasury size(and by extension total investments) is constantly changing.
Does anyone know how to implement something like that?
Jan 13, 2022, 2:26 AM