raydium

package
v0.0.0-...-5679b34 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Raydium_Liquidity_Program_V4 solana.PublicKey = solana.MustPublicKeyFromBase58("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8") // This program calls Raydium Purchase IDO to create a new pair.
	Raydium_Authority_Program_V4 solana.PublicKey = solana.MustPublicKeyFromBase58("5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1") // This is also a wallet that holds tokens and do swaps.
)

Functions

This section is empty.

Types

type AmmInfo

type AmmInfo struct {
	// Purchase IDO Instruction Data
	ProgramID            solana.PublicKey // Raydium Liquidity Pool V4 Program ID
	AmmID                solana.PublicKey // Amm ID (Pair Address)
	AmmAuthority         solana.PublicKey // Amm Authority (Raydium Authority)
	AmmOpenOrders        solana.PublicKey // Amm Open Orders (PoolQuoteTokenAccount)
	LPTokenAddress       solana.PublicKey // LPToken Address (PoolTokenMint)
	TokenMintAddress     solana.PublicKey // Token Address (TokenMint)
	CurrencyAddress      solana.PublicKey // Currency Address (always WSOLMint)
	PoolCoinTokenAccount solana.PublicKey // Amm Token Account (PoolCoinTokenAccount)
	PoolPcTokenAccount   solana.PublicKey // Amm WSOL Token Account (PoolPcTokenAccount)
	AmmTargetOrders      solana.PublicKey // Amm Target Orders
	AmmLiquidityCreator  solana.PublicKey // Amm Liquidity Creator (ata account of LP creator that will receive LP tokens)
	Calculated           bool

	// Purchase IDO Instruction Metadata
	Caller    solana.PublicKey // Caller wallet address
	TxID      solana.Signature // Transaction ID
	Slot      uint64           // Chain Slot
	TxTime    time.Time        // Timestamp of transaction in blockchain
	Timestamp time.Time        // Timestamp of transaction discovery

	// Purchase IDO Instruction Log
	InitialLiveInfo AmmLiveInfo

	// Raydium Pool Live Info
	CurrentLiveInfo AmmLiveInfo // Current live info (taken from RPC)
}

programID -> Raydium AMM (Liquidity) account1 -> TokenProgram account2 -> AssociatedTokenProgram account3 -> SystemProgram account4 -> Sysvar: Rent account5 -> IdoID -> AmmId account6 -> Raydium Authority account7 -> PoolQuoteTokenAccount -> AmmOpenOrders account8 -> UserQuoteTokenAccount (LP token address) account9 -> ..BaseMint -> UserIdoInfo -> (unused TokenAddress) account10 -> ..QuoteMint -> UserOwner -> (unused CurrencyAddress, zawszse WSOL) account11 -> UserStakeInfo -> PoolCoinTokenAccount account12 -> UserIdoCheck -> PoolPcTokenAccount account13 -> ?? -> AmmTargetOrders account14 -> ?? unused ?? account15 -> ?? unused ?? account16 -> OpenBook program account17 -> ..Market -> .. -> SerumMarket account18 -> Singer(Wallet) account19 -> ?? unused ?? account20 -> ?? AmmSolDstAccount ?? account21 -> LP Token Destination Account

func AmmInfoFromTransaction

func AmmInfoFromTransaction(rpcTx *rpc.GetTransactionResult, tx *solana.Transaction, txParsedLog *json.RawMessage) (AmmInfo, error)

func DeriveAmmInfoFromMarket

func DeriveAmmInfoFromMarket(minfo serum.MarketInfo) (*AmmInfo, error)

func NewAmmInfo

func NewAmmInfo() *AmmInfo

func (*AmmInfo) CoinVault

func (a *AmmInfo) CoinVault() solana.PublicKey

func (*AmmInfo) PcVault

func (a *AmmInfo) PcVault() solana.PublicKey

func (*AmmInfo) Ready

func (a *AmmInfo) Ready() bool

func (*AmmInfo) String

func (a *AmmInfo) String() string

func (*AmmInfo) TokenAddress

func (a *AmmInfo) TokenAddress() solana.PublicKey

func (*AmmInfo) UpdateSwap

func (a *AmmInfo) UpdateSwap(ammSwapped bool)

Update amm info if market pair was created in reverse order to match the order of the market.

type AmmLiveInfo

type AmmLiveInfo struct {
	UpdateTime     time.Time // Amm trading open time (taken from instruction log); for initial it will be OpenTime of the market.
	PooledLamports float64   // Current pooled WSOL
	PooledToken    float64   // Current pooled MintToken
	Price          float64   // Current price (Pr := MintToken/WSOL)
	LPTokenBurned  bool      // Whether LP tokens were burned (false = LP tokens were not burned or unknown)
	MintDisabled   bool      // Whether minting is disabled (false = minting is enabled or unknown)
}

func (*AmmLiveInfo) Ready

func (a *AmmLiveInfo) Ready() bool

Jump to

Keyboard shortcuts

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