terms

package
v0.5.8-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

	// AutoRenewExtensionBlocks is the threshold used to extend the expiry height
	// of the accounts that are close to expire after participating in a batch.
	AutoRenewExtensionBlocks uint32
}

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.

Jump to

Keyboard shortcuts

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