Submit erc20 order
How to use tradeCost
tradeCost1. Query api/v3/exchange/tokens to get the dust value of orderAmounts for both LRC and ETH
2. Query api/v3/user/orderUserRateAmount to get the tradeCost value.
3. Set maxAllowBips = 50% as the maxFeeBips can't exceed 50%
4. Set slippage as the slippage value user configured in UI (for example 0.1%)
5. Caculate minCostLRC and minCostETH as below
6. Caculate the cost by considering slippage
7. Cacluate the minimum quantity user has to set
8. Caculate the previous minimum token amount per calling api/v3/user/orderUserRateAmount (existing logic)
9.Caculate the new maxFeeBips and start trading
Last updated