Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuctioneerTerms ¶
type AuctioneerTerms struct {
// MaxAccountValue is the current maximum allowed account value.
MaxAccountValue btcutil.Amount
// OrderExecBaseFee is the base fee charged per order, regardless of the
// matched size.
OrderExecBaseFee btcutil.Amount
// OrderExecFeeRate is the fee rate in parts per million.
OrderExecFeeRate btcutil.Amount
// LeaseDurationBuckets lists the current set of lease durations and
// maps them to their current market state.
LeaseDurationBuckets map[uint32]auctioneerrpc.DurationBucketState
// NextBatchConfTarget is the confirmation target the auctioneer will
// use to estimate the fee rate of the next batch.
NextBatchConfTarget uint32
// NextBatchFeeRate is the fee rate estimate the auctioneer will use for
// the next batch.
NextBatchFeeRate chainfee.SatPerKWeight
// NextBatchClear is the time at which the auctioneer will attempt to
// clear the next batch.
NextBatchClear time.Time
}
AuctioneerTerms is a struct that holds all dynamic terms the auctioneer defines.
func (*AuctioneerTerms) FeeSchedule ¶
func (t *AuctioneerTerms) FeeSchedule() FeeSchedule
FeeSchedule returns the execution fee as a FeeSchedule.
type FeeSchedule ¶
type FeeSchedule interface {
// BaseFee is the base fee the auctioneer will charge the traders for
// each executed order.
BaseFee() btcutil.Amount
// ExecutionFee computes the execution fee (usually based off of a
// rate) for the target amount.
ExecutionFee(amt btcutil.Amount) btcutil.Amount
}
FeeSchedule is an interface that represents the configuration source that the auctioneer will use to determine how much to charge in fees for each trader.
type LinearFeeSchedule ¶
type LinearFeeSchedule struct {
// contains filtered or unexported fields
}
LinearFeeSchedule is a FeeSchedule that calculates the execution fee based upon a static base fee and a variable fee rate in parts per million.
func NewLinearFeeSchedule ¶
func NewLinearFeeSchedule(baseFee, feeRate btcutil.Amount) *LinearFeeSchedule
NewLinearFeeSchedule creates a new linear fee schedule based upon a static base fee and a relative fee rate in parts per million.
func (*LinearFeeSchedule) BaseFee ¶
func (s *LinearFeeSchedule) BaseFee() btcutil.Amount
BaseFee is the base fee the auctioneer will charge the traders for each executed order.
NOTE: This method is part of the orderT.FeeSchedule interface.
func (*LinearFeeSchedule) ExecutionFee ¶
func (s *LinearFeeSchedule) ExecutionFee(amt btcutil.Amount) btcutil.Amount
ExecutionFee computes the execution fee (usually based off of a rate) for the target amount.
NOTE: This method is part of the orderT.FeeSchedule interface.
func (*LinearFeeSchedule) FeeRate ¶
func (s *LinearFeeSchedule) FeeRate() btcutil.Amount
FeeRate is the variable fee rate in parts per million.