TORQUE

The product

How knock-outs work

A knock-out is leverage with a floor. You put in margin, the vault lends the rest, and the whole position is bought as real NVDA. If NVDA falls to a set level, the position is closed. You can never lose more than your margin, even through a price gap.

Open, hold, close

StepWhat happens on chain
OpenYou post margin USDG. The LP vault lends the rest of margin × leverage. The whole notional is swapped into real NVDA in the NVDA/USDG Uniswap v3 pool and held by the contract. The fill must land within 1% of Chainlink's RHNVDA / USD.
HoldYour debt accrues at 10% APR. Your financing level is the price at which the position is worth zero. The knock-out level sits 5% above it.
CloseYou sell your NVDA back into the pool. The vault is repaid first, in full, and you keep the rest.
Knock-outIf a fresh Chainlink price is at or below your knock-out level, anyone can knock the position out. The NVDA is sold, the vault is repaid, and whatever is left is yours to claim().

The numbers

A trader posts margin USDG and picks leverage L from 2× to 5×:

QuantityDefinition
feemargin × L × 0.10%, paid to the vault
notional N(margin − fee) × L
borrowN − (margin − fee), lent by the vault
hedgeN USDG swapped into q NVDA in the pool
debt D(t)borrow × (1 + 10% × Δt / 1 year), simple interest
financing level F(t)D(t) / q: the NVDA price at which the position is worth zero
knock-out level B(t)F(t) × 1.05

The position is worth q × P − D(t) and is never negative for the trader.

Example: $2 at 5× on mainnet

Position #1, opened on 2026-10-02 (tx): margin 2 USDG at 5×, fee 0.01, notional 9.95 USDG, borrowed 7.96 USDG, bought 0.042384 NVDA. The financing level was about $188 and the knock-out level about $197, roughly 16% below entry. The most the trader could lose was $2.00. It was closed for 1.980059 USDG back (tx).

Above the knock-out, each 1% move in NVDA is about 5% on the margin at 5×.

Who closes a knock-out

Anyone. knockOut(id) is permissionless: if Chainlink prints at or below a position's knock-out level, any account can trigger it, so the vault never waits on the trader. The dashboard's All open positions board shows every position and enables Knock out when one is eligible. There is no keeper reward in v1.

No keeper is running today. There are no open positions, so a keeper would only spend gas, and we will not leave a wallet with real funds sending transactions unattended. That is the point of a permissionless knock-out: it does not depend on us. If a position is ever eligible, anyone can close it with the watcher below.

Run the knock-out watcher yourself

script/knockout-watcher.sh needs only Foundry's cast. It prints the price, both checks and every open position with its distance to the knock-out, using exactly the contract's rule: a fresh print, the pool agreeing or the print under 30 minutes old, and the price at or below barrierOf(id).

Command
git clone https://github.com/Torque-Protocol/torque && cd torque
./script/knockout-watcher.sh --once                         # watch only: no key, nothing sent
ACCOUNT=<cast keystore> ./script/knockout-watcher.sh --send  # also knock out eligible positions

With --send, every knock-out is simulated from your address first, so one that someone else already closed is skipped. Tested on a mainnet fork: from a third-party wallet it found the one eligible position of two, knocked it out, and the trader's residual was credited to claim with zero bad debt; with a stale feed, or a pool disagreement on an old print, it waits and says why.

Why the residual is claimed, not sent

Paxos can freeze a USDG address. If a knock-out pushed the residual straight to a frozen trader, the transfer would revert and the knock-out with it, and the position would stay open while the price kept falling. So the residual is credited, and the trader calls claim(). No trader address can ever block a knock-out.