onchain

package
v0.0.0-...-460501b Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnalosPairInfo = &PairInfo{
	MarketInfo: serum.MarketInfo{
		Market:      solana.MustPublicKeyFromBase58("3sJVHtBTjpHmTgArbtTz5cDr6umJZUTjx8yZfyoGAhZm"),
		Bids:        solana.MustPublicKeyFromBase58("6v5VTf216NTojE1fqTjGneDo9Gv4VRWpnFHZ6CwcLE6N"),
		Asks:        solana.MustPublicKeyFromBase58("FVUiBevqdWPYawWF71wy7guzM99NqcXkezSuNW9ZH1Xs"),
		EventQueue:  solana.MustPublicKeyFromBase58("EPwYeGjPb3vJbd3wPN4d5oPEVtwoufKeJ7kktXYMgsrV"),
		BaseVault:   solana.MustPublicKeyFromBase58("Dd5CeV5pfBAkQUimseZ9psrqpe9BwF6LhGA4nGhBbski"),
		QuoteVault:  solana.MustPublicKeyFromBase58("9gWd9qjVsdXemKLXZQ1zNHhPNo3WsYZcxYBTWDZLMs7X"),
		VaultSigner: solana.MustPublicKeyFromBase58("CyZn7qBwL9cMfxh1ghDsqSQwqardaEaq8sienzxqBg5x"),
	},
	AmmInfo: raydium.AmmInfo{
		AmmID:                solana.MustPublicKeyFromBase58("69grLw4PcSypZnn3xpsozCJFT8vs8WA5817VUVnzNGTh"),
		AmmAuthority:         solana.MustPublicKeyFromBase58("5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1"),
		AmmOpenOrders:        solana.MustPublicKeyFromBase58("2QoiVyXa8Bfgx35yTcJhQJVvZYouKZutj5r5CEDPgQUm"),
		AmmTargetOrders:      solana.MustPublicKeyFromBase58("4m5ecbRZzY7G7TaksDFmv2u8x52FLd9msemHC3xhtFWg"),
		PoolCoinTokenAccount: solana.MustPublicKeyFromBase58("9ibeYfpgDxyoSYNvsc37EwGua6Z1NQpp7LH6e7CvBabM"),
		PoolPcTokenAccount:   solana.MustPublicKeyFromBase58("5JFikPKzw3JeXKaJZaKTEAHfF3pJAoFJbHXUB5p2Ns5S"),
		TokenMintAddress:     solana.MustPublicKeyFromBase58("7iT1GRYYhEop2nV1dyCwK2MGyLmPHq47WhPGSwiqcUg5"),
		CurrencyAddress:      solana.SolMint,
	},
	Readiness: time.Now(),
}
View Source
var Max_Transaction_Version uint64 = 1
View Source
var Rewards bool = false

Functions

This section is empty.

Types

type Info

type Info interface {
	// Ready returns true if the info is ready to be used.
	Ready() bool
	TokenAddress() solana.PublicKey
}

type LogObserver

type LogObserver struct {
	// contains filtered or unexported fields
}

func NewLogObserver

func NewLogObserver(rpcPool *connection.RPCPool, connName string) *LogObserver

func (*LogObserver) ConnectionName

func (o *LogObserver) ConnectionName() string

func (*LogObserver) Start

func (o *LogObserver) Start(ctx context.Context, txCandidatePublishC chan<- TxCandidate) error

func (*LogObserver) Stop

func (o *LogObserver) Stop(ctx context.Context) error

type LogSet

type LogSet struct {
	// contains filtered or unexported fields
}

type PairCollector

type PairCollector struct {
	// contains filtered or unexported fields
}

func NewPairCollector

func NewPairCollector() *PairCollector

func (*PairCollector) Channel

func (c *PairCollector) Channel() chan<- Info

func (*PairCollector) Start

func (c *PairCollector) Start(pairPublishC []chan<- *PairInfo)

func (*PairCollector) Stop

func (c *PairCollector) Stop(ctx context.Context) error

type PairInfo

type PairInfo struct {
	// MarketInfo is the info about the market.
	MarketInfo serum.MarketInfo

	// TokenInfo is the metadata of token related to serum market info.
	TokenInfo TokenInfo

	// raydium.AmmInfo is the info about the AMM.
	AmmInfo           raydium.AmmInfo
	CalculatedAmmInfo raydium.AmmInfo

	// PairInfo metadata.
	Readiness time.Time // Timestamp of when the first swap is ready to be executed.
	// contains filtered or unexported fields
}

func (*PairInfo) GetCurrentAmmLiveInfo

func (p *PairInfo) GetCurrentAmmLiveInfo() raydium.AmmLiveInfo

func (*PairInfo) Ready

func (p *PairInfo) Ready() bool

func (*PairInfo) SetCurrentAmmLiveInfo

func (p *PairInfo) SetCurrentAmmLiveInfo(ammLiveInfo raydium.AmmLiveInfo)

func (*PairInfo) TokenAddress

func (p *PairInfo) TokenAddress() solana.PublicKey

type TokenInfo

type TokenInfo struct {
	TimeToSerumMarket    time.Duration
	TxCountToSerumMarket uint64
	TotalSupply          uint64
	Decimals             uint8
	TxID                 solana.Signature
	TxTime               time.Time
	Address              solana.PublicKey
}

func (*TokenInfo) Ready

func (t *TokenInfo) Ready() bool

func (*TokenInfo) TokenAddress

func (t *TokenInfo) TokenAddress() solana.PublicKey

type TxAnalyzer

type TxAnalyzer struct {
	// contains filtered or unexported fields
}

func NewTxAnalyzer

func NewTxAnalyzer(rpcPool *connection.RPCPool) *TxAnalyzer

func (*TxAnalyzer) Channel

func (a *TxAnalyzer) Channel() chan<- TxCandidate

func (*TxAnalyzer) Start

func (a *TxAnalyzer) Start(infoPublishC chan<- Info)

func (*TxAnalyzer) Stop

func (a *TxAnalyzer) Stop(ctx context.Context) error

func (*TxAnalyzer) TokenInfoFromMarket

func (a *TxAnalyzer) TokenInfoFromMarket(market serum.MarketInfo) (TokenInfo, error)

type TxCandidate

type TxCandidate struct {
	Signature solana.Signature

	Metadata *json.RawMessage
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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