loop/liquidity/loopin_source.go
Boris Nagaev ac58336104
looprpc: add autoloop loop-in source
Add a dedicated loop-in source enum to the liquidity parameters
rpc and wire it through the internal parameter model and CLI.

This keeps the source selection explicit before any static
autoloop planning lands, so operators can choose between the
legacy wallet-funded path and a future static-address-backed
path without relying on implicit fallback behavior.
2026-05-22 02:20:36 -05:00

30 lines
706 B
Go

package liquidity
import "fmt"
// LoopInSource identifies the funding source that autoloop should use for loop
// in swaps.
type LoopInSource uint8
const (
// LoopInSourceWallet uses the legacy wallet-funded loop-in flow.
LoopInSourceWallet LoopInSource = iota
// LoopInSourceStaticAddress uses deposited static-address funds for
// loop-ins and does not fall back to wallet-funded loop-ins.
LoopInSourceStaticAddress
)
// String returns a human-readable representation of the source.
func (s LoopInSource) String() string {
switch s {
case LoopInSourceWallet:
return "wallet"
case LoopInSourceStaticAddress:
return "static-address"
default:
return fmt.Sprintf("unknown(%d)", s)
}
}