FIX: Staking - Suggested symmetrical staking ratio incorrect
Problem:
The suggested (autofilled) symmetrical staking ratio does not honor the ratio of asset/rune
in the pool, causing the pool to slip.
Intended Functionality:
The recommendation provided to the user should be precisely the same as the current ratio of assetDepth
to runeDepth
. This can be derived by simply fetching the price
from the /pool/detail
midgard endpoint.
Example:
The current pool ratio is 1 BNB : 162.5 RUNE
(runeDepth/assetDepth=162.533
). This is evident by the price
ie. 1 BNB = 162.5 RUNE
. Staking 162.5 RUNE
should suggest 1 BNB
, Staking 100 RUNE
should suggest 0.615 BNB
. (See example below)
[
{
"asset": "BNB.BNB",
"assetDepth": "99837500",
"price": "162.533087717541",
"runeDepth": "16226897145",
}
]
UX:
The interface should trigger a recalculation of the recommended staking ratio whenever the asset
or rune
amount is changed, however this will frustrate users who wish to set the ratio manually. Accordingly the ratio should be locked with an option to allow the user to adjust the ratio manually. Example under the asset icon.