Documentation
¶
Overview ¶
Package solend preloads Solend/Save token-lending 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 ¶
const SevenDaysOfSlots = 7 * 24 * 60 * 60 * 25 / 10 // 1,512,000 slots
SevenDaysOfSlots assumes ~400ms/slot (2.5 slots/sec), the same fallback bot/state/clock.go itself uses before real slot-timing data arrives -- see raydium/cpmm's own OldSlot for the established precedent of this convention.
Variables ¶
var (
ProgramID = sgo.MustPublicKeyFromBase58("So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo")
)
var Schema string
Functions ¶
func ExportJSON ¶
ExportJSON writes every tracked Solend 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 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"`
}
Reserve is the parsed state of a Solend Reserve account.
type Solend ¶
type Solend struct {
Reserves []*Reserve
// contains filtered or unexported fields
}
Solend holds all Solend/Save reserve accounts loaded at startup.
func Create ¶
Create discovers Solend lending markets and reserves via an active, per-node Subscribe/ack chain (program -> lending_market, then lending_market -> reserve; see event.go, which mirrors orca.fetchWhirlpool's own config->pool chain) and collects all reserve accounts, persisting results to db (solend_reserve). If db already has reserves from a previous run, they're loaded back instead of re-fetching, unless force is true.
func (*Solend) Find ¶
Find looks up a reserve by its pubkey.
Source Files
¶
- event.go
- export.go
- print.go
- reserve.go
- schema.go
- solend.go
- store.go