MBMarket BenderSpecification system
06.01 · Enforcement boundary

One path to every exchange write

Model intenttyped tool arguments
Human commandtyped direct control
Risk kernelpure policy verdict
Execution boundaryauth · idempotency · deadline
Signer + venuesubmit · reconcile

Read-only exchange queries do not require a trading verdict; any write, including cancel/close/flatten, requires an authenticated typed request and the policy appropriate to its risk-reducing semantics.

06.02 · Rule catalogue

Enforcement and tests are part of every rule

RuleRequired behaviorEnforcementRequired tests
Allowed assetsReject instruments absent from network/environment allowlist and current metadataRisk kernel before signingUnknown, delisted, wrong-network and stale-metadata cases
Maximum leverageReject or clamp above environment/instrument cap; agent cannot change policyRisk kernel plus exchange-account configuration checkBoundary, asset cap and malicious update-leverage cases
Maximum notionalCompute projected gross/net exposure including open ordersRisk kernel from reconciled portfolioPending-order, fill-race and decimal boundary cases
Per-position limitClamp or reject projected instrument exposureRisk kernelLong/short/increase/reduce and crossed-zero cases
Portfolio limitReject aggregate exposure or concentration breachRisk kernelCorrelated positions, multiple HIP-3 DEXs, open orders
Price protectionReject price outside fresh reference band or invalid tick/lot precisionRisk kernel plus adapter normalizationStale reference, extreme price, tick rounding
Slippage protectionBound IOC/marketable limit price against approved referenceFlatten/order planner and risk kernelGap, empty book, fallback reference
Order cadenceRate-limit risk-increasing decisions and batch safelySession/match sequencer before riskBurst, concurrent subagent and retry cases
Duplicate intentReturn recorded verdict/result for stable idempotency keyIntent and execution repositoriesConcurrent duplicates and unknown result reconciliation
DeadlineReject risk increase at/after persisted lock timestampMatch DO guard and risk kernelClock skew, delayed alarm, race at exact millisecond
Reduce onlyClose/flatten plans cannot increase or reverse exposurePlanner, risk kernel, exchange flagPartial fill, zero/crossed position, stale size
Match stateOnly Live allows configured risk; Locked onward permits cancel/reduce onlyMatch revision guard and risk kernelEvery state/action matrix and stale revision
Emergency pauseDisable new signing except authenticated cancel/reduce recoveryGlobal/account/match kill-switch checked at executionActivation race, scope and recovery authorization
Exit AllCancel opens, snapshot positions, submit bounded reduce-only actions, verify zero/open-order terminal stateDeterministic flatten coordinatorPartial fills, cancel failures, outage and repeated invocation
Post-action reconciliationDo not trust submission response as final stateExecution coordinator/reconcilerUnknown response, missed fill and out-of-order stream
Failure escalationMove to paused/recovery/manual-review based on explicit thresholdsOrchestrator and Match DORepeated signing/exchange/flatten/settlement failures
06.03 · Verdict contract

Accept, clamp or reject—with stable reasons

The pure evaluator consumes a versioned policy, fresh market frame, reconciled portfolio, match/session state and TradeIntent. It emits a RiskVerdict with policy version, reason codes and—only for accept/clamp—an exact approved order. The signer verifies the verdict/request binding; it never accepts a caller-supplied “approved” flag.

06.04 · Emergency controls

Pause contains; Exit All verifies

  1. Activate a global/account/match pause checked at the execution boundary.
  2. Cancel open orders with stable idempotency keys.
  3. Fetch fresh positions and plan reduce-only actions against current sizes.
  4. Submit bounded marketable limits/IOC according to slippage policy.
  5. Reconcile orders and positions until zero/no-open-order is verified or enter flatten_failed with operator escalation.
06.05 · Verification standard

Table-driven plus property-oriented

Test decimal boundaries, projected exposure with open orders, concurrent duplicates, exact deadline races, stale revisions, partial fills, crossed-zero positions and human/model parity. Property tests assert that reduce-only plans never increase absolute exposure, rejected intents never reach signing and repeating an idempotency key never creates another exchange request.

Navigate specification

Search pages and sections