txfee_filters

package
v22.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

TXfee filters

See https://github.com/osmosis-labs/osmosis/issues/738

Want to move towards that, right now this is a stepping stone for that. We currently define a filter for recognizing if a tx is an arb transaction, and if so raising its gas price accordingly.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsArbTxLoose

func IsArbTxLoose(tx sdk.Tx) bool

We check if a tx is an arbitrage for the mempool right now by seeing: 1) does start token of a msg = final token of msg (definitionally correct) 2) does it have multiple swap messages, with different tx ins. If so, we assume its an arb.

  • This has false positives, but is intended to avoid the obvious solution of splitting an arb into multiple messages.

3) We record all denoms seen across all swaps, and see if any duplicates. (TODO) 4) Contains both JoinPool and ExitPool messages in one tx.

  • Has some false positives, but they seem relatively contrived.

TODO: Move the first component to a future router module.

Types

type AffiliateSwapMsg

type AffiliateSwapMsg struct {
	Swap `json:"swap"`
}

func (AffiliateSwapMsg) TokenDenomsOnPath

func (m AffiliateSwapMsg) TokenDenomsOnPath() []string

TokenDenomsOnPath implements types.SwapMsgRoute.

func (AffiliateSwapMsg) TokenInDenom

func (m AffiliateSwapMsg) TokenInDenom() string

TokenInDenom implements types.SwapMsgRoute.

func (AffiliateSwapMsg) TokenOutDenom

func (m AffiliateSwapMsg) TokenOutDenom() string

TokenOutDenom implements types.SwapMsgRoute.

type ContractSwap

type ContractSwap struct {
	InputCoin   InputCoin `json:"input_coin"`
	OutputDenom string    `json:"output_denom"`
	Slippage    Slippage  `json:"slippage"`
}

type ContractSwapMsg

type ContractSwapMsg struct {
	ContractSwap `json:"swap"`
}

func (ContractSwapMsg) TokenDenomsOnPath

func (c ContractSwapMsg) TokenDenomsOnPath() []string

TokenDenomsOnPath implements types.SwapMsgRoute.

func (ContractSwapMsg) TokenInDenom

func (c ContractSwapMsg) TokenInDenom() string

TokenInDenom implements types.SwapMsgRoute.

func (ContractSwapMsg) TokenOutDenom

func (c ContractSwapMsg) TokenOutDenom() string

TokenOutDenom implements types.SwapMsgRoute.

type InputCoin

type InputCoin struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

type Slippage

type Slippage struct {
	MinOutputAmount string `json:"min_output_amount"`
}

type Swap

type Swap struct {
	Routes            []poolmanagertypes.SwapAmountInRoute `json:"routes"`
	TokenOutMinAmount sdk.Coin                             `json:"token_out_min_amount"`
	FeePercentage     sdk.Dec                              `json:"fee_percentage"`
	FeeCollector      string                               `json:"fee_collector"`
	TokenIn           string                               `json:"token_in,omitempty"`
}

See this for reference: https://github.com/osmosis-labs/affiliate-swap

Jump to

Keyboard shortcuts

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