Rebalance Holdings to Target
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug rebalances holder_wallet by transferring each token in the socket's registered token set to the solver for routing, then requiring every post-routing balance to meet its configured target. It asks the caller for holder_wallet and count, the number of tokens to iterate over. It fires on execution, looping once per registered token to route and again to verify each target is met. Running it by hand or against a stale token set risks routing balances that fail the target checks, reverting the transaction.

Actions · 21

  • Use
    Use where
    holder_walletis
    countis
    Composes another plug inside this one.
  • Get address
    Get
    Holds an address as a named value that later steps reference.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • Read map value
    Read map value of in in
    Reads a value from a keyed map in the socket's persistent storage.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Get token balance
    Get balance of held by
    Reads a token balance held by an address, native or ERC-20.
  • 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.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • End block
    End block
    Closes the innermost open block, whether a conditional branch or a loop.
  • Get solution
    Get solution
    Hands tokens already transferred to the solver over for routing, then verifies the outcome.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • Use
    Use where
    indexis
    total_valueis
    Composes another plug inside this one.
  • Get token balance
    Get balance of held by
    Reads a token balance held by an address, native or ERC-20.
  • Predicate
    Steers control flow by comparing two values: branch, loop, or require the condition holds.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • End block
    End block
    Closes the innermost open block, whether a conditional branch or a loop.
  • End block
    End block
    Closes the innermost open block, whether a conditional branch or a loop.

Related plugs · 8