This plug winds or unwinds a leveraged Aave position in one transaction, choosing the path by a caller flag. It asks for supply_amount, supply_token, aave_market, borrow_amount, borrow_token, and is_winding. When is_winding is true it flash-borrows supply_token, supplies it, and borrows borrow_token; otherwise it flash-borrows borrow_token, withdraws supply_token, and routes through the solver. Each path reverts unless routed proceeds cover the flash loan owed. Building this by hand risks an under-covered flash loan reverting the whole transaction.
Actions · 30
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Flashloanfrom
Borrows an asset from an Aave market with no collateral, repaid inside this transaction.
Setto
Assigns a value to a named variable that later steps reference.
Supplyto
Supplies an asset to an Aave market, minting aTokens to the wallet.
Borrowfrom
Borrows an asset from an Aave market against collateral you have supplied.
Get
Holds an address as a named value that later steps reference.
Getbalanceofheldby
Reads a token balance held by an address, native or ERC-20.
Transferto
Sends a token from the socket to another address, native or ERC-20.
Getsolution
Hands tokens already transferred to the solver over for routing, then verifies the outcome.
Getbalanceofheldby
Reads a token balance held by an address, native or ERC-20.
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Is
Compares two values with a chosen operator and returns a boolean.
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Else
Opens the else branch of a conditional.
Flashloanfrom
Borrows an asset from an Aave market with no collateral, repaid inside this transaction.
Setto
Assigns a value to a named variable that later steps reference.
Withdrawfrom
Withdraws a supplied asset from an Aave market back to the socket.
Get
Holds an address as a named value that later steps reference.
Getbalanceofheldby
Reads a token balance held by an address, native or ERC-20.
Transferto
Sends a token from the socket to another address, native or ERC-20.
Getsolution
Hands tokens already transferred to the solver over for routing, then verifies the outcome.
Getbalanceofheldby
Reads a token balance held by an address, native or ERC-20.
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Is
Compares two values with a chosen operator and returns a boolean.
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Related plugs · 8
Not ready to run as it stands: it waits on values or a position of your own.