services

package
v0.0.0-...-7f1b7f4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChainlinkACAListSanityCheck

func ChainlinkACAListSanityCheck(client *ethclient.Client) bool

This function serves two purposes 1) Check if the list of chainlink oracle pricefeeds (that I bootstrapped in `priceFeedACAList`) are valid 2) To run on init to check if all the pricefeeds are valid (useful to check sanity of ACA's when we add new oracles)

func CheckBlockReorderTaint

func CheckBlockReorderTaint(block *types.Block, client *ethclient.Client) (bool, int)

Check if the block txs order indicates deviation from standard client rules A block is said to be tainted if a miner prioritizes a tx over other despite the latter paying higher gas If a miner were to be extracting MEV, they would prioritize execution of their own above else (despite gas priority) TODO: Lot's of test cases to ensure accuracy, return addition info about types of tx prioritized

func DialInfuraClient

func DialInfuraClient() *ethclient.Client

func DialLocalClient

func DialLocalClient() *ethclient.Client

func GetCurrentClient

func GetCurrentClient() *ethclient.Client

ethclient NOT rpcclient

func HandleAddLiquidity

func HandleAddLiquidity(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleAddLiquidityETH

func HandleAddLiquidityETH(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleRemoveLiquidity

func HandleRemoveLiquidity(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleRemoveLiquidityETH

func HandleRemoveLiquidityETH(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleRemoveLiquidityETHSupportingFeeOnTransferTokens

func HandleRemoveLiquidityETHSupportingFeeOnTransferTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleRemoveLiquidityETHWithPermit

func HandleRemoveLiquidityETHWithPermit(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleRemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens

func HandleRemoveLiquidityETHWithPermitSupportingFeeOnTransferTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleRemoveLiquidityWithPermit

func HandleRemoveLiquidityWithPermit(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapETHForExactTokens

func HandleSwapETHForExactTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapExactETHForTokens

func HandleSwapExactETHForTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapExactETHForTokensSupportingFeeOnTransferTokens

func HandleSwapExactETHForTokensSupportingFeeOnTransferTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapExactTokensForETH

func HandleSwapExactTokensForETH(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapExactTokensForETHSupportingFeeOnTransferTokens

func HandleSwapExactTokensForETHSupportingFeeOnTransferTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapExactTokensForTokens

func HandleSwapExactTokensForTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapExactTokensForTokensSupportingFeeOnTransferTokens

func HandleSwapExactTokensForTokensSupportingFeeOnTransferTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapTokensForExactEth

func HandleSwapTokensForExactEth(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func HandleSwapTokensForExactTokens

func HandleSwapTokensForExactTokens(tx *types.Transaction, client *ethclient.Client, isStealth bool, fullMode bool)

func InitRPCClient

func InitRPCClient() *rpc.Client

func StreamNewBlocks

func StreamNewBlocks(client *rpc.Client)

func StreamNewTxs

func StreamNewTxs(rpcClient *rpc.Client, fullMode bool)

Method to stream new transactions as they're discovered by the node We create a new channel to plug into the mempool and listen to new txs They're then passed through the tx classifier to be parsed and eventually piped into elastic search

func TxMinedUpdate

func TxMinedUpdate(txHash string, client *ethclient.Client)

After a block is mined, we iterate through the txs and mark the ones that've been mined

Types

type ERC20TransferParsedInput

type ERC20TransferParsedInput struct {
	// contains filtered or unexported fields
}

type UniswapAddLiquidityETHFinalInput

type UniswapAddLiquidityETHFinalInput struct {
	TokenAddress             string  `json:"tokenAddress"`
	LiquidityProviderAddress string  `json:"liquidityProviderAddress"`
	Deadline                 int64   `json:"deadline"`
	AmountTokenDesired       float64 `json:"amountTokenDesired"`
	AmountTokenMin           float64 `json:"amountTokenMin"`
	AmountEthMin             float64 `json:"amountEthMin"`
}

type UniswapAddLiquidityETHInput

type UniswapAddLiquidityETHInput struct {
	Token              common.Address
	AmountTokenDesired *big.Int
	AmountETHMin       *big.Int
	AmountTokenMin     *big.Int
	Deadline           *big.Int
	To                 common.Address
}

type UniswapAddLiquidityFinalInput

type UniswapAddLiquidityFinalInput struct {
	TokenAAddress            string  `json:"tokenAAddress"`
	TokenBAddress            string  `json:"tokenBAddress"`
	AmountADesired           float64 `json:"amountADesired"`
	AmountBDesired           float64 `json:"amountBDesired"`
	AmountAMin               float64 `json:"amountAMin"`
	AmountBMin               float64 `json:"amountBMin"`
	Deadline                 int64   `json:"deadline"`
	LiquidityProviderAddress string  `json:"liquidityProviderAddress"`
}

type UniswapAddLiquidityInput

type UniswapAddLiquidityInput struct {
	TokenA         common.Address
	TokenB         common.Address
	AmountADesired *big.Int
	AmountBDesired *big.Int
	AmountAMin     *big.Int
	AmountBMin     *big.Int
	Deadline       *big.Int
	To             common.Address
}

type UniswapETHToExactTokensInput

type UniswapETHToExactTokensInput struct {
	AmountOut *big.Int
	Path      []common.Address
	Deadline  *big.Int
	To        common.Address
}

type UniswapETHToTokenParsedInput

type UniswapETHToTokenParsedInput struct {
	AmountOutMin *big.Int
	Path         []common.Address
	Deadline     *big.Int
	To           common.Address
}

Relevant types

type UniswapExactETHForTokensSupportingFeeOnTransferTokensInput

type UniswapExactETHForTokensSupportingFeeOnTransferTokensInput struct {
	AmountOutMin *big.Int
	Path         []common.Address
	Deadline     *big.Int
	To           common.Address
}

type UniswapExactTokensForETHSupportingFeeOnTransferTokensInput

type UniswapExactTokensForETHSupportingFeeOnTransferTokensInput struct {
	AmountIn     *big.Int
	AmountOutMin *big.Int
	Path         []common.Address
	Deadline     *big.Int
	To           common.Address
}

type UniswapExactTokensForTokensSupportingFeeOnTransferTokensInput

type UniswapExactTokensForTokensSupportingFeeOnTransferTokensInput struct {
	AmountIn     *big.Int
	AmountOutMin *big.Int
	Path         []common.Address
	Deadline     *big.Int
	To           common.Address
}

type UniswapRemoveLiquidityETHFinalInput

type UniswapRemoveLiquidityETHFinalInput struct {
	TokenAddress             string  `json:"tokenAddress"`
	LPTokenAmount            float64 `json:"lPTokenAmount"`
	AmountTokenMin           float64 `json:"amountTokenMin"`
	AmountETHMin             float64 `json:"amountEthMin"`
	Deadline                 int64   `json:"deadline"`
	LiquidityProviderAddress string  `json:"liquidityProviderAddress"`
}

type UniswapRemoveLiquidityETHInput

type UniswapRemoveLiquidityETHInput struct {
	Token          common.Address
	Liquidity      *big.Int
	AmountTokenMin *big.Int
	AmountETHMin   *big.Int
	Deadline       *big.Int
	To             common.Address
}

type UniswapRemoveLiquidityETHSupportingFeeOnTransferTokens

type UniswapRemoveLiquidityETHSupportingFeeOnTransferTokens struct {
	Token          common.Address
	Liquidity      *big.Int
	AmountTokenMin *big.Int
	AmountETHMin   *big.Int
	Deadline       *big.Int
	To             common.Address
}

type UniswapRemoveLiquidityETHWithPermit

type UniswapRemoveLiquidityETHWithPermit struct {
	// (address token,uint256 liquidity,uint256 amountTokenMin,uint256 amountETHMin,address to,uint256 deadline,bool approveMax,uint8 v,bytes32 r,bytes32 s )
	Token          common.Address
	Liquidity      *big.Int
	AmountTokenMin *big.Int
	AmountETHMin   *big.Int
	Deadline       *big.Int
	To             common.Address
	ApproveMax     bool
	V              uint8
	R              [32]byte
	S              [32]byte
}

type UniswapRemoveLiquidityETHWithPermitSupportingFeeOnTransferTokensInput

type UniswapRemoveLiquidityETHWithPermitSupportingFeeOnTransferTokensInput struct {
	Token          common.Address
	Liquidity      *big.Int
	AmountTokenMin *big.Int
	AmountETHMin   *big.Int
	Deadline       *big.Int
	To             common.Address
	ApproveMax     bool
	V              uint8
	R              [32]byte
	S              [32]byte
}

type UniswapRemoveLiquidityFinalInput

type UniswapRemoveLiquidityFinalInput struct {
	TokenA     string  `json:"tokenA"`
	TokenB     string  `json:"tokenB"`
	AmountAMin float64 `json:"amountAMin"`
	AmountBMin float64 `json:"amountBMin"`
	Deadline   int64   `json:"deadline"`
}

type UniswapRemoveLiquidityInput

type UniswapRemoveLiquidityInput struct {
	TokenA     common.Address
	TokenB     common.Address
	Liquidity  *big.Int
	AmountAMin *big.Int
	AmountBMin *big.Int
	Deadline   *big.Int
	To         common.Address
}

type UniswapRemoveLiquidityWithPermitInput

type UniswapRemoveLiquidityWithPermitInput struct {
	TokenA     common.Address
	TokenB     common.Address
	Liquidity  *big.Int
	AmountAMin *big.Int
	AmountBMin *big.Int
	To         common.Address
	Deadline   *big.Int
	ApproveMax bool
	V          uint8
	R          [32]byte
	S          [32]byte
}

type UniswapTokenToETHParsedInput

type UniswapTokenToETHParsedInput struct {
	AmountIn     *big.Int
	AmountOutMin *big.Int
	Path         []common.Address
	Deadline     *big.Int
	To           common.Address
}

type UniswapTokenToTokenParsedInput

type UniswapTokenToTokenParsedInput struct {
	AmountIn     *big.Int
	AmountOutMin *big.Int
	Path         []common.Address
	Deadline     *big.Int
	To           common.Address
}

type UniswapTokensForExactETHInput

type UniswapTokensForExactETHInput struct {
	AmountOut   *big.Int
	AmountInMax *big.Int
	Path        []common.Address
	Deadline    *big.Int
	To          common.Address
}

type UniswapTokensForExactTokensInput

type UniswapTokensForExactTokensInput struct {
	AmountOut   *big.Int
	AmountInMax *big.Int
	Path        []common.Address
	Deadline    *big.Int
	To          common.Address
}

type UniswapTradeFinal

type UniswapTradeFinal struct {
	AmountIn          float64  `json:"amountIn"`
	AmountOutMin      float64  `json:"amountOutMin"`
	Path              []string `json:"path"`
	Deadline          int64    `json:"deadline"`
	To                string   `json:"to"`
	OutputTokenSymbol string   `json:"outputTokenSymbol"`
	OutputTokenName   string   `json:""`
}

Jump to

Keyboard shortcuts

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