This plug reads the token and weight stored at a given index in the socket's tokens and weights maps, fetches the token's Chainlink USD price, and composes Get Target Balance to compute the token's target. It asks the caller for the index to resolve and a total_value figure. It runs whenever it is called or composed by another plug during a rebalance. Resolving these values by hand or against a stale Chainlink price yields a target balance that no longer matches the token's current market value.
Actions · 8
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.
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.
Getpriceofin
Reads the latest Chainlink price of a base asset in a quote asset, normalized to 18 decimals.
Usewhere
weightis
total_valueis
priceis
Composes another plug inside this one.
Bubble
Surfaces a value as an output of this plug.
Bubble
Surfaces a value as an output of this plug.
Related plugs · 8
Not ready to run as it stands: it waits on values or a position of your own.