> For the complete documentation index, see [llms.txt](https://nytshift.gitbook.io/nytshift-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nytshift.gitbook.io/nytshift-docs/hyperliquid/hyperliquid-order-lifecycle.md).

# Order lifecycle reconciliation

Use this runbook after any protected Hyperliquid submission or cancellation whose final state is not visible, after a signer restart, or when the terminal says `RESULT UNKNOWN` or `RECONCILIATION UNAVAILABLE`.

## Safety rule

Do not resubmit or repeat a cancellation because an acknowledgement, timeout, network error or stale UI is ambiguous. Keep the same CLOID. Reconciliation is read-only at the venue and writes only normalized evidence to the local signer store.

## Reconcile

1. Keep the signer and web runtime on loopback and confirm signer health reports execution-store schema 8, current `true`, integrity `ok` and journal `wal`.
2. Unlock the operator session and use `RECONCILE CLOID` in the exact order or cancellation review dialog.
3. Read the normalized state, venue state, exact filled/original/remaining quantity, retained fills, venue fees and NIGHTSHIFT fee evidence.
4. Treat only `FILLED`, `CANCELED` or `REJECTED` as terminal. `OPEN`, `PARTIALLY FILLED`, `PENDING` and `TRIGGERED` require later reconciliation; `UNAVAILABLE` proves nothing.

The BFF calls only `POST /v2/orders/{cloid}/reconcile`. Raw account-wide fills never cross the signer boundary. The legacy revenue-only operation remains additive compatibility, not the terminal path.

## Failure meanings

* `404`: the signer has no retained fee-bound scope for that CLOID. Preserve the submission/audit evidence and do not adopt an unrelated order.
* `403`: the requested account differs from signer or retained scope. Correct the inspected account; never weaken scope checks.
* `502`: venue evidence is unavailable, malformed, undocumented, older than retained state or conflicts with an existing OID/trade. Keep the prior durable state and retry reconciliation later; do not retry the capital-moving action.
* `bounded-partial`: the documented recent-fill window or page-progress cap prevented a complete current traversal. The observed order state remains useful, but fee/revenue history is not complete.

If store health is unsafe, stop the signer and follow [Arcus execution store recovery](/nytshift-docs/arcus/arcus-execution-store-recovery.md). The same database contains both venues' execution evidence and must not be hand-edited.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nytshift.gitbook.io/nytshift-docs/hyperliquid/hyperliquid-order-lifecycle.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
