Skip to content

@swaps:twapStatus

JSON TWAP status: independent registration, schedule, verified settlement totals, evidence coverage/finality, indexer discovery and current-part submission. Incomplete history reports unknown; expiry never proves fills.

⚗️ Experimental — available at next.evmcrispr.com.

Returns: string

@swaps:twapStatus(order)
NameTypeDescription
orderbytes32Order hash bound by swaps:twap

Using the order hash swaps:twap bound to $order:

print @swaps:twapStatus($order)

The result is a JSON string. See the order hash for how the order is looked up. Amounts and timestamps are decimal strings. Call it outside batches that already contain actions; the controller need not be connected.

FieldMeaning
registeredCurrent on-chain authorization.
scheduleunregistered, scheduled, active, between-windows, or expired.
cancelled, expiredRemoval observed in verified history and elapsed schedule, independently of fills. Cancellation is null without registration history; expiry is null when the start is unknown.
fillednone, partial, complete, or unknown. Complete requires settlement evidence for every distinct part.
filledParts, totalPartsNumber of verified settled parts and number scheduled.
executedSellAmount, executedBuyAmountBase-unit totals from verified settlement events.
evidenceCoverage (complete), reasons for incomplete coverage, observation blockNumber and blockHash.
finalityfinalized, pending, or unknown according to the RPC's finalized block.
discoveryIndexer parent record: observed, not-observed, unavailable, or skipped.
submissionCurrent part index, its order uid and explorer link on CoW Explorer, separate orderbook observation, and reported orderbook status when present.
start, endEffective schedule timestamps, or null when unavailable.
remainingSellBalance, allowanceCurrent execution account funds and CoW relayer allowance; these do not establish fills.

Mining-time starts are recovered from the verified registration transaction and block, even after cancellation clears stored context. Part UIDs use the CoW EIP-712 domain and exact deployed schedule rules. Account, registration lifetime, and UID must all match. Records for another order in a reused Safe are excluded.

The helper uses bounded CoW API lookups as discovery hints, then verifies fills against canonical settlement receipts and Trade events. Paginated chain history is the fallback. Missing history or an exhausted lookup budget produces unknown with the known verified count and reason. It never infers fills from balances, elapsed time, an indexer's Completed label, or a settlement fill counter, which CoW can clear after expiry. API outages do not remove valid on-chain evidence.

Reads are anchored to one block. Receipt block hashes are checked, and a detected reorganization invalidates evidence for that observation. No evidence cache is retained across calls. RPCs without finalized-block support report finality as unknown. Incomplete coverage does not erase individual verified fills.

Indexer discovery and orderbook acceptance are independent observations. not-observed means no matching record was found, not that submission failed. Inside sim:fork external observations are skipped. Outside simulation the helper reads CoW APIs; it never submits an order or starts a monitor.