package
0.29.0-beta.rc2
Repository: https://github.com/lightninglabs/loop.git
Documentation: pkg.go.dev

# Functions

NewFeeCategoryLimit created a new fee limit struct which sets individual fee limits per category.
NewFeePortion creates a fee limit based on a flat percentage of swap amount.
NewManager creates a liquidity manager which has no rules set.
NewRestrictions creates a set of restrictions.
NewThresholdRule returns a new threshold rule.
ParametersToRpc takes a `Parameters` and creates a `LiquidityParameters` from it.
rpcToParameters takes a `LiquidityParameters` and creates a `Parameters` from it.
UseLogger uses a specified Logger to output package logging info.

# Constants

DefaultAutoloopTicker is the default amount of time between automated swap checks.
FeeBase is the base that we use to express fees.
No description provided by the author
ReasonBudgetElapsed indicates that the autoloop budget for the period has been elapsed.
ReasonBudgetInsufficient indicates that we cannot perform a swap because we do not have enough pending budget available.
ReasonBudgetNotStarted indicates that we do not recommend any swaps because the start time for our budget has not arrived yet.
ReasonFailureBackoff indicates that a swap has recently failed for this target, and the backoff period has not yet passed.
ReasonFeePPMInsufficient indicates that the fees a swap would require are greater than the portion of swap amount allocated to fees.
ReasonInFlight indicates that the limit on in-flight automatically dispatched swaps has already been reached.
ReasonLiquidityOk indicates that a target meets the liquidity balance expressed in its rule, so no swap is needed.
ReasonLoopIn indicates that a loop in swap is currently in flight for the peer, so it is not eligible.
ReasonLoopInUnreachable indicates that the server does not have a path to the client, so cannot perform a loop in swap at this time.
ReasonLoopOut indicates that a loop out swap is currently utilizing the channel, so it is not eligible.
ReasonMinerFee indicates that the miner fee for a specific swap is to high.
ReasonNone is the zero value reason, added so that this enum can align with the numeric values used in our protobufs and avoid ambiguity around default zero values.
ReasonPrepay indicates that the prepay fee for a specific swap is too high.
ReasonSwapFee indicates that the server fee for a specific swap is too high.
ReasonSweepFees indicates that the estimated fees to sweep swaps are too high right now.
Subsystem defines the sub system name of this package.

# Variables

ErrAccountAndAddrType indicates if an account is set but the account address type is not or vice versa.
ErrAmbiguousDestAddr is returned when a destination address and a extended public key account is set.
ErrExclusiveRules is returned when a set of rules that may not be set together are specified.
ErrInvalidPPM is returned is the parts per million for a fee rate are invalid.
ErrInvalidSweepFeeRateLimit is returned if an invalid sweep fee limit is set.
ErrMaxExceedsServer is returned if the maximum swap amount set is more than the server offers.
ErrMinimumExceedsMaximumAmt is returned when the minimum configured swap amount is more than the maximum.
ErrMinLessThanServer is returned if the minimum swap amount set is less than the server minimum.
ErrNegativeBudget is returned if a negative swap budget is set.
ErrNoRules is returned when no rules are set for swap suggestions.
ErrZeroChannelID is returned if we get a rule for a 0 channel ID.
ErrZeroInFlight is returned is a zero in flight swaps value is set.
ErrZeroMinerFee is returned if a zero maximum miner fee is set.
ErrZeroPrepay is returned if a zero maximum prepay is set.
ErrZeroPrepayPPM is returned if a zero prepay routing fee ppm is set.
ErrZeroRoutingPPM is returned if a zero routing fee ppm is set.
ErrZeroSwapFeePPM is returned if a zero server fee ppm is set.

# Structs

Config contains the external functionality required to run the liquidity manager.
FeeCategoryLimit is an implementation of the fee limit interface which sets a specific fee limit per fee category.
FeePortion is a fee limitation which limits fees to a set portion of the swap amount.
Manager contains a set of desired liquidity rules for our channel balances.
Parameters is a set of parameters provided by the user which guide how we assess liquidity.
Restrictions indicates the restrictions placed on a swap.
Suggestions provides a set of suggested swaps, and the set of channels that were excluded from consideration.
SwapRule is a liquidity rule with a specific swap type.
ThresholdRule is a liquidity rule that implements minimum incoming and outgoing liquidity threshold.

# Interfaces

FeeLimit is an interface implemented by different strategies for limiting the fees we pay for autoloops.

# Type aliases

Reason is an enum which represents the various reasons we have for not executing a swap.