feat(bots): add monitored market making and offer invalidation - #114
feat(bots): add monitored market making and offer invalidation#114julien-devatom wants to merge 10 commits into
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43a33a7e3f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3abf2e35eb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
This exported helper is part of the script's TypeScript surface (the tests import it), but it has no substantive JSDoc and the checker does not include scripts/check-jsdoc.ts in its own enforced inventory. That lets the new documentation gate pass while one of its own exported APIs violates the repository’s public-surface documentation rule; add JSDoc for this helper and include the script in the inventory.
AGENTS.md reference: AGENTS.md:L32-L36
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
When an operator uses ladder --readonly or its monitor as a preflight, this adapter logs every reconcile request without invoking the production tree builder, spread guard, or unsigned Mempool validation. Live publication still performs those checks, so cases such as a market that matures after the initial setup gate or an SDK/Mempool policy rejection are reported as logged in dry-run but halt in write mode; add a validation seam like bootstrap read-only uses before emitting the readonly.make record.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c042128a0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| this.safeObserver(parameters.onTransactionSubmitted) | ||
| ) | ||
| if (txHash) submittedTransactions.push({ operation: 'cancel', txHash }) | ||
| await this.transport.forgetGroups?.([groupId]) |
There was a problem hiding this comment.
Don't retry a confirmed bootstrap cancel
When the local ownership write fails here after invalidate() has already returned a confirmed cancel during a normal replace/target-reached/no-capacity reconciliation, this shared catch treats the cleanup failure as an invalidation failure. The application can then hard-halt with the unchanged ownership file and submit another cancel for the same already-consumed group, while the failure report also loses the confirmed tx hash; record the cancellation before attempting forgetGroups and report ownership cleanup separately.
Useful? React with 👍 / 👎.
| this.safeObserver(parameters.onTransactionSubmitted) | ||
| ) | ||
| if (txHash) submittedTransactions.push({ operation: 'cancel', txHash }) | ||
| await this.transport.forgetGroups([groupId]) |
There was a problem hiding this comment.
Don't retry confirmed ladder cancels
When invalidate() has already confirmed a ladder replacement cancellation but this ownership cleanup write fails, the catch below reports the whole reconciliation as failed and leaves the canceled group in durable ownership. The next cycle or cleanup can then submit another cancel for the already-consumed group, and the structured result loses the confirmed cancellation hash; record the confirmed cancel before forgetGroups and surface ownership cleanup as its own failure.
Useful? React with 👍 / 👎.
Summary
invalidate [group-id]: invalidate every active maker group by default or one explicit group, with exact transaction policy checks, receipt confirmation, partial-failure reporting, durable cleanup, and read-only previewBOOTSTRAP_MARKETSandLADDER_MARKETSfield, including units, defaults, constraints, and ladder-side semanticsOperator commands
Add
--readonlyto bootstrap, ladder, or invalidate to inspect and validate the intended action without signing or broadcasting.Verification
24.14.1and pinned Bun1.3.12bun install --frozen-lockfilebun run --filter @morpho-org/market-making-bot typecheckbun lint— 0 warnings, 0 errors across 332 filesbun formatbun knipbun run --filter @morpho-org/market-making-bot jsdoc:build— 320 declarations, including the checker and ladder signature utilitybun test --dots— 1,309 passed, 3 skipped, 0 failed, 7,304 assertions across 121 files