Hedgeveil is an options protocol on NEAR. It splits one NEAR into two complementary positions: Upside and Capped value, with their combined payout backed by the original collateral.
The trading workspace makes the payoff visible before a trade. Choose a market, explore price scenarios, and review the purchase cost before signing.
The problem
A leveraged position can be liquidated during a temporary price move, even if the market later recovers. Keeping it open means managing collateral, margin requirements, and the risk of a forced exit. Debt-backed systems also need liquidators and timely price feeds to stay solvent.
Hedgeveil explores a different starting point: divide collateral that already exists into two complementary claims. The settlement price determines how that backing is distributed. A fully paid purchase does not require borrowed funds or margin top-ups, although the purchased claim can still lose its entire cost.
One NEAR, two positions
Creating a pair locks one NEAR and issues one Capped value claim and one Upside claim for the same set price and expiry. At settlement, Capped value follows NEAR’s dollar value up to the cap; Upside receives the value above it. Together, the two claims always distribute the pair’s one NEAR of backing.
For a $3 set price and a $4 final reference price, Capped value receives 0.75 NEAR and Upside receives 0.25 NEAR. Their reference values are $3 and $1 respectively. These are payouts, not profits: the purchase cost and fees still matter.
There are three exit paths. A holder can sell against an available funded offer, merge equal matching claims back into NEAR before finalization, or redeem a claim after settlement. Capped value is not a guaranteed dollar balance; the value of its NEAR payout can continue to change afterward.
Following a trade through
The user selects a market, side, and quantity, then requests an exact-size offer. The review shows the cost, fees, and payout inputs before wallet approval. The Rust clearinghouse verifies the maker’s signature, nonce, expiry, and available funding, then exchanges the trade’s legs atomically.
A wallet response alone does not mean a trade succeeded. The application records the handoff, follows finalized transaction receipts, and reconciles the result with on-chain state. If a transfer’s outcome is uncertain, it is recovered from that evidence rather than silently submitted again.
Settlement and evidence
The current expiry policy uses a 30-minute time-weighted average of NEAR/USD trades ending at expiry. An Outlayer worker fetches Coinbase Exchange trade history; the resolver checks the configured window, coverage, sequence, and arithmetic before the clearinghouse accepts a finalized result.
Missing or rejected evidence delays settlement. The configured Outlayer callback is authenticated, but Coinbase data and the external execution service remain trust dependencies. The design separates an indicative chart price from the evidence that is allowed to settle a claim.
Implementation and current scope
The project combines a Next.js trading workspace, a Rust clearinghouse and resolver, funded makers, a receipt indexer, and PostgreSQL-backed operation journals. The engineering work centers on reserve accounting, exact transaction review, replay protection, and recovery across asynchronous wallet and chain events.
The testnet demo has recorded buy, sell, pair creation, merge, withdrawal, and expiry-settlement flows. It remains a prototype using test NEAR; broader public reliability testing and independent security review are still required before production. The experimental tracking vault is disabled.
Details
NEAR, Rust, Next.js, TypeScript, Outlayer, PostgreSQL
Public testnet demo using test NEAR. Production is disabled and independent security review is pending.