DEXToken
Search…
Anatomy of a Token-Swap

Overview

The sAMM utilised by DEXG Swap implements a more complex swap mechanism, which at the same time is highly efficient in decreasing slippage, reducing volatility and cost-effectiveness. A simple token swap on DEXG Swap will consist of several internal token movements and functions being called from the sAMM contract.

Anatomy of a standard token Swap

To understand the complexity of the sAMM token swap model an example swap of 100 GEL to 0.13 DEXG will be outlined.
Event Row
Initiate
Description
1
User
Swap 100 GEL for 0.13 DEXG on DEXG Swap
2
sAMM
Receive 100 GEL from user wallet
3
sAMM
Determine supply change & price volatility of GEL
4
sAMM
Swap 100 GEL for 0.00023 WETH from the GEL pool on DEXG Swap
5
sAMM
Determine new price tick for GEL
6
sAMM
Swap 0.00023 WETH to 0.13 DEXG
7
sAMM
Determine new price tick for DEXG
8
sAMM
Output new GEL/DEXG price
9
sAMM
Output new DEXG/GEL price
10
sAMM
Send 0.13 DEXG to user wallet
11
User
Receive 0.13 DEXG
As outlined all tokens that are swapped in will be submitted to their corresponding pool in exchange for WETH. The WETH will then be used to buy the target token from the target pool in exchange for WETH. In the process, fees are collected by the pool in WETH, with a share of the fees being forwarded to the corresponding Liquidity provider pool and LINK#Aggregator pool.
Last modified 9mo ago