swapstrategy

package
v15.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPriceLimit

func GetPriceLimit(zeroForOne bool) sdk.Dec

GetPriceLimit returns the price limit based on which token is being swapped in. If zero in for one out, the price is decreasing. Therefore, min spot price is the limit. If one in for zero out, the price is increasing. Therefore, max spot price is the limit.

func New

func New(zeroForOne bool, sqrtPriceLimit sdk.Dec, storeKey sdk.StoreKey, spreadFactor sdk.Dec, tickSpacing uint64) swapStrategy

New returns a swap strategy based on the provided zeroForOne parameter with sqrtPriceLimit for the maximum square root price until which to perform the swap and the stor key of the module that stores swap data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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