End block

End block on Logic

Ethereum
Ethereum
Base
Base

Acts onchain

Ready to run on Base

Closes the innermost open block, whether a conditional branch or a loop. Every if, if not, else if, else, for, until, and while needs a matching End; for loops, reaching End returns to the loop start for the next condition check. Reach for it to mark where a branch or loop body stops and unconditional execution resumes, so the steps after it run on every path.

Plug lets you combine onchain actions like this one into a single transaction, without writing a smart contract. Use in App opens a new plug with this action already in it.

Takes nothing — it reads the caller's own position.

Daily 20 USDC Into ETH Under 1600 on Chainlink

time
chainlink
boolean
7actions
  1. 1·Repeat

    Capping cadence, this rate limit permits at most one run every day, so the schedule advances no more than once in that interval.

  2. 2·Get price

    Reading Chainlink, this pulls the latest ETH price quoted in USD, normalized to 18 decimals.

  3. 3·Predicate

    Comparing that price against 1600 with a less than operator, this proceeds only when ETH trades below that figure.

  4. 4·Multiply then divide

    Calculating 20 times 1 divided by the ETH price and rounding down, this derives how much ETH 20 USDC buys at the quoted rate.

  5. 5·Multiply then divide

    Taking 99 percent of that derived amount and rounding down, this sets a figure one percent below it to serve as a minimum.

  6. 6·Swap tokens

    On each run, 20 USDC is swapped for at least that discounted amount in ETH through the solver.

  7. 7·End block

    Closing the innermost open block, this ends the conditional branch.

Repeat up to x every
Get price of in
Calculate times divided by rounded
Calculate times divided by rounded
Swap for at least
End block

More plugs on Base

Dollar-cost average on Base · 4 plugs

Posts · 18

More on Logic · 4