Skip to content

Warn when an order is below the program's minContracts - #19

Merged
piekstra merged 1 commit into
mainfrom
fix/warn-below-min-contracts
Aug 6, 2026
Merged

Warn when an order is below the program's minContracts#19
piekstra merged 1 commit into
mainfrom
fix/warn-below-min-contracts

Conversation

@piekstra

@piekstra piekstra commented Aug 6, 2026

Copy link
Copy Markdown
Owner

The gap

An order smaller than the program's minContracts rests happily, qualifies its
side
, and scores nothing. Nothing in the output said so.

It's near-invisible after the fact: the reward share simply fails to move. Worse,
because the order book aggregates same-price levels, the sub-minimum tokens end up
counted toward the competing score instead — so the mistake both earns nothing
and dilutes the orders that do earn.

Why an advisory and not a rail

A sub-minimum order is frequently correct. A 1-token ask is the cheapest possible
way to hold a side open for two-sided eligibility — the standard shape for parked
recovery inventory. Refusing it would break a pattern that is deliberately used.

Intent can't be inferred here, so this states the consequence and lets the operator
judge, rather than demanding an override flag for something that is often right.

Behaviour

  • prints before the confirmation prompt, so --force runs see it too
  • folded into the prompt text for interactive runs
  • silent for properties running no reward program
  • never blocks an order if the program lookup fails
⚠ 3 token(s) is below this property's minContracts (4). The order will QUALIFY
  its side for two-sided eligibility but score NOTHING toward LP rewards.
  Use at least 4 to earn on it.

Tests

Pure rule split into min_contracts_note_from so it's testable without a client:

  • sub-minimum order is flagged (qualifies / scores nothing)
  • at or above the bar is silent, and thresholds are per-property
  • unknown property, empty payload, and malformed payload all stay silent

Follows the same shape as the market-price and slippage rails: check before the
mutation, say plainly what the consequence is.

An order smaller than minContracts still rests, still qualifies its side, and
scores nothing. Nothing in the output said so, and the shortfall is invisible
afterwards: the reward share simply fails to move, and because the order book
aggregates same-price levels, the sub-minimum tokens get counted toward the
competing score instead — so the mistake both earns nothing and dilutes the
orders that do earn.

This is deliberately an advisory, not a rail. A sub-minimum order is often
exactly right: a 1-token ask is the cheapest way to hold a side open for
two-sided eligibility, which is the standard shape for parked recovery
inventory. Refusing it would break that. Intent is unknowable from here, so
state the consequence and let the operator judge.

Printed before the confirmation prompt so --force runs see it too, and folded
into the prompt text for interactive ones. Never blocks on a failed lookup,
and stays silent for properties running no reward program.
@piekstra
piekstra merged commit 951649d into main Aug 6, 2026
1 of 2 checks passed
@piekstra
piekstra deleted the fix/warn-below-min-contracts branch August 6, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant