execute_velora_swap
Documentation for eth_defi.erc_4626.vault_protocol.lagoon.velora.execute_velora_swap function.
- execute_velora_swap(asset_manager, vault, buy_token, sell_token, amount_in, min_amount_out, augustus_calldata, broadcast_callback=<function _default_broadcast_callback>)
Execute a Velora swap through the vault.
This builds and broadcasts the swapAndValidateVelora() transaction and extracts the result from the VeloraSwapExecuted event.
- Parameters
asset_manager (Union[eth_defi.hotwallet.HotWallet, eth_typing.evm.HexAddress]) – Hot wallet or address of the asset manager
vault (eth_defi.erc_4626.vault_protocol.lagoon.vault.LagoonVault) – Lagoon vault instance
buy_token (eth_defi.token.TokenDetails) – Token to receive
sell_token (eth_defi.token.TokenDetails) – Token to sell
amount_in (decimal.Decimal) – Amount of sell_token to swap (human-readable decimals)
min_amount_out (decimal.Decimal) – Minimum amount of buy_token to receive (human-readable decimals)
augustus_calldata (hexbytes.main.HexBytes) – Raw calldata from Velora API to execute on Augustus Swapper
broadcast_callback (Callable[[web3.main.Web3, Any, web3.contract.contract.ContractFunction], hexbytes.main.HexBytes]) – Callback to broadcast the transaction
- Returns
VeloraSwapResult with transaction hash and amounts
- Return type