License: MIT
This is the price feed contract which is used to fetch the spot prices from the UniswapV2 protocol. There also is a pathfinder built into the contract to find the optimal* path between the pairs
The enum that holds information about the router type
Parameters:
Name | Description |
---|---|
A struct describing single swapping pool parameters
Parameters:
A struct describing a swap path
Parameters:
This function sets path tokens that will be used in the pathfinder
Parameters:
This function removes path tokens from the pathfinder
Parameters:
This function sets pool types that will be used in the pathfinder
Parameters:
Shares the same functionality as "getExtendedPriceOut" function with an empty optionalPath. It accepts and returns amounts with 18 decimals regardless of the inToken and outToken decimals
Parameters:
Return values:
Shares the same functionality as "getExtendedPriceIn" function with with an empty optionalPath. It accepts and returns amounts with 18 decimals regardless of the inToken and outToken decimals
Parameters:
Return values:
The same as "getPriceOut" with "outToken" being native USD token
Parameters:
Return values:
The same as "getPriceIn" with "outToken" being USD token
Parameters:
Return values:
The same as "getPriceOut" with "outToken" being DEXE token
Parameters:
Return values:
The same as "getPriceIn" with "outToken" being DEXE token
Parameters:
Return values:
The function that returns the total number of path tokens (tokens used in the pathfinder)
Return values:
The function to get the list of path tokens
Return values:
The function that returns the total number of pool types used in the pathfinder
Return values:
The function to return the list of pool types used in the pathfinder
Return values:
This function checks if the provided token is used by the pathfinder
Parameters:
Return values:
This function tries to find the optimal exchange rate (the price) between "inToken" and "outToken" using custom pathfinder and optional specified path. The optimality is reached when the amount of outTokens is maximal
Parameters:
Return values:
This function tries to find the optimal exchange rate (the price) between "inToken" and "outToken" using custom pathfinder and optional specified path. The optimality is reached when the amount of inTokens is minimal
Parameters:
Return values:
Shares the same functionality as "getExtendedPriceOut" function. It accepts and returns amounts with 18 decimals regardless of the inToken and outToken decimals
Parameters:
Return values:
Shares the same functionality as "getExtendedPriceIn" function. It accepts and returns amounts with 18 decimals regardless of the inToken and outToken decimals
Parameters:
Return values:
Shares the same functionality as "getExtendedPriceOut" function with an empty optionalPath. It accepts and returns amounts with 18 decimals regardless of the inToken and outToken decimals
Parameters:
Return values:
Shares the same functionality as "getExtendedPriceIn" function with an empty optionalPath. It accepts and returns amounts with 18 decimals regardless of the inToken and outToken decimals
Parameters:
Return values:
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
UniswapV2Interface
the Uniswap V2 router V2 type
UniswapV3Interface
the Uniswap V3 quouter V2 type
poolType
enum IPriceFeed.PoolInterfaceType
the interface type of the router
router
address
the address of the router or quoter
fee
uint24
the pool fee (in case of V3 pools)
path
address[]
the tokens swapped alongside the path
poolTypes
uint8[]
the v2/v3 pool types alongside the path
pathTokens
address[]
the array of tokens to be added into the path finder
pathTokens
address[]
the array of tokens to be removed from the pathfinder
poolTypes
struct IPriceFeed.PoolType[]
the array of pool types
inToken
address
the token to exchange from
outToken
address
the token to exchange to
amountIn
uint256
the amount of inToken to be exchanged (with 18 decimals)
amountOut
uint256
the received amount of outToken after the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens and pools path that will be used during the swap
inToken
address
the token to exchange from
outToken
address
the token to exchange to
amountOut
uint256
the amount of outToken to be received (with 18 decimals)
amountIn
uint256
required amount of inToken to execute the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to be exchanged from
amountIn
uint256
the amount of inToken to exchange (with 18 decimals)
amountOut
uint256
the received amount of native USD tokens after the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to get the price of
amountOut
uint256
the amount of USD to be received (with 18 decimals)
amountIn
uint256
the required amount of inToken to execute the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to be exchanged from
amountIn
uint256
the amount of inToken to exchange (with 18 decimals)
amountOut
uint256
the received amount of DEXE tokens after the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to get the price of
amountOut
uint256
the amount of DEXE to be received (with 18 decimals)
amountIn
uint256
the required amount of inToken to execute the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
[0]
uint256
the number of path tokens
[0]
address[]
the list of path tokens
[0]
uint256
the number of pool types
[0]
struct IPriceFeed.PoolType[]
the list of pool types
token
address
the token to be checked
[0]
bool
true if the token is used by the pathfinder, false otherwise
inToken
address
the token to exchange from
outToken
address
the received token
amountIn
uint256
the amount of inToken to be exchanged (in inToken decimals)
optionalPath
struct IPriceFeed.SwapPath
the optional path between inToken and outToken that will be used in the pathfinder
amountOut
uint256
amount of outToken after the swap (in outToken decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to exchange from
outToken
address
the received token
amountOut
uint256
the amount of outToken to be received (in inToken decimals)
optionalPath
struct IPriceFeed.SwapPath
the optional path between inToken and outToken that will be used in the pathfinder
amountIn
uint256
amount of inToken to execute a swap (in outToken decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to exchange from
outToken
address
the token to exchange to
amountIn
uint256
the amount of inToken to be exchanged (with 18 decimals)
optionalPath
struct IPriceFeed.SwapPath
the optional path between inToken and outToken that will be used in the pathfinder
amountOut
uint256
the received amount of outToken after the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to exchange from
outToken
address
the token to exchange to
amountOut
uint256
the amount of outToken to be received (with 18 decimals)
optionalPath
struct IPriceFeed.SwapPath
the optional path between inToken and outToken that will be used in the pathfinder
amountIn
uint256
the required amount of inToken to execute the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to exchange from
outToken
address
the token to exchange to
amountIn
uint256
the amount of inToken to be exchanged (with 18 decimals)
amountOut
uint256
the received amount of outToken after the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap
inToken
address
the token to exchange from
outToken
address
the token to exchange to
amountOut
uint256
the amount of outToken to be received (with 18 decimals)
amountIn
uint256
required amount of inToken to execute the swap (with 18 decimals)
path
struct IPriceFeed.SwapPath
the tokens path that will be used during the swap