
Aave · Acts onchain
Borrows an asset from an Aave market with no collateral, repaid inside this transaction. The action opens a block: the steps inside it spend the borrowed funds, and before the block ends the socket must hold the principal plus Aave's flash premium, surfaced as the owed output, or the whole transaction reverts. Approval for the repayment is handled here. Reach for it to refinance debt between markets without capital, to unwind a leveraged position by repaying before withdrawing collateral, or to fund an arbitrage across venues. Coil owed into a comparison so a predicate requires the balance covers it before the block closes.
Wind



1·Take
Declares supply_amount as a caller-supplied parameter, the quantity to be supplied.
2·Take
Declares supply_token as a caller-supplied parameter, naming the asset to supply.
3·Take
Names aave_market as a caller-supplied parameter identifying the market used throughout.
4·Take
Adds borrow_amount as a caller-supplied parameter, the quantity to borrow.
5·Take
Rounds out the inputs with borrow_token as a caller-supplied parameter, the asset to borrow.
6·Flash loan
Takes a flash loan of [supply_amount] in [supply_token] from [aave_market], to be repaid within this same transaction.
7·Set
Saves the flash loan repayment obligation from slot 5.5 into wind_loan_owed for a later check.
8·Supply
Supplies [supply_amount] of [supply_token] into [aave_market], minting aTokens to the socket as collateral.
9·Borrow
Borrows [borrow_amount] of [borrow_token] from [aave_market] against the collateral just supplied.
10·Get address
Loads the solver address into a named value for use as a transfer destination.
11·Get token balance
Reads the [supply_token] balance held by 0x4844...3a88 before routing.
12·Transfer tokens
Sends [borrow_amount] of [borrow_token] to [the solver] to be routed.
13·Get solution
Hands the transferred tokens to the solver for routing, then verifies the outcome.
14·Get token balance
Reads the [supply_token] balance held by 0x4844...3a88 again after routing.
15·Calculate
Subtracts the pre-routing balance in slot 10.1 from the post-routing balance in slot 13.1 to measure how much [supply_token] was gained.
16·Compare two values
Checks whether that gain is greater than or equal to wind_loan_owed.
17·Predicate
Requires that comparison to hold true, aborting the transaction if the gain does not cover the loan owed.
18·End block
Closes the innermost open block.
19·End block
Closes the remaining open block.
On other protocols · 2