perpfunding

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema string

Functions

func ExportJSON

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

ExportJSON writes every persisted target allocation to path as a JSON object of symbol -> allocation_pct -- reusing GetAllTargetAllocations (already exported, already returns exactly this shape) verbatim, so catscope-rust-bot's build.rs can read this file instead of opening prefetch.db directly.

func GetAllTargetAllocations

func GetAllTargetAllocations(db *sql.DB) (map[string]float64, error)

GetAllTargetAllocations reads every persisted target allocation, keyed by symbol.

func GetTargetAllocation

func GetTargetAllocation(db *sql.DB, symbol string) (float64, bool, error)

GetTargetAllocation reads symbol's persisted target allocation, if one has ever been set.

func SetTargetAllocation

func SetTargetAllocation(db *sql.DB, symbol string, allocationPct float64) error

SetTargetAllocation persists symbol's latest target allocation (fraction of total portfolio value, 0.0-1.0), overwriting whatever was there before -- this table is a latest-write-wins cache, not a history.

Types

This section is empty.

Source Files

  • export.go
  • schema.go
  • store.go

Jump to

Keyboard shortcuts

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