Skip to content

[V109-specific] GetFee DollarInRune-usage correction

Multipartite requested to merge Multi/GetFee-DollarInRune-usage-correction into develop

[V109-specific]

Intended to close #1500 (closed)
'GetFee uses the DollarInRune value (which gives runeUSDPrice) as though it were its inverse'.


Further thoughts:
I feel strongly inclined to rename DollarInRune to a more intuitive function name like RuneInDollars or DollarsPerRune
, but if so I request input on what new function name is preferred.
|
[Edit: In particular, replacing calls to DollarInRune could be troublesome enough to be worth a #check-lint-warning refactor,
likely in its own separate Merge Request.
That would still have a new version of the function to check a different Mimir key from older versions.]
|
[Second edit: !2832 (merged) 'DollarInRune -> DollarsPerRune' now submitted.]


Update:
I have also considered whether it would be preferable to alter the telemetry function and replace/version anchorMedian;
however, note for instance
https://gitlab.com/thorchain/thornode/-/blob/v1.107.0/x/thorchain/handler_loan_open.go#L215-221
price := DollarInRune(ctx, h.mgr).QuoUint64(constants.DollarMulti)
collateralValueInTOR := collateralValueInRune.Mul(price).QuoUint64(1e8)
Here too, DollarInRune is accepted as returning USD-per-1-RUNE, to be multiplied by a RUNE value to get a USD value.

Edited by Multipartite

Merge request reports