Swap at Floor
0x581BEf12967f06f2eBfcabb7504fA61f0326CD9A

What this does

This plug routes a token swap by transferring sellToken to the solver and requiring the buyToken balance to increase by at least a caller-set floor. It asks the caller for account, sellAmount, sellToken, buyToken, and minReceive. It runs on demand and settles only when the post-routing buyToken balance is greater than or equal to the pre-routing balance plus minReceive, reverting otherwise. Setting minReceive by hand or against a stale price risks reverting or accepting a worse output than the market allows.

Actions · 11

  • Get token balance
    Get balance of held by
    Reads a token balance held by an address, native or ERC-20.
  • Get address
    Get
    Holds an address as a named value that later steps reference.
  • Transfer tokens
    Transfer to
    Sends a token from the socket to another address, native or ERC-20.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Get solution
    Get solution
    Hands tokens already transferred to the solver over for routing, then verifies the outcome.
  • Get token balance
    Get balance of held by
    Reads a token balance held by an address, native or ERC-20.
  • Compare two values
    Is
    Compares two values with a chosen operator and returns a boolean.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • End block
    End block
    Closes the innermost open block, whether a conditional branch or a loop.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.

Related plugs · 8