orca

package
v0.0.0-...-07d62d3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// CurveDataStartByte is the offset at which the curve data is stored
	CurveDataStartByte = 227

	// SplMintDecimalsStartByte is the offset at which the decimals of an
	// spl-mint is encoded
	SplMintDecimalsStartByte = 44

	// SwapVariant is the enum variant of swap instruction
	SwapVariant = 1
)

Variables

This section is empty.

Functions

func GetOrcaFees

func GetOrcaFees(solanaClient *rpc.Provider, transaction types.TransactionResult, orcaProgramId string, fluidTokens map[string]string) (feesPaid *big.Rat, err error)

GetOrcaFees by checking that an orca swap occurred, then destructuring the swap information to get the fee %, and getting the fees paid by multiplying the value of the swap

Types

type ConstantProductCurveFeeData

type ConstantProductCurveFeeData struct {
	TradeFeeNumerator        int64
	TradeFeeDenominator      int64
	OwnerTradeFeeNumerator   int64
	OwnerTradeFeeDenominator int64
}

ConstantProductCurveFeeData is an Orca struct that encodes the % fee taken on a pool

Jump to

Keyboard shortcuts

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