When the user does a cross-chain operation, there is a chance the user suffers some slippage. More info about it, can be found here and here. We have to provide the user with a way to control the slippage settings when they are about to make a cross-chain call.
Slippage is expressed in BPS (basis points): one basis point is equivalent to 0.01%. If the user inputs 0.50%, you should send to the dedicated sdk methods the value 50. The default slippage is 0.30% or 30 BPS.
TODOs
[x] Create a new shared component and integrate it both on the borrow page and the manage position page
[x] The modal pops up when the user clicks on the clog icon and closes when they click on close btn or outside
[x] There are 3 choices between which the user can select (1%, 0.5% and 0.3%). Each of these choices is a btn.
[x] Selected by default is 0.3%
[x] The 4th element is an input, when the user clicks on the btns the input gets pre-filled.
[x] The user can set their own % in the input (max 100).
[x] Create a new prop in the borrow store that accounts for the slippage and update it accordingly after user's interaction.
[x] On calling one of the SDK previews methods in fetchRoutes() in "packages/frontend/helpers/borrow.ts" pass the slippage as the last input (check here)
Context
This ticket is the last part of #242
When the user does a cross-chain operation, there is a chance the user suffers some slippage. More info about it, can be found here and here. We have to provide the user with a way to control the slippage settings when they are about to make a cross-chain call.
Designs for this ticket are here.
Slippage is expressed in BPS (basis points): one basis point is equivalent to 0.01%. If the user inputs 0.50%, you should send to the dedicated sdk methods the value 50. The default slippage is 0.30% or 30 BPS.
TODOs
fetchRoutes()
in "packages/frontend/helpers/borrow.ts" pass the slippage as the last input (check here)