Closed dapp-whisperer closed 9 months ago
Posting this as a reminder.
https://gist.github.com/CodingNameKiki/a3b887756e686de8361952536a931c8b
The difference between using the snapshots and the live stake is:
Logs:
---------------------------- First Cdp
Snapshot Stake : 1999999999999999988
Live Stake : 2000000000000000009
---------------------------- Second Cdp
Snapshot Stake : 3999999999999999977
Live Stake : 4000000000000000017
---------------------------- Third Cdp
Snapshot Stake : 7999999999999999955
Live Stake : 8000000000000000034
- Test begins with some initial CDPs and a series of split fee claim and liquidation events
- Now create a target CDP1
- Then create another CDP2 with collateral equal to current system total collaterals
- Lastly create another target CDP3 with same collateral as CDP1
- Check the stakes of CDP1 & CDP3 using snapshot vs spot values
https://gist.github.com/CodingNameKiki/289ab331e71dc6d0520129f95a6547cf
Difference between the Cdp stake by using both the snapshot and the live stake ratio in the above example:
Logs:
---------------------------- First Cdp
Snapshot Stake : 1999802759179916502
Live Stake : 2000000000000000000
---------------------------- Third Cdp
Snapshot Stake : 1999802759179916502
Live Stake : 2000000000000000000
l think we have similar results here as the previous design of the system, the spec difference is that we no longer use totalStakesSnapshot and totalCollateralSnapshot to calculate the stake instead we use the latest totalStakes and totalCollateralShares. The outcome should be the same and still have staled debt redistribution duo to not synced Cdps.
l am curious about the results when removing both the stakes and snapshot functionality? Won't we be more accurate if we calculate everything needed based on the system coll shares: