protocol

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package protocol provides implementations for different DeFi protocols

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmmConfig

type AmmConfig struct {
	Bump            uint8
	Index           uint16
	Owner           solana.PublicKey
	ProtocolFeeRate uint32
	TradeFeeRate    uint32
	TickSpacing     uint16
	FundFeeRate     uint32
	PaddingU32      uint32
	FundOwner       solana.PublicKey
	Padding         [3]uint64
}

func (*AmmConfig) Decode

func (l *AmmConfig) Decode(data []byte) error

type MeteoraDlmmProtocol

type MeteoraDlmmProtocol struct {
	SolClient *sol.Client
}

MeteoraDlmmProtocol handles interactions with Meteora DLMM (Dynamic Liquidity Market Maker) pools

func NewMeteoraDlmm

func NewMeteoraDlmm(solClient *sol.Client) *MeteoraDlmmProtocol

NewMeteoraDlmm creates a new MeteoraDlmmProtocol instance

func (*MeteoraDlmmProtocol) FetchPoolByID

func (protocol *MeteoraDlmmProtocol) FetchPoolByID(ctx context.Context, poolID string) (pkg.Pool, error)

FetchPoolByID retrieves a specific Meteora DLMM pool by its ID

func (*MeteoraDlmmProtocol) FetchPoolsByPair

func (protocol *MeteoraDlmmProtocol) FetchPoolsByPair(ctx context.Context, baseMint string, quoteMint string) ([]pkg.Pool, error)

FetchPoolsByPair retrieves all Meteora DLMM pools for a given token pair

func (*MeteoraDlmmProtocol) ProtocolName

func (protocol *MeteoraDlmmProtocol) ProtocolName() pkg.ProtocolName

type PumpAmmProtocol

type PumpAmmProtocol struct {
	SolClient *sol.Client
}

func NewPumpAmm

func NewPumpAmm(solClient *sol.Client) *PumpAmmProtocol

func (*PumpAmmProtocol) FetchPoolByID

func (p *PumpAmmProtocol) FetchPoolByID(ctx context.Context, poolId string) (pkg.Pool, error)

func (*PumpAmmProtocol) FetchPoolsByPair

func (p *PumpAmmProtocol) FetchPoolsByPair(ctx context.Context, baseMint string, quoteMint string) ([]pkg.Pool, error)

func (*PumpAmmProtocol) ProtocolName

func (p *PumpAmmProtocol) ProtocolName() pkg.ProtocolName

type RaydiumAMMProtocol

type RaydiumAMMProtocol struct {
	SolClient *sol.Client
}

func NewRaydiumAmm

func NewRaydiumAmm(solClient *sol.Client) *RaydiumAMMProtocol

func (*RaydiumAMMProtocol) FetchPoolByID

func (r *RaydiumAMMProtocol) FetchPoolByID(ctx context.Context, poolID string) (pkg.Pool, error)

FetchPoolByID fetches a specific pool by its ID

func (*RaydiumAMMProtocol) FetchPoolsByPair

func (p *RaydiumAMMProtocol) FetchPoolsByPair(ctx context.Context, baseMint, quoteMint string) ([]pkg.Pool, error)

func (*RaydiumAMMProtocol) ProtocolName

func (p *RaydiumAMMProtocol) ProtocolName() pkg.ProtocolName

type RaydiumClmmProtocol

type RaydiumClmmProtocol struct {
	SolClient *sol.Client
}

func NewRaydiumClmm

func NewRaydiumClmm(solClient *sol.Client) *RaydiumClmmProtocol

func (*RaydiumClmmProtocol) FetchPoolByID

func (r *RaydiumClmmProtocol) FetchPoolByID(ctx context.Context, poolId string) (pkg.Pool, error)

func (*RaydiumClmmProtocol) FetchPoolsByPair

func (p *RaydiumClmmProtocol) FetchPoolsByPair(ctx context.Context, baseMint string, quoteMint string) ([]pkg.Pool, error)

func (*RaydiumClmmProtocol) ProtocolName

func (p *RaydiumClmmProtocol) ProtocolName() pkg.ProtocolName

type RaydiumCpmmProtocol

type RaydiumCpmmProtocol struct {
	SolClient *sol.Client
}

RaydiumCpmmProtocol represents the Raydium CPMM protocol implementation

func NewRaydiumCpmm

func NewRaydiumCpmm(solClient *sol.Client) *RaydiumCpmmProtocol

NewRaydiumCpmm creates a new instance of RaydiumCpmmProtocol

func (*RaydiumCpmmProtocol) FetchPoolByID

func (p *RaydiumCpmmProtocol) FetchPoolByID(ctx context.Context, poolID string) (pkg.Pool, error)

FetchPoolByID retrieves a CPMM pool by its ID

func (*RaydiumCpmmProtocol) FetchPoolsByPair

func (p *RaydiumCpmmProtocol) FetchPoolsByPair(ctx context.Context, baseMint string, quoteMint string) ([]pkg.Pool, error)

FetchPoolsByPair retrieves all pools for a given token pair

func (*RaydiumCpmmProtocol) ProtocolName

func (p *RaydiumCpmmProtocol) ProtocolName() pkg.ProtocolName

Jump to

Keyboard shortcuts

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