> 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/release-and-readiness/paper-trading-readiness-validation.md).

# PAPER trading readiness validation

Use this gate before enabling any Hyperliquid testnet execution path. PAPER consumes public live-book evidence but has `executionCapability: none`; it must never send, sign, cancel, fund or otherwise mutate a venue account.

## Repeatable gate

Run:

```powershell
pnpm test:paper-readiness
pnpm --filter @terminal/web typecheck
pnpm --filter @terminal/web build
pnpm smoke:web
```

The dedicated lifecycle test composes entry, fill, GTC placement and cancellation, stop-loss, take-profit, position/PnL, exact replay, strict serialization, capital rejection and corrupted-state recovery in one deterministic scenario. The surrounding PAPER suite proves partial fills, live-book freshness, cross-market monitoring, reduce-only constraints, risk locks, mark coverage, optimistic database revisions and fail-closed storage behavior.

## Current browser evidence

### Verified local candidate renewal — 2026-07-26

The current candidate was rebuilt and checked locally without deploying it or changing any execution authority. Hyperliquid and Arcus execution remained disabled, both mainnet flags remained false, and no wallet, signer, fund or venue mutation was used.

* `pnpm preflight` passed with execution routes session-locked and production provider/alert prerequisites reported as warnings rather than silently enabled.
* `pnpm contracts:check`, root `pnpm typecheck`, `pnpm build`, `pnpm smoke:web` and `pnpm handoff:check` passed.
* The full suite passed 1,132 tests across 189 files. The two PostgreSQL tests that require an explicitly configured integration database remained intentionally skipped.
* The dedicated PAPER gate passed 127 tests across 13 files.
* A Playwright acceptance pass against the rebuilt loopback production server verified the landing-to-terminal Markets, Signal Intelligence and RHC Radar routes, in-shell terminal navigation, live/read-only source labels, and first-run guide behavior.
* At 1280 × 720 and 390 × 844, the document width matched the viewport with no page-level horizontal overflow and no application console errors.
* Closing the manually opened guide with Escape returned focus to the Guide button. With reduced motion emulated, no document animation remained running.

This is candidate evidence only. The current production release remains a separate deployment and must not be described as containing these changes until the normal verified release workflow completes.

Validated on 2026-07-23 against the local production build at `http://127.0.0.1:3000/terminal`, using Hyperliquid public mainnet market data and a guest browser-local PAPER account. Execution, signer and mainnet mutation remained disabled.

| Requirement                      | Current-worktree evidence                                                                                                                                                                                   |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Account setup                    | Created a $10,000 balanced PAPER account; UI showed `NO VENUE ORDER` and `EXECUTION CAPABILITY: NONE`.                                                                                                      |
| Market placement and fill        | Opened a $100 BTC long from fresh visible Hyperliquid depth; the tape retained exact quantity, average price, visible notional, spread and slippage.                                                        |
| Position and unrealized PnL      | The terminal showed the exact long quantity, entry price and fresh venue-mark PnL.                                                                                                                          |
| Stop-loss                        | Armed a valid long stop. A trigger mark initially arrived ahead of a usable book and correctly displayed `LIVE BOOK PRECEDES PROTECTION TRIGGER MARK`; the next fresh book completed the reduce-only close. |
| Take-profit                      | Opened a second long, armed a valid take-profit and completed the reduce-only close after a fresh trigger mark and current book.                                                                            |
| Trigger audit identity           | After the correction in this validation run, new tape rows rendered distinct `STOP LOSS` and `TAKE PROFIT` labels; legacy rows remained `AUTO PROTECTION`.                                                  |
| Realized account state           | Both protection closes returned BTC to flat and updated realized account equity.                                                                                                                            |
| Resting order and cancellation   | Placed a non-crossing local BTC buy GTC at $60,000, reserved $99.9996, canceled it, retained `CANCELED · STANDARD`, cleared the reserve to $0 and explicitly showed that no venue cancel was sent.          |
| Persistence and restart recovery | Reloaded the production page, re-entered PAPER and recovered exact equity, flat position, canceled GTC lifecycle and protection tape.                                                                       |
| Error handling                   | A $3,000 entry against the $2,500 per-market cap changed the action to a disabled `Lower size — $2500 market cap` control and wrote no trade.                                                               |
| Authenticated durability         | PostgreSQL integration tests cover strict customer ownership, optimistic revision conflicts, archived resets, exact replay and database reconstruction. Guest mode remains intentionally browser-local.     |

### Authenticated production evidence

Validated on 2026-07-23 in the owner’s existing Privy-authenticated Chrome session at `https://nytshift.xyz/terminal` after promoting verified release `318a05e89bc37852682fac554f76b4d83bfc413f`:

* the server-verified customer profile attached a short-lived Privy bearer token to every private PAPER request without storing identity proof in local storage;
* the existing $100 BTC long was imported with `OFFLINE PAPER HISTORY RECOVERED TO DATABASE`, and a full page reload recovered the exact `0.00153974 BTC` long without a `LOCAL ONLY` fallback;
* an already-triggered long take-profit at $65,000 was rejected before arming; a valid $64,000 stop / $66,000 take-profit plan armed, survived a reload with its exact levels and was canceled explicitly;
* a non-crossing local BTC GTC at $60,000 reserved $9.9996, survived a reload, canceled locally, returned its reserve to zero and sent no venue cancel;
* an exact reduce-only sell closed `0.00153974 BTC` at $65,007, returned the account to flat and advanced realized equity from $1,000 to $1,000.09392414;
* another reload retained both exact BUY and SELL tape rows, flat position and database sync before the two-step reset archived the PAPER session;
* the final reload showed `Start with a paper balance` and `SIGNED-IN DATABASE READY`; server aggregates showed one retained archived PAPER session and zero active sessions;
* the production build-trust control showed `BUILD VERIFIED · 318a05e`, while Hyperliquid and Arcus execution remained disabled and both mainnet flags remained false.

The five-step first-run guide, permanent guide/changelog controls, canonical NIGHTSHIFT sigil, 390 × 844 mobile containment and reduced-motion CSS contract were also checked on the exact public release. The full web suite passed 1,096 tests across 181 files, the dedicated PAPER gate passed 126 tests across 13 files, typecheck passed, and the reproducible Linux artifact passed independent verification before and after transfer.

## Current PostgreSQL evidence

Validated on 2026-07-23 against the private loopback PostgreSQL 16.14 service on the approved Hetzner NightShift host:

* all three exact migrations applied and checksum verification returned `Database verified (3 migrations)`;
* the runtime role saw 25 tables and three views over SSL, while a direct DDL attempt was rejected;
* the PAPER profile/order/fill/position/PnL/risk/reset integration test passed against the remote database in 35.78 seconds;
* the verified Hyperliquid testnet projection test passed in 41.65 seconds, including account binding, exact replay, partial coverage, fills, fees, builder fees, PnL, positions and funding;
* an encrypted custom-format backup restored into an isolated database with an identical complete data-only dump, three migrations, 25 tables, three views, zero unvalidated foreign keys, zero invalid indexes, three orders, three fills, one active session, maximum session revision four and no snapshot-ahead revision;
* the raw test wallet, CLOID, transaction hash and provider funding ID were absent from the restored data;
* the production backup service completed successfully and its daily timer is enabled with bounded local retention.

The isolated test and restore databases, test login and test secret were removed after verification. The production database, migration/runtime roles and encrypted baseline backup remain. Same-host backup is not off-host disaster recovery or PITR; that remains a launch gate before customer or real-money use.

## Required interpretation

* PAPER readiness proves simulation workflow, deterministic accounting, local monitoring and customer-ledger persistence.
* Venue fees, funding, leverage, liquidation, exchange queue priority and guaranteed conditional fills are intentionally not modeled. The UI must continue naming those omissions.
* Browser-local protection and GTC monitoring operate only while the terminal is open. A closed browser cannot be represented as protected.
* Repository and PAPER evidence do not substitute for Hyperliquid testnet receipts. Follow [Hyperliquid go-live validation](/nytshift-docs/hyperliquid/hyperliquid-go-live-validation.md) only after production identity/database provisioning and separate action-time authorization.

## Failure response

Keep execution disabled when any gate fails, a stored ledger cannot replay exactly, a book or mark is stale/mismatched, protection cannot identify its trigger, a canceled lifecycle retains capital, database ownership is ambiguous, or the page recovers a different account state after reload. Fix the defect, reset only the disposable PAPER account if needed, and repeat this entire gate.


---

# 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/release-and-readiness/paper-trading-readiness-validation.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.
