xWin Swap V3

xWinSwapV3

SwapMethod

enum SwapMethod {
  UNISWAPV2,
  UNISWAPV3,
  UNISWAPV3Multihop
}

SwapInfo

struct SwapInfo {
  address router;
  address[] path;
  bytes multihopPath;
  uint24 slippage;
  uint24 poolFee;
  enum xWinSwapV3.SwapMethod swapMethod;
}

Received

event Received(address, uint256)

receive

onlyExecutor

swapData

Mapping containing swapInfo, for swap pair fromToken, toToken

executors

priceMaster

initialize

swapTokenToToken

Swap tokens using xWin Swap

Parameters

Name
Type
Description

_amount

uint256

Amount of tokens to swap

_fromToken

address

Token to swap

_toToken

address

Token to receive

swapTokenToToken

Swap tokens using xWin Swap with slippage

Parameters

Name
Type
Description

_amount

uint256

Amount of tokens to swap

_fromToken

address

Token to swap

_toToken

address

Token to receive

_slippage

uint32

Slippage for the swap

internalSwap

Main logic for swapping tokens

_swapV2

makes swaps using a uniswapV2 style router

_swapV3

makes direct swap using a uniswapV3 style router

_swapV3Multihop

makes a multihop swap using a uniswapV3 style router

getSwapData

View function to get swapInfo for a swap pair

Parameters

Name
Type
Description

_fromtoken

address

Token to swap

_totoken

address

Token to receive

Return Values

Name
Type
Description

_swapInfo

struct xWinSwapV3.SwapInfo

SwapInfo for the swap pair

addTokenPath

_xWinStratSwap

This function handles xWinStrategy Token swaps

check if input tokens are xWinStrategies, if yes handle the swap and return true else return false

adminMoveToken

setPriceMaster

setExecutor

depositToStrategy

withdrawFromStrategy

Last updated