INNER CODE UNIT · Shell

is_all

okx/agent-skills · skills/earn-hunter/scripts/scan.sh:546

  def is_all($v): ($v=="all") or ($v|type=="array" and length==0);
  [ .[]
    | select(.soldOut != true)
    | select((.lendQuota // "") as $lq | ($lq|tostring) != "" and ($lq|tonumber? // 0) > 0)
    | select( is_all($currencies) or (($currencies|type=="array") and (.ccy as $c | $currencies | index($c))) )
    | . as $o
    | ( ($overrides[$o.ccy].minApy) // $gmin ) as $thr
    | select( ((.rate // "0")|tonumber? // 0) >= $thr )
    | select( is_all($terms) or (($terms|type=="array") and (.term as $tm | $terms | index($tm))) )
  ]
' 2>/dev/null)
[[ -z "$FIXED_FILTERED" ]] && FIXED_FILTERED="[]"

# Flexible filter: rate >= threshold (two-layer: override > global).
FLEX_FILTERED=$(echo "$FLEX_RAW" | jq -c \
  --argjson gmin "$( [[ "$FLEX_MIN_APY" =~ ^-?[0-9.]+$ ]] && echo "$FLEX_MIN_APY" || echo 0.08 )" \
  --argjson overrides "$FLEX_CCY_OVERRIDES" '
  [ .[]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…