Update health precision from UFix64 to UInt256 with 18 decimals#31
Update health precision from UFix64 to UInt256 with 18 decimals#31sisyphusSmiling merged 9 commits intomainfrom
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
| access(all) let defaultTokenIdentifier = "A.0000000000000007.MOET.Vault" | ||
| access(all) let defaultVariance = 0.00000001 | ||
| access(all) let defaultUFixVariance = 0.00000001 | ||
| access(all) let defaultUIntVariance: UInt256 = 1_000_000_000 |
There was a problem hiding this comment.
Default variance of 0.00000001 (as int) which is necessary in instances where withdrawal amounts at target health are truncated - e.g. 1,000 FLOW == 800 effective collateral / 1.3 target health == 615.384615384615384615 available which when converted to UFix64 withdrawal amount leave 0.000000004615384615 available in excess of target health.
|
@nialexsan added some test cases to cover Still, I'm not sure the expected & actual values are being computed correctly in Update: I think I fixed the issue in 3627bea. I believe the borrow factor had to be accounted for in the final calculation. |
Description