lifi

package
v0.0.0-...-0864b09 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 49 Imported by: 0

Documentation

Overview

Package lifi implements the LI.FI same-chain intent solver. It publishes LiquidLane-backed standing quotes to the LI.FI order server and listens for matched escrow orders.

Index

Constants

View Source
const Name = "lifi-samechain"

Variables

This section is empty.

Functions

func NewRecipeSolver

func NewRecipeSolver(name string, cfg *Config, lane filler.Config, deps solver.Deps) (solver.Solver, error)

NewRecipeSolver builds the LI.FI engine as the solver called name: it quotes the connector discounts advertised for the recipes in lane and settles opened orders through them on the SDK transaction manager. cfg comes from ParseRecipeConfig.

Types

type Config

type Config struct {
	OrderServer   OrderServerConfig
	InputSettler  common.Address
	OutputSettler common.Address
	Executor      common.Address
	// LiquidityLens is the optional FrontendLiquidityLens address. When set, LiquidLane swappable headroom
	// is read from the lens's cross-adapter deallocation-cascade estimate instead of each adapter's own
	// getMaxAssets(tokenToRedeem); zero falls back to the adapter getter.
	LiquidityLens    common.Address
	Adapters         []common.Address
	TokenPolicy      tokenpolicy.Policy
	QuoteInterval    time.Duration
	QuoteTTL         time.Duration
	QuoteRefreshMode string
	SolverMode       string
	DiscountsURL     string
	Gas              *liquidlanegas.OracleConfig
	Strategy         StrategyConfig
}

func ParseRecipeConfig

func ParseRecipeConfig(raw RawEngineConfig) (*Config, error)

ParseRecipeConfig resolves the engine config of a solver that settles through connector recipes. Such a solver is discount-backed, its sender pays gas, and its quotes are priced from connector inventory, which the webhook wire shape does not carry.

type OrderServerConfig

type OrderServerConfig struct {
	BaseURL        string
	WSURL          string
	APIKeyEnv      string
	HTTPTimeout    time.Duration
	WSReadTimeout  time.Duration
	WSWriteTimeout time.Duration
}

type RawEngineConfig

type RawEngineConfig struct {
	OrderServer        rawOrderServerConfig `yaml:"orderServer"`
	InputSettler       string               `yaml:"inputSettler"`
	OutputSettler      string               `yaml:"outputSettler"`
	Executor           string               `yaml:"executor"`
	TokensToQuote      string               `yaml:"tokensToQuote"`
	PermissionedTokens []string             `yaml:"permissionedTokens"`
	QuoteIntervalMs    int                  `yaml:"quoteIntervalMs"`
	QuoteTTL           string               `yaml:"quoteTtl"`
	QuoteRefreshMode   string               `yaml:"quoteRefreshMode"`
	DiscountsURL       string               `yaml:"privateDiscountsUrl"`
	Strategy           rawStrategyConfig    `yaml:"strategy"`
}

RawEngineConfig is the configuration every LI.FI solver shares, whatever settles its orders: the order server, the settlement contracts, the token scope, the standing-quote cadence, the discount service and the strategy. Each solver inlines it into its own config.

type Solver

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

func (*Solver) Name

func (s *Solver) Name() string

Name is the registered solver the engine runs as; an engine built directly is the adapter solver.

func (*Solver) RequiresMerkleTxManager

func (s *Solver) RequiresMerkleTxManager() bool

func (*Solver) RequiresTxManager

func (s *Solver) RequiresTxManager() bool

func (*Solver) Run

func (s *Solver) Run(ctx context.Context) error

func (*Solver) ShutdownPreparationTimeout

func (s *Solver) ShutdownPreparationTimeout() time.Duration

type StrategyConfig

type StrategyConfig struct {
	Name   string
	Config yaml.Node
}

Directories

Path Synopsis
types
Package types defines the LI.FI same-chain solver strategy contract.
Package types defines the LI.FI same-chain solver strategy contract.

Jump to

Keyboard shortcuts

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