jet

package
v0.4.23 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package jet preloads Jet Protocol V1 lending pool reserve accounts (global market data only -- Obligation, the per-wallet position account, is not fetched here since there is no bounded set to bulk-load).

Index

Constants

This section is empty.

Variables

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

Functions

func ExportJSON

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

ExportJSON writes every tracked Jet reserve to path as a JSON array of Reserve values (its own existing json tags) -- the same real query loadReserves already runs for in-process use, reused verbatim, so catscope-rust-bot's build.rs can read this file instead of opening prefetch.db directly.

Types

type Jet

type Jet struct {
	Reserves []*Reserve
	// contains filtered or unexported fields
}

Jet holds all Jet Protocol V1 reserve accounts loaded at startup.

func Create

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

Create queries the Jet Protocol V1 program at depth 2 (program → market → reserve) and collects all reserve accounts, persisting results to db (jet_reserve). If db already has reserves from a previous run, they're loaded back instead of re-fetching, unless force is true.

func (*Jet) Find

func (j *Jet) Find(reserveID sgo.PublicKey) *Reserve

Find looks up a reserve by its pubkey.

func (*Jet) String

func (j *Jet) String() string

type Reserve

type Reserve struct {
	Pubkey sgo.PublicKey `json:"pubkey"`
	Market sgo.PublicKey `json:"market"`
	Mint   sgo.PublicKey `json:"mint"`
	Vault  sgo.PublicKey `json:"vault"`
}

Reserve is the parsed state of a Jet Protocol V1 Reserve account.

func (*Reserve) String

func (r *Reserve) String() string

Source Files

  • event.go
  • export.go
  • jet.go
  • print.go
  • reserve.go
  • schema.go
  • store.go

Jump to

Keyboard shortcuts

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