Documentation for eth_defi.one_delta.price.estimate_sell_received_amount function.

estimate_sell_received_amount(one_delta_deployment, base_token_address, quote_token_address, quantity, target_pair_fee, *, slippage=0, intermediate_token_address=None, intermediate_pair_fee=None, block_identifier=None, verbose=False)[source]

Estimate how much we receive for selling a certain base token amount.

See example in eth_defi.one_delta.price.

  • quantity (decimal.Decimal | int) – How much of the base token we want to sell

  • base_token_address (Union[eth_typing.evm.HexAddress, str]) – Base token address of the trading pair

  • quote_token_address (Union[eth_typing.evm.HexAddress, str]) – Quote token address of the trading pair

  • target_pair_fee (int) – Trading fee of the target pair in raw format

  • slippage (float) – Slippage express in bps. The amount will be estimated for the maximum slippage.

  • block_identifier (Optional[int]) – A specific block to estimate price

  • verbose (bool) – If True, return more debug info

  • one_delta_deployment (eth_defi.one_delta.deployment.OneDeltaDeployment) –

  • intermediate_token_address (Optional[eth_typing.evm.HexAddress]) –

  • intermediate_pair_fee (Optional[int]) –


Expected quote token amount to receive


TokenDetailError – If we have an issue with ERC-20 contracts

Return type

int | tuple[int, int]