pumpswap

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package pumpswap preloads PumpSwap AMM pool state.

Index

Constants

This section is empty.

Variables

View Source
var (
	ProgramID = sgo.MustPublicKeyFromBase58("pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA")
)
View Source
var Schema string

Functions

func ExportJSON

func ExportJSON(db *sql.DB, path string) error

ExportJSON writes every pumpswap_pool row to path.

Types

type Pool

type Pool struct {
	Pool         sgo.PublicKey `json:"pool"`
	BaseMint     sgo.PublicKey `json:"base_mint"`
	QuoteMint    sgo.PublicKey `json:"quote_mint"`
	BaseVault    sgo.PublicKey `json:"base_vault"`
	QuoteVault   sgo.PublicKey `json:"quote_vault"`
	CoinCreator  sgo.PublicKey `json:"coin_creator"`
	BaseBalance  uint64        `json:"base_balance"`
	QuoteBalance uint64        `json:"quote_balance"`
}

Pool holds one PumpSwap pool's parsed state.

type PoolJSON

type PoolJSON struct {
	Pool         sgo.PublicKey `json:"pool"`
	BaseMint     sgo.PublicKey `json:"base_mint"`
	QuoteMint    sgo.PublicKey `json:"quote_mint"`
	BaseVault    sgo.PublicKey `json:"base_vault"`
	QuoteVault   sgo.PublicKey `json:"quote_vault"`
	BaseBalance  int64         `json:"base_balance"`
	QuoteBalance int64         `json:"quote_balance"`
}

PoolJSON is one pumpswap_pool row, JSON-shaped for catscope-rust-bot's build.rs to read instead of opening prefetch.db directly. Exported unfiltered -- every column here is NOT NULL (base_balance/quote_balance default to 0), and the table is small (~4K rows), so there's nothing to filter or cap on the Go side; build.rs applies its own base_balance/quote_balance > 0 filter for the router graph.

type Pumpswap

type Pumpswap struct {
	Pools []*Pool
}

Pumpswap holds pools loaded at startup.

func Create

func Create(ctx context.Context, stateClient state.Client, db *sql.DB, maxSubscriptionCount int, force bool) (*Pumpswap, error)

Create discovers PumpSwap pools and persists results to db (pumpswap_pool). If db already has pools from a previous run, they're loaded back instead of re-fetching, unless force is true.

type Query

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

func CreateQuery

func CreateQuery(db *sql.DB) (*Query, error)

CreateQuery prepares the top-pools-by-liquidity statement against pumpswap_pool. Callers wrap the result as one dispatch case of a single, consolidated "get top pools" tool (see prefetch/prompttool.go) rather than exposing their own separate tool.

func (*Query) TopPools

func (q *Query) TopPools(ctx context.Context, count int) (string, error)

TopPools returns up to count pumpswap_pool pool accounts, ranked by base_balance+quote_balance descending, as a semicolon-joined "pool=..." list.

Source Files

  • event.go
  • export.go
  • pool.go
  • pumpswap.go
  • query.go
  • schema.go
  • store.go

Jump to

Keyboard shortcuts

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