
Logic · Acts onchain
Opens the else branch of a conditional. The steps after it, up to the matching End block, run only when the preceding if, if not, or else if did not take its branch. Reach for it to give a decision two paths, such as supplying to market A when its rate wins and to market B otherwise, so exactly one path executes per run.
Takes nothing — it reads the caller's own position.
Find Value Delta



1·Take
The caller supplies value_1 at execution time, declared here as a named parameter for later steps to reference.
2·Take
A second parameter named value_2 is declared, also filled in by the caller when the plug runs.
3·Compare two values
Comparing value_1 against value_2, this step returns true when value_1 is greater than value_2.
4·Set
Assigning that comparison result to a named variable called value_1_is_greater lets later steps read it by name.
5·Set
Setting value_delta to 0 gives the difference variable a starting value before either branch overwrites it.
6·Predicate
Requiring value_1_is_greater to equal true opens a branch that runs only when value_1 exceeded value_2.
7·Calculate
Within that branch, value_2 is subtracted from value_1, producing the positive difference.
8·Set
Storing that difference into value_delta records the gap for the case where value_1 was larger.
9·Else branch
Opening the else branch handles the case where value_1 was not greater than value_2.
10·Calculate
Here value_1 is subtracted from value_2, producing the difference in the other direction.
11·Set
Writing that difference into the variable delta records the gap for this branch.
12·End block
Closing the innermost open block ends the conditional.
13·Bubble
Surfacing value_1_is_greater exposes which value was larger as an output.
14·Bubble
Also surfaced is value_delta, exposing the computed difference as an output of this plug.