Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dex ¶
type Dex struct {
// contains filtered or unexported fields
}
Dex represents an UniswapV2 DEX (pair)
func NewDex ¶
NewDex creates a new UniswapV2 DEX that holds all the needed information
fee represents the uni2-fork fee in a representation like 30 = 0,3%
func (*Dex) GetAmountIn ¶
GetAmountIn calculates the amount you need to give to receive the amount you want to get zeroForOne is used to check if you want to get token0 for token1 or the other one
func (*Dex) GetAmountOut ¶
GetAmountOut calculates the amount you will receive for the amount you give in zeroForOne is used to check if you want to give in token0 or token1 to receive the other one
func (*Dex) GetReserves ¶
GetReserves get the current Dex reserves
func (*Dex) SetReserves ¶
SetReserves sets the Dex reserves
Click to show internal directories.
Click to hide internal directories.