schema

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FullRangeLowSqrtPrice  = "5.4210108624275221700372640043498E-20" //2**-64
	FullRangeHighSqrtPrice = "18446744073709551616"                  //2**64
)

https://github.com/Uniswap/v3-core/blob/main/contracts/libraries/TickMath.sol#L9

View Source
const (
	PriceDirectionUp   = "up"
	PriceDirectionDown = "down"
	PriceDirectionBoth = "both"
)
View Source
const (
	MinSqrtPriceFactor = "1.00005"
)

Variables

View Source
var (
	Fee01   = "0.01"
	Fee003  = "0.003"
	Fee001  = "0.001"
	Fee0005 = "0.0005"
)
View Source
var MinAmountInsForPriceQuery = map[string]string{

	"ethereum-eth-0x0000000000000000000000000000000000000000":                                                    "100000000000000",
	"ethereum-usdc-0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48":                                                   "100000",
	"arweave,ethereum-ar-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,0x4fadc7a98f2dc96510e42dd1a74141eeae0c1543": "10000000000",
	"ethereum-usdt-0xdac17f958d2ee523a2206206994597c13d831ec7":                                                   "100000",
	"arweave-ardrive--8A6RexFkpfWwuyVO98wzSFZh0d6VJuI-buTJvlwOJQ":                                                "100000000000000000",
	"everpay-acnh-0x72247989079da354c9f0a6886b965bcc86550f8a":                                                    "10000000",
	"ethereum-ans-0x937efa4a5ff9d65785691b70a1136aaf8ada7e62":                                                    "100000000000000000",
	"arweave-u-KTzTXT_ANmF84fWEKHzWURD1LWd9QaFR9yfYUwH2Lxw":                                                      "100000",
	"arweave-stamp-TlqASNDLA1Uh8yFiH-BzR_1FDag4s735F3PoUFEv2Mo":                                                  "100000000000",
	"everpay-acnh-0xac4cbc2009cf9ad96c2e1a4b34b1c8cb312fbce4":                                                    "10000000",
	"ethereum-map-0x9e976f211daea0d652912ab99b0dc21a7fd728e4":                                                    "1000000000000000000",
	"bsc-usdt-0x55d398326f99059ff775485246999027b3197955":                                                        "100000000000000000",

	"ethereum-usdc-0xb7a4f3e9097c08da09517b5ab877f7a917224ede":                                                   "100000",
	"ethereum-usdt-0xd85476c906b5301e8e9eb58d174a6f96b9dfc5ee":                                                   "100000",
	"arweave,ethereum-ar-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,0xcc9141efa8c20c7df0778748255b1487957811be": "10000000000",

	"bsc-tusdc-0xf17a50ecc5fe5f476de2da5481cdd0f0ffef7712":    "100000",
	"bsc-tar-0xf1458ee7e9a2096bce7a21c160840a3a291bcb55":      "10000000000",
	"bsc-tardrive-0xf4233b165f1b8da4f9aa94abc35c9ad2a7612979": "100000000000000000",
}

Functions

This section is empty.

Types

type Lp

type Lp struct {
	PoolID    string       `json:"poolID"`
	TokenXTag string       `json:"tokenX"`
	TokenYTag string       `json:"tokenY"`
	FeeRatio  *apd.Decimal `json:"feeRatio"`
	AccID     string       `json:"accID"`

	LowSqrtPrice     *apd.Decimal `json:"lowSqrtPrice"`
	CurrentSqrtPrice *apd.Decimal `json:"currentSqrtPrice"`
	HighSqrtPrice    *apd.Decimal `json:"highSqrtPrice"`

	Liquidity      *big.Int `json:"liquidity"`
	PriceDirection string   `json:"priceDirection"`
}

func (*Lp) ID

func (lp *Lp) ID() string

func (*Lp) String

func (lp *Lp) String() string

type Path

type Path struct {
	LpID     string `json:"lpId"`
	From     string `json:"from"`
	To       string `json:"to"`
	TokenTag string `json:"tokenTag"`
	Amount   string `json:"amount"`
}

type Pool

type Pool struct {
	TokenXTag string         `json:"tokenXTag" toml:"x"`
	TokenYTag string         `json:"tokenYTag" toml:"y"`
	FeeRatio  *apd.Decimal   `json:"feeRatio" toml:"fee_ratio"`
	Lps       map[string]*Lp `json:"-"`
}

func (*Pool) ID

func (pool *Pool) ID() string

func (*Pool) String

func (pool *Pool) String() string

type SwapInput

type SwapInput struct {
	LpID      string
	TokenIn   string
	AmountIn  *big.Int
	TokenOut  string
	AmountOut *big.Int
}

type SwapOutput

type SwapOutput struct {
	LpID           string
	TokenIn        string
	AmountIn       *big.Int
	TokenOut       string
	AmountOut      *big.Int
	Fee            *big.Int
	StartSqrtPrice *apd.Decimal
	EndSqrtPrice   *apd.Decimal
	IsDryRun       bool
}

Jump to

Keyboard shortcuts

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