oneinch

package
v0.0.0-...-2ac5be2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FeeDecimals = 18

FeeDecimals is the hardcoded denominator used by 1inchLP to derive fees

Variables

This section is empty.

Functions

func GetFixedRateSwapFees

func GetFixedRateSwapFees(transfer worker.EthereumApplicationTransfer, client *ethclient.Client, fluidTokenContract ethCommon.Address, tokenDecimals int) (applications.ApplicationFeeData, error)

GetFixedRateSwapFees calculates fees from Swapping TokenA and TokenB performed by FixedRateSwap Because TokenA and TokenB are required to have the same decimals, the fee is the value that balances x TokenA + y TokenB + fee = const

func GetMooniswapV1Fees

func GetMooniswapV1Fees(transfer worker.EthereumApplicationTransfer, client *ethclient.Client, fluidTokenContract ethCommon.Address, tokenDecimals int) (applications.ApplicationFeeData, error)

GetMooniswapFees returns Mooniswap's fee of 0.3% of the amount swapped. If the token swapped from was the fluid token, get the exact amount, otherwise approximate the cost based on the received amount of the fluid token

func GetOneInchLPFees

func GetOneInchLPFees(transfer worker.EthereumApplicationTransfer, client *ethclient.Client, fluidTokenContract ethCommon.Address, tokenDecimals int) (applications.ApplicationFeeData, error)

GetOneInchLPFees implements 1InchLPv1.0/1.1 fee structure. Fees are split into static fees and slippage fees, controlled by 1Inch governance

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL