Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultGasPriceBidReader(block *ethmonitor.Block) []*big.Int
- func DefaultGasPricePaidReader(block *ethmonitor.Block) []*big.Int
- type EMA
- type GasGauge
- func (g *GasGauge) IsRunning() bool
- func (g *GasGauge) Run(ctx context.Context) error
- func (g *GasGauge) Stop()
- func (g *GasGauge) Subscribe() ethmonitor.Subscription
- func (g *GasGauge) SuggestedGasPrice() SuggestedGasPrice
- func (g *GasGauge) SuggestedGasPriceBid() SuggestedGasPrice
- func (g *GasGauge) SuggestedPaidGasPrice() SuggestedGasPrice
- type GasPriceReader
- type SuggestedGasPrice
Constants ¶
View Source
const (
ONE_GWEI = uint64(1e9)
)
Variables ¶
View Source
var BUCKET_RANGE = big.NewInt(int64(5 * ONE_GWEI))
View Source
var CustomGasPriceBidReaders = map[uint64]GasPriceReader{}
View Source
var CustomGasPricePaidReaders = map[uint64]GasPriceReader{
42161: arbitrumGasPricePaidReader,
42170: arbitrumGasPricePaidReader,
421611: arbitrumGasPricePaidReader,
}
View Source
var ONE_GWEI_BIG = big.NewInt(int64(ONE_GWEI))
Functions ¶
func DefaultGasPriceBidReader ¶ added in v1.14.0
func DefaultGasPriceBidReader(block *ethmonitor.Block) []*big.Int
func DefaultGasPricePaidReader ¶ added in v1.14.0
func DefaultGasPricePaidReader(block *ethmonitor.Block) []*big.Int
Types ¶
type EMA ¶
type EMA struct {
// contains filtered or unexported fields
}
EMA is a moving average with exponential decay. It doesn't have any concept of weight so it will only work on homogenous (evenly spaced) time series. ema := NewEMA(0.1818) avg1 = ema.Tick(price1) avg2 = ema.Tick(price2) spike := checkPriceMovingAvg(price, avg, 20%)
type GasGauge ¶
type GasGauge struct {
// contains filtered or unexported fields
}
func NewGasGauge ¶
func NewGasGaugeWei ¶ added in v1.12.6
func (*GasGauge) Subscribe ¶
func (g *GasGauge) Subscribe() ethmonitor.Subscription
func (*GasGauge) SuggestedGasPrice ¶
func (g *GasGauge) SuggestedGasPrice() SuggestedGasPrice
func (*GasGauge) SuggestedGasPriceBid ¶ added in v1.14.0
func (g *GasGauge) SuggestedGasPriceBid() SuggestedGasPrice
func (*GasGauge) SuggestedPaidGasPrice ¶ added in v1.14.0
func (g *GasGauge) SuggestedPaidGasPrice() SuggestedGasPrice
type GasPriceReader ¶ added in v1.14.0
type GasPriceReader func(block *ethmonitor.Block) []*big.Int
type SuggestedGasPrice ¶
type SuggestedGasPrice struct { Instant uint64 `json:"instant"` // in gwei Fast uint64 `json:"fast"` Standard uint64 `json:"standard"` Slow uint64 `json:"slow"` InstantWei *big.Int `json:"instantWei"` FastWei *big.Int `json:"fastWei"` StandardWei *big.Int `json:"standardWei"` SlowWei *big.Int `json:"slowWei"` BlockNum *big.Int `json:"blockNum"` BlockTime uint64 `json:"blockTime"` }
Click to show internal directories.
Click to hide internal directories.