-
Notifications
You must be signed in to change notification settings - Fork 46
/
terms.go
49 lines (38 loc) · 1.54 KB
/
terms.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package terms
import (
"time"
"github.com/btcsuite/btcd/btcutil"
"github.com/lightninglabs/pool/auctioneerrpc"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
)
// AuctioneerTerms is a struct that holds all dynamic terms the auctioneer defines.
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
}
// FeeSchedule returns the execution fee as a FeeSchedule.
func (t *AuctioneerTerms) FeeSchedule() FeeSchedule {
return NewLinearFeeSchedule(
t.OrderExecBaseFee, t.OrderExecFeeRate,
)
}