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 ¶
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 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 ¶
Name is the registered solver the engine runs as; an engine built directly is the adapter solver.
func (*Solver) RequiresMerkleTxManager ¶
func (*Solver) RequiresTxManager ¶
func (*Solver) ShutdownPreparationTimeout ¶
type StrategyConfig ¶
Source Files
¶
- chainreader.go
- config.go
- deposit_retry.go
- discounts.go
- execution.go
- fill.go
- metrics.go
- order.go
- order_diagnostics.go
- order_observation.go
- order_retry.go
- orderclient.go
- planning.go
- quote_observation.go
- quote_rejections.go
- quotes.go
- recipes.go
- settlement.go
- solver.go
- strategy.go
- submission.go
- trace.go
- tracing.go
- wsclient.go