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.

  • Card: Buy $50 WBTC With USDC Once a Week

    time
    values
    math
  • Card: Buy an 18 Dec Token With X% of USDC

    plug
    evm
    math
  • Card: Sell X% of an 18 Dec Token for USDC

    plug
    evm
    math
  • Card: Sell 18 Dec Token for USDC

    plug
    chainlink
    math
  • Card: Sell 8 Dec Token for USDC

    plug
    chainlink
    math
  • Card: Buy 8 Dec Token With USDC

    plug
    chainlink
    values
  • Card: Buy 18 Dec Token With USDC

    plug
    chainlink
    values
  • Card: Sell 10% of ETH for USDC

    evm
    math
    chainlink
  • Card: Buy ETH With 10% of USDC

    evm
    math
    chainlink
  • Card: Sell $25 ETH for USDC

    values
    math
    chainlink
  • Card: Buy $25 ETH With USDC

    values
    math
    chainlink
  • Expected Amount to Minimum Received

    plug
    math
    values
  • Get Weight Target

    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
  • Exit Morpho at Epoch End

    pendle
    time
    boolean
  • Aave: Wind or Unwind Position

    plug
    boolean
    aave
  • Wind

    plug
    aave
    evm
  • Unwind

    plug
    aave
    evm
  • Get Price Running Total

    plug
    values
    math
  • Morpho: Get Borrow APR

    plug
    values
    math

Posts · 4