RiskProtocol / core-protocol

1 stars 0 forks source link

Research: OlympusDAO rebase design #132

Open mz7mz7mz7 opened 11 months ago

mz7mz7mz7 commented 11 months ago

https://www.olympusdao.finance was once a very popular project with rebase tokens. Claiming to be well integrated with general web3 DeFi project. Let's review its code and design if we can learn anything from them to be better lego block in DeFi space.

haidarally commented 10 months ago

They use a concept of shares called gons.

Initially TotalGons(Total Shares) is set to a very big number(uint max)

They maintain a ratio called gonsPerfragment, which is simply ; TotalGons/ TotalSupply

Whenever they have a rebase occuring, the totalsupply is readjusted by adding the profits: totalsupply = totalsupply + rebaseAmount

User balance is determined like this: (Gons[user])/TotalGons x totalSupply Which is a representation of shares that the user has.

Therefore a user's balance is just his ratio of gons to the totalSupply

haidarally commented 10 months ago

We could use a similar concept, that is

however i am unable to think, why should we do that, with our rebase mechanism, the shares will also be magically rebased, similar to token balance, so the end result would be the same @mz7mz7mz7