liquidity

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

Overview

Package liquidity generates router.json for the catscope-rust-bot build. It implements prefetch.StaticLoader and writes the configuration consumed by build.rs to initialise Router and LiquidityPartitioner at compile time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Lambda is the liquidity-penalty coefficient in the negative-log edge weight.
	Lambda float32 `json:"lambda"`
	// MinClusterLiquidity is the minimum USD pool liquidity for a pool to
	// count toward a token's Tier-2 degree during partitioning.
	MinClusterLiquidity float64 `json:"min_cluster_liquidity"`
	// TokenCount is the initial capacity hint for the router's mint index.
	TokenCount int `json:"token_count"`
	// CoreMints holds the five Tier-1 mint pubkeys in order:
	// USDC, wSOL, JitoSOL, mSOL, USDT.
	CoreMints [5]sgo.PublicKey `json:"core_mints"`
}

Config holds static parameters for the router and its LiquidityPartitioner.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config pre-filled with mainnet defaults.

type Liquidity

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

Liquidity implements prefetch.StaticLoader and writes router.json.

func Create

func Create(cfg Config) *Liquidity

Create initialises a Liquidity loader from the supplied Config.

func (*Liquidity) Args

func (l *Liquidity) Args(args []string) ([]string, error)

Args passes through cargo build arguments unchanged.

func (*Liquidity) Env

func (l *Liquidity) Env(mEnv map[string]string) error

Env makes no changes to the build environment.

func (*Liquidity) Load

func (l *Liquidity) Load(targetDirectory string, tp *trading.TradingPair) error

Load writes router.json to targetDirectory.

Source Files

  • liquidity.go
  • loader.go

Jump to

Keyboard shortcuts

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