stipconfig

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package stipconfig contains the configuration structures and logic for the STIP relayer service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Signer config.SignerConfig `yaml:"signer"`
	// Submitter is the submitter config.
	SubmitterConfig   submitterConfig.Config `yaml:"submitter_config"`
	ArbAddress        string                 `yaml:"arb_address"`
	ArbChainID        uint64                 `yaml:"arb_chain_id"`
	StartDate         time.Time              `yaml:"start_date"`
	Database          DatabaseConfig         `yaml:"database"`
	OmniRPCURL        string                 `yaml:"omnirpc_url"`
	FeesAndRebates    FeesAndRebates         `yaml:"fees_and_rebates"`
	DuneInterval      time.Duration          `yaml:"dune_interval"`
	RebateInterval    time.Duration          `yaml:"rebate_interval"`
	StipAPIPort       string                 `yaml:"stip_api_port"`
	ARBMaxTransfer    int64                  `yaml:"ARB_max_transfer"`
	ArbCapPerAddress  int64                  `yaml:"arb_cap_per_address"`
	ARBMinTransfer    float64                `yaml:"ARB_min_transfer"`
	DuneLookbackHours int                    `yaml:"dune_lookback_hours"`
	StipQueryID       int                    `yaml:"stip_query_id"`
	// ScreenerAPIUrl is the TRM API url.
	ScreenerAPIUrl string `yaml:"screener_api_url"`
}

Config holds the configuration for the STIP relayer service.

func LoadConfig

func LoadConfig(path string) (config Config, err error)

LoadConfig loads the config from the given path.

func (Config) GetArbCapPerAddress added in v0.0.8

func (c Config) GetArbCapPerAddress() int64

GetArbCapPerAddress returns the configured arb cap per address, in human-readable units.

func (Config) GetDuneLookbackHours added in v0.0.21

func (c Config) GetDuneLookbackHours() int

GetDuneLookbackHours returns the configured dune lookback hours.

type DatabaseConfig

type DatabaseConfig struct {
	Type string `yaml:"type"`
	DSN  string `yaml:"dsn"` // Data Source Name
}

DatabaseConfig represents the configuration for the database.

type FeeRebate

type FeeRebate struct {
	Fee       float64 `yaml:"fee"`        // Fee is the cost that will be charged.
	RebateBps float64 `yaml:"rebate_bps"` // RebateBps is the amount that will be returned, in units of basis points.
}

FeeRebate represents the fee and rebate values.

type FeesAndRebates

type FeesAndRebates map[int]ModuleFeeRebate

FeesAndRebates is a map where the key is an integer representing a specific category or group, and the value is a ModuleFeeRebate map representing the fee and rebate for each module in that category or group.

type ModuleFeeRebate

type ModuleFeeRebate map[string]TokenFeeRebate

ModuleFeeRebate is a map where the key is a string representing a module, and the value is a TokenFeeRebate map representing the fee and rebate for each token in that module.

type TokenFeeRebate

type TokenFeeRebate map[string]FeeRebate

TokenFeeRebate is a map where the key is a string representing a token, and the value is a FeeRebate struct representing the fee and rebate for that token.

Jump to

Keyboard shortcuts

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