Logo

Welcome
Login  Sign up
Home Solutions
New support ticket
Check ticket status
Solution home TON Swap How to use TON Swap?

Swapping tokens description Print

Modified on: Fri, 18 Jun, 2021 at 8:54 AM


amount = amount which user wants to swap 

expectedAmount = expected amount, received using runLocal on contract (https://github.com/broxus/ton-dex/blob/a2b6972f325ae3d5c9147ff1971962a58b94b846/contracts/DexPair.sol#L882-L890)

leftBalance = left currency supply 

rightBalance = right currency supply

minimumReceive = expectedAmount * (100 - slippage) / 100

start = leftBalance / rightBalance 

end = (leftBalance + amount) / (rightBalance - expectedAmount) 

priceImpact = end / start * 100


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles

    Home Solutions Cookie policy
    Help Desk Software by Freshdesk Support Desk
    Article views count