[blue fallback rolling] add minRemainingDebt config param - #1173
[blue fallback rolling] add minRemainingDebt config param#1173claude[bot] wants to merge 1 commit into
Conversation
A partial roll must now leave at least `minRemainingDebt` of debt on Midnight. A full close-out is exempt, as for `minRollableAssets`, so a position can always be fully exited. The parameter is part of the config hash, so existing configs are unaffected.
| require(assets >= minRollableAssets || assets == debtAssets, RolledAssetsTooLow()); | ||
| require(assets == debtAssets || debtAssets - assets >= minRemainingDebt, RemainingDebtTooLow()); |
There was a problem hiding this comment.
should we merge both require ?
There was a problem hiding this comment.
Both work — the difference is whether the two failures keep distinct errors.
Merged into one:
require(
assets == debtAssets || (assets >= minRollableAssets && debtAssets - assets >= minRemainingDebt),
RolledAssetsTooLow()
);Or factored, keeping the errors apart:
if (assets != debtAssets) {
require(assets >= minRollableAssets, RolledAssetsTooLow());
require(debtAssets - assets >= minRemainingDebt, RemainingDebtTooLow());
}I'd keep them apart: in the merged form RolledAssetsTooLow also fires when assets is too high, which reads wrong. Happy to push either — say which.
Generated by Claude Code
There was a problem hiding this comment.
Maybe more consistent to put || assets == debtAssets second in both cases if we don't do the if factoring?
|
There is no fix to port: the job log is not retrievable outside the browser, and this matches the known nondeterministic Healthiness failure rather than a counterexample. I'll re-run this one job once the rest of the run finishes, and leave Generated by Claude Code |
Requested by peyha · Slack thread
Adds a
minRemainingDebtconfig parameter: a partial roll must leave at least that much debt on Midnight. A full close-out is exempt, as forminRollableAssets.Generated by Claude Code