TradeSuccess

Documentation for eth_defi.uniswap_v2.analysis.TradeSuccess class.

class TradeSuccess[source]

Describe the result of a successful Uniswap swap.

Attributes summary

path

Routing path that was used for this trade

amount_in

amount_out_min

amount_out

price

Overall price paid as in token (first in the path) to out token (last in the path).

amount_in_decimals

amount_out_decimals

Methods summary

__init__(gas_used, effective_gas_price, ...)

get_effective_gas_price_gwei()

path: List[HexAddress]

Routing path that was used for this trade

price: decimal.Decimal

Overall price paid as in token (first in the path) to out token (last in the path). Price includes any fees paid during the order routing path. Note that you get inverse price, if you route ETH-USD or USD-ETH e.g. are you doing buy or sell.

__init__(gas_used, effective_gas_price, path, amount_in, amount_out_min, amount_out, price, amount_in_decimals, amount_out_decimals)
Parameters
  • gas_used (int) –

  • effective_gas_price (int) –

  • path (List[HexAddress]) –

  • amount_in (int) –

  • amount_out_min (int) –

  • amount_out (int) –

  • price (decimal.Decimal) –

  • amount_in_decimals (int) –

  • amount_out_decimals (int) –

Return type

None