Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/js_sdk/erc20Trade/orderERC20.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ The parameters to call this interface are "accountId" and "market=LRC-ETH". In t

**4) Set slippage as the slippage value user configured in UI (for example 0.1%)**

**5)Caculate minCostLRC and minCostETH as below**
**5)Calculate minCostLRC and minCostETH as below**

minCostLRC = max(minTokenLRC, tradeCostLRC/maxAllowBips)
minCostETH = max(minTokenETH, tradeCostETH/maxAllowBips)

**6) Caculate the cost by considering slippage**
**6) Calculate the cost by considering slippage**

minCostLRCSlip = minCostLRC/(1-slippage)
minCostETHSlip = minCostETH/(1-slippage)


**7) Cacluate the minimum quantity user has to set**
**7) Calculate the minimum quantity user has to set**

tradeCostSellLRC = max(tradeCostSellLRC, minTokenLRC) * 1.1
tradeCostSellETH = max(tradeCostSellETH, minTokenETH) * 1.1
Here we add additonally 10% tolerance.

**8) Caculate the previous minimum token amount per calling api/v3/user/orderUserRateAmount (existing logic)**
**8) Calculate the previous minimum token amount per calling api/v3/user/orderUserRateAmount (existing logic)**

This is the threshold to distinguish small quantity trading and normal trading
We will get two values (configSellLRC and configSellETH) which are used for previous trading quantity limit (Per USD 100) caculation
Expand Down