This plug routes holder_wallet's holdings across a registered token set toward each token's target through the solver. It asks the caller for holder_wallet, the address being rebalanced, and count, the number of registered tokens to iterate. It fires on demand, looping count times to transfer each token to the solver, then looping again to require every post-routing balance clears its target. Running this by hand or against stale targets risks transfers that leave holdings short of their goals and revert only after the routing hand-off.
Actions · 21
Usewhere
holder_walletis
countis
Composes another plug inside this one.
Get
Holds an address as a named value that later steps reference.
Setto
Assigns a value to a named variable that later steps reference.
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Readmapvalueofinin
Reads a value from a keyed map in the socket's persistent storage.
Setto
Assigns a value to a named variable 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.
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Setto
Assigns a value to a named variable that later steps reference.
Endblock
Closes the innermost open block, whether a conditional branch or a loop.
Getsolution
Hands tokens already transferred to the solver over for routing, then verifies the outcome.
Setto
Assigns a value to a named variable that later steps reference.
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Usewhere
indexis
total_valueis
Composes another plug inside this one.
Getbalanceofheldby
Reads a token balance held by an address, native or ERC-20.
Steers control flow by comparing two values: branch, loop, or require the condition holds.
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Setto
Assigns a value to a named variable that later steps reference.
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.