Warn when an order is below the program's minContracts - #19
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
An order smaller than the program's
minContractsrests happily, qualifies itsside, 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
--forceruns see it tooTests
Pure rule split into
min_contracts_note_fromso it's testable without a client:Follows the same shape as the market-price and slippage rails: check before the
mutation, say plainly what the consequence is.