Closed abitmore closed 2 years ago
I have dealt with this issue, if you have time you can review and merge. @sschiessl-bcp @abitmore
Please check again
I think it's not fixed.
I replaced the division with multiplication, the precision should no longer affect @abitmore
@xiangxn please check the calculation and if accurate now we can close
Offer 1.21.67, this is fine:
but too much collateral here:
BTW for the offer 1.21.69, the percentage is strange:
Sorry, I forgot to clean up the original ceil
function
I've fixed this and tested it. you can merge.
@sschiessl-bcp @abitmore
I think ceil
is still needed somewhere.
For example, for offer 1.21.3
, if to borrow 1 BTS
, the collateral 0.2381 CNY
is sufficient,
But if to borrow 0.1 BTS
, the collateral 0.0238 CNY
is insufficient:
By the way, the amount of fee (0.86869 BTS
) is wrong. It should be 1 BTS
.
I have reprocessed. @abitmore
The Fee issue, I checked it, this is because the partial op number returned by the api did not cause the front-end read to fail, which requires opening a new issue
#3505.
For example: /* 40 */ blind_transfer_operation
This is not in the parameter list.
Because of this problem, UI's fee calculation after OP number 40 is all wrong.
Checked the cases above, looks good.
I guess the one below is not an issue, still there is a rounding error with big numbers. Funny enough, adding another 0 rounds properly again
Describe the bug
Certain credit offers cannot be accepted due to the use of inaccurate floating point numbers to calculate collateral amounts.
To Reproduce Steps to reproduce the behavior:
1.21.79
offer100
(XBTSX.HIVE
), see the collateral amount is5,999.99881 BTS
, which is insufficient because the required collateral ratio is1 HIVE / 60 BTS
Expected behavior No error
Screenshots
Desktop (please complete the following information):
Additional context