analyse_leverage_trade_by_receipt#
API documentation for tradeexecutor.ethereum.one_delta.analysis.analyse_leverage_trade_by_receipt Python function.
- analyse_leverage_trade_by_receipt(web3, one_delta, uniswap, aave, tx, tx_hash, tx_receipt, input_args=None, trade_operation=TradeOperation.OPEN)[source]#
Analyse a 1delta margin trade.
Figure out
The success of the trade
Output amount
- Parameters:
tx_receipt (dict) – Transaction receipt
input_args (tuple | None) –
The swap input arguments.
If not given automatically decode from tx. You need to pass this for Enzyme transactions, because transaction payload is too complex to decode.
web3 (Web3) –
one_delta (OneDeltaDeployment) –
uniswap (UniswapV3Deployment) –
aave (AaveV3Deployment) –
tx (dict) –
trade_operation (TradeOperation) –
- Returns:
Tuple of trade result and collateral amount which get supplied or withdrawn to Aave reserve Negative for withdraw, positive for supply
- Return type:
tuple[eth_defi.trade.TradeSuccess | eth_defi.trade.TradeFail, int | None]