kamino

package
v0.4.21 Latest Latest
Warning

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

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

Documentation

Overview

Package kamino preloads Kamino Lending reserve accounts.

Index

Constants

This section is empty.

Variables

View Source
var (
	DiscLendingMarket = [8]byte{246, 114, 50, 98, 72, 157, 28, 120}
	DiscReserve       = [8]byte{43, 242, 204, 202, 26, 247, 59, 127}
)

Discriminators for Anchor account types.

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

Functions

func ExportJSON added in v0.4.16

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

ExportJSON writes every tracked Kamino 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 Kamino

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

Kamino holds all Kamino Lending reserve accounts loaded at startup.

func Create

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

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

func (*Kamino) Args

func (k *Kamino) Args(args []string) ([]string, error)

func (*Kamino) Env

func (k *Kamino) Env(mEnv map[string]string) error

func (*Kamino) Find

func (k *Kamino) Find(reserveID sgo.PublicKey) *Reserve

Find looks up a reserve by its pubkey.

func (*Kamino) String

func (k *Kamino) String() string

type Reserve

type Reserve struct {
	Pubkey        sgo.PublicKey `json:"pubkey"`
	LendingMarket sgo.PublicKey `json:"lending_market"`
	Mint          sgo.PublicKey `json:"mint"`
	SupplyVault   sgo.PublicKey `json:"supply_vault"`
	FeeVault      sgo.PublicKey `json:"fee_vault"`
}

Reserve is the parsed state of a Kamino Lending reserve account.

func (*Reserve) String

func (r *Reserve) String() string

type ReserveConfig

type ReserveConfig struct {
	Pubkey sgo.PublicKey `json:"pubkey"`
}

type ReserveConfiguration

type ReserveConfiguration struct {
	List []*ReserveConfig `json:"list"`
}

Source Files

  • event.go
  • export.go
  • kamino.go
  • loader.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