profitabilitychecker

package
v0.0.2-RC1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	Config      Config
	EthMan      etherman
	PriceGetter pricegetter.Client
}

Checker checks profitability to send sequences

func New

func New(
	cfg Config,
	etherMan etherman,
	priceGetter priceGetter) *Checker

New creates new profitability checker

func (*Checker) IsSendSequencesProfitable

func (c *Checker) IsSendSequencesProfitable(estimatedGas *big.Int, sequences []types.Sequence) bool

IsSendSequencesProfitable checks profitability to send sequences to the ethereum

func (*Checker) IsSequenceProfitable

func (c *Checker) IsSequenceProfitable(ctx context.Context, sequence types.Sequence) (bool, error)

IsSequenceProfitable check if sequence is profitable by comparing L1 tx gas cost and collateral with fee rewards

type Config

type Config struct {
	// SendBatchesEvenWhenNotProfitable if true -> send unprofitable batch
	SendBatchesEvenWhenNotProfitable bool `mapstructure:"SendBatchesEvenWhenNotProfitable"`
}

Config for profitability checker

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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