Values
Values
Scripting · Values

Every plan starts from its givens: an address, a token, a constant, a duration, the state of the chain at this exact block. Getting the givens right is most of correctness, and onchain the givens are unforgiving, because a wrong constant or a stale gas assumption executes exactly as written.

A plug pins those givens once and references them everywhere. The canonical constants of onchain math are available by name rather than typed from memory: the largest integer the EVM holds, the WAD and RAY scales fixed point protocols price in, the basis point denominator, zero and one. An address or a token is declared a single time and flows through every step that needs it. A duration written in human units, minutes or days or weeks or months, resolves to the seconds every contract actually counts in. And the live chain is readable in place: the current block number, the current base fee, the identity of the execution itself.

A plan that only acts while gas is below the ceiling you set, and simply waits otherwise. A step armed at a specific block height. A deadline expressed as three days rather than as a hand computed number that was wrong once and cost real money. There are no magic numbers in a plan built this way, and no magic numbers means no four in the morning discovery of the one that was off by a digit.

  • Expected Amount to Minimum Received

    plug
    math
    values
  • Get Weight Target

    plug
    values
    math
  • Get Price Running Total

    plug
    values
    math
  • Morpho: Get Borrow APR

    plug
    values
    math
  • Rebalance Holdings by Fixed Weights

    values
    evm
    plug
  • Rebalance Holdings to Target

    plug
    values
    evm
  • Swap at Floor

    plug
    evm
    values
  • Morpho: Leverage Manager

    values
    morpho
    evm
  • Swap

    plug
    values
    evm
  • Morpho Pendle Expiry Deleveraging

    pendle
    time
    boolean
  • Aave: Wind or Unwind Position

    plug
    boolean
    aave
  • Wind

    plug
    aave
    evm
  • Unwind

    plug
    aave
    evm

Posts · 5