NeapDocs
Launch app
Docs · Security

Protocol

Security

What has been checked, what was fixed, and what is still open. Stated plainly.

Status

Security review, 12 November 2026

The contract was reviewed against a fixed set of security checks. Five issues were fixed the same day. The full report is in the repository: security-audit-2026-11-12.md.

SeverityFixed issue
CriticalDeposits and margin withdrawals were possible in markets that were not open. Mode checks added.
CriticalThe price callback changed engine state. It now only stores the observation.
HighLiquidation was possible at a stale price. A freshness check was added.
HighReduce-only mode was not enforced on order execution. It is now.
MediumExpired orders were not removed from storage. They are now.

Known open items

  • The owner key can create markets directly and replace the oracle account without a timelock. This is disclosed and limited to the hackathon period.
  • A market that drops to reduce-only after a price-band breach has no automatic way back to active.
  • Orders that reduce the pool's imbalance are charged the full dynamic spread instead of the minimum. Traders are overcharged, never undercharged.
  • The 24 hour pool redeem delay is not implemented yet.
  • Pool pricing assumes tokens with 6 decimals.

What is tested

CheckResult
Contract unit tests48 passing
Sandbox tests on a real NEAR runtime2 passing: full trade flow, and pool price read
Risk engineKani proofs and property tests in crates/engine
CustodyContract USDC is at least the sum of all balances, checked after every call in tests
AdminA test confirms admin methods do not change any balance

Access control

  • Every value-moving user call requires 1 yoctoNEAR, so it must be signed by a full-access key.
  • Deposits are accepted only from the configured USDC contract.
  • Callbacks are private to the contract.
  • The pauser role can only tighten a market: active to reduce-only to price-uncertain. It cannot loosen it.
  • There is no method that lets an admin move user funds.

After the hackathon the owner key moves to a 2-of-3 multisig with a timelock.

Report a vulnerability

Contact the team at @neapdex before disclosing publicly.