Run it yourself
Three levels. A demo that needs no keys and no money, the tests and attack scripts, and the whole system on your own testnet accounts.
Requirements
- Node 24 or newer (scripts run TypeScript directly) and npm 11
- For the contracts: Rust,
cargo-near,near-cli-rs, and Docker for reproducible builds
git clone https://github.com/demigohu/nullpoint
cd nullpoint
npm install1. No keys, no funds
npm run demoFive checks against live data, in under a minute:
- Reads the live testnet vault: share price, shares, the short on Hyperliquid, paused or not.
- Recomputes the vault's address from its contract account through NEAR Chain Signatures and compares it with the one the contract has configured.
- Fetches a real mainnet 1Click quote and verifies its ed25519 signature the way
sign_quotedoes; the same quote with the recipient swapped to an attacker fails. - Takes the vault's real position (coin from the contract, short from Hyperliquid) and reprices both 20% up and down: the value barely moves.
- Runs a compromised strategist's wish list through the limits: all blocked.
npm testRuns the shared-code tests, the field test, 25 contract unit tests (with real mainnet 1Click quotes and a real MPC signature) and 2 integration tests on a local NEAR sandbox. Works on a clean clone without any .env.
2. Try to break it
npm run attack # the agent's own keys try to steal (needs the testnet agent keys)
npm run attack:llm # prompt injection and a compromised model (needs NEARAI_API_KEY)
npm run simulate:crash # BTC ±20% in a day, minute by minute
npm run simulate:strategy # weeks of real Hyperliquid funding: hold vs rule vs AI3. The whole system on testnet
Create a testnet account (for example with near account create-account) and fund it from the faucet.
Deploy the vault, the mock Intents contract, mock USDC and an agent account under it:
OWNER=you.testnet npm run deploy:testnetCreate the agent's restricted keys, a function-call key that can only call the vault and the mock solver's key. They're written to .env:
cd scripts && OWNER=you.testnet node add-agent-keys.tsApprove the agent's Hyperliquid trading key through the contract (NEAR's signers sign approveAgent):
OWNER=you.testnet node approve-agent.tsStart the agent. Fill in the rest of .env from .env.example (NEAR AI Cloud key for the AI, optionally a paid RPC), then:
npm run agentStart the app and the docs, connect a testnet wallet, get test USDC from the account menu, deposit and watch the dashboard:
npm run dev # web on :3000, docs on :3001npm run e2e:testnet exercises deposit, sweep, report and an MPC-signed withdrawal without the agent. npm run reset:testnet closes positions and redeploys with fresh state on the same accounts.
To stage a coin switch on testnet (whose funding is unrealistic), run the agent with fake funding for a few minutes:
DEMO_FUNDING='{"NEAR":2000,"BTC":300}' DEMO_MIN_HOLD_HOURS=0 STRATEGIST_INTERVAL_MIN=1 STRATEGIST=rule npm run agentRepository layout
| Path | What |
|---|---|
contracts/vault | The vault contract (Rust, near-sdk) and its tests |
contracts/mock-verifier, contracts/mock-ft | Testnet stand-ins for intents.near and USDC |
packages/core | Shared TypeScript: addresses, 1Click format, Hyperliquid helpers, strategy and limits |
apps/agent | The agent |
apps/web | The app: landing, vault, dashboard, /api/health |
apps/docs | These docs |
scripts/ | Demo, attacks, simulations, deploy and key scripts |