---
name: rekt-knockout
description: Trade and build on Rekt Knockout, a 1000x knockout product on Solana. Use when asked to quote, open, add to, close or settle a Knockout position, to read positions or queued claims, to handle a refusal, or to write a bot, keeper or interface with the @rekt-trading/1000x SDK.
metadata:
  version: "1.0"
---

# Rekt Knockout

Rekt Knockout lets a trader go long or short at 1000x on Solana, with two hard limits: a **barrier** that ends a position
if the price reaches it, and an optional **target** that sets a gross gain of a multiple of the stake, before the exit fee and the
share of the gain the terms withhold. The most a trader can lose is the stake. There is no margin call and nothing to top up. The funding rate (a governed rate on the time held) is 0.

Docs: https://docs.rekt.money. This file is the short version for an agent. The page for each topic
is linked under "Where to read more".

Values below are as of 2026-11-10; they can change. Read the live value from the chain.

## Rules that hold for every action

1. **Ask before you spend.** State the stake and the barrier line to the person: at the barrier they
   receive nothing.
2. **Simulate first.** A dry run costs nothing. Send only when the person says so.
3. **Never cache governed state.** Read the config, vault and market from the chain on every request.
4. **Money is `bigint` in USDC base units** (six decimals). `1_000_000n` is one dollar. Parse text with
   `parseUsdc`, never through a float.
5. **A position is named by `seq`.** A slot index is not a handle, because slots are reused.
6. **Keep keys and RPC endpoints out of prompts, logs and commits.** Use environment variable names.
7. **State facts, not forecasts.** Report what a trade costs and what it paid. Do not state or imply
   a chance of winning.

## Limits and hours (as of 2026-11-10; they can change)

| | |
| --- | --- |
| Stake | $0.20 to $1,000 for one position |
| Size | 1000x the stake, on every market |
| Target (optional) | at least 2.00x the stake (`rung_bps` 20_000), up to the payout cap; `rung_bps` 0 means no target other than the payout cap |
| Open fee | none |
| Loss tax | on a close at a loss: 99.96 % of the loss, taken from what is left before the exit fee. At the base terms, a $1.00 stake that closes 2 bp against the entry is paid $0.5641: $0.20 loss, $0.1999 loss tax, $0.6001 exit value, $0.0360 exit fee |
| Close fee | on the exit value. Base terms: 5 % on a win, 6 % on a loss, a rate between the two within 1 bp of the entry price. The terms a new position freezes can be lower: read them with `openFeeTerms(config, market, table)` before you open. A knockout has no fee |
| Referral discount | a wallet linked to a referrer pays 10 % less exit fee (a link made before 2026-11-10 keeps 25 %). A wallet links itself, by its own signature, once and for life |
| Share of a gain kept | the terms withhold part of a gain: the trader keeps 63 % at a move of 1 bp or less, 71.5 % at 2 bp, 81.5 % at 5 bp, 87 % at 10 bp and 93 % at 100 bp or more, on the straight line between those moves. At the base terms, a $1.00 stake that reaches a 2.00x target (a 10 bp move) is paid $1.7765: $1.00 gross gain, $0.87 kept, $1.87 exit value, $0.0935 exit fee |
| Timer | optional; 26 seconds or more |
| Minimum hold | no close request in the first 6 slots after the entry |
| Tenor | none: a position ends at its barrier, its target, a close, or its own timer |
| No price for 24 hours | each live position gets its stake back with no exit fee; a position stamped at its target is paid that level and pays the exit fee |
| Markets | BTC, ETH, SOL, XRP, HYPE: always open. Gold (XAU/USD) is not available for now |

A market is in one of four states: open, closing soon, closed or halted. Branch on the state
(`availability()`), never on one boolean.

## Quote

An `open`, an `add_collateral` and a `request_close` carry **no price**. The price comes later, from the
venue. So "quote" means "price the terms before you send":

```ts
const size = sizeForTotal(budget, config.params);              // budget -> stake
const preview = openPreview(config, market, size.collateral, 20_000, nowUnix);
// preview.totalDebit, preview.barrierPayout (always show it)
// preview.maxPayout is the gross figure, before the exit fee and the share of the gain the terms withhold
```

A **signed price quote** is needed only by instructions that read a price: `settle`, `stamp_book`,
`set_take_profit` and `prove_price`, and by the `fill` that a listed filler writes. On a market of
feed kind 3 (`isKind3Market(market)`) the venue's fillers and keepers attach the price: you need no
quote. Read the kind on every request. On a kind-2 market, get one from the price service, from a
server (it sends no CORS headers):

```sh
curl -s https://prices.rekt.trading/v1/quote \
  -H 'content-type: application/json' \
  -d '{"feed":"BTC/USD","idempotency_key":"'"$(openssl rand -hex 16)"'"}'
```

Use a new `idempotency_key` for each attempt. A quote ages out in slots, so fetch it just before you
sign. `GET /v1/feeds` lists the feeds. On a refusal: `409` and `429` retry after `retry_after_ms`;
`400` and `422` mean fix the request. Read [Getting prices](https://docs.rekt.money/sdk/prices).

## Open

An open is an **order**. The stake is taken when it lands and the venue's next price after a short
delay fills it. If no price comes in time, the order is returned and the whole stake comes back.

1. Read the protocol, then `sizeForTotal` and `openPreview`.
2. Build: `ix.open(accounts, args, priceAccountsFor(market, config, 'open'))` (SDK 0.6.0 or later). It
   adds the governance table on a feed-kind-3 market, which refuses an open without it
   (`GovTableRequired`). Set `min_collateral_out` to `size.collateral`, never to `1n`. A first trade also needs `ix.initTraderAccount` in the same
   transaction.
3. Simulate, then send. Read the `seq` from the landed transaction with `landedOpenedSeq`.
4. Wait for the fill: the position's `entryPrice` is 0 until a filler writes it. The events are
   `EntryFilled` and `OpenVoided`.

The entry is the next price, not the price on the screen at the tap.

## Add

`addCollateralFor(market, config, accounts, args)` adds stake to a live position, with the accounts
the market's feed kind needs. It is an order too, priced at the next price, and
it is returned in full if the position is already at its barrier or target.

Adding while the position is **ahead** moves the barrier toward the price. It is not a defence. Say so
before you offer it. Events: `CollateralCommitted`, then `CollateralAdded` or `AddReversed`.

## Close

A close is a request that carries no price: `requestCloseFor(market, { authority, config, market:
marketAddress, positions, delegate: null }, seq)`. On a feed-kind-3 market it adds the governance
table, which the program requires there. It cannot be withdrawn. Ask only from `closableFromSlotOf(position, config,
market)`. The exit price is the first price after a short delay, and **the close price is not locked**
until `SettlementPriced` lands.

## Settle

Anyone may settle a close, and the venue's keepers do. You need to settle only if you run a keeper.
On a feed-kind-3 market the keepers settle with a signed tick: there is nothing to fetch. On a kind-2
market the settle carries a window quote: ask for the first quote at or after the window's start with
`min_slot` and `payload_version: 2`, then send with `submitBenchmarkQuoted`. Nobody is paid for
settling. Read [Settling](https://docs.rekt.money/sdk/settling).

## Read positions and queued claims

```ts
const book = decodeTraderAccount(bytes);        // bytes of traderPda(owner)
const held = heldPositions(ownerHex, book);     // { ref: { trader, slot, seq }, position }
phase(position, nowSlot);                       // PendingOpen, a live phase, ExitRequested, ...
```

History: `readTradeHistory`, or `https://data.rekt.trading/v0/trades?owner=<address>` for the last 48
hours.

**A win is paid in full, and part of it may be paid later.** Your stake comes back at once and the
profit is paid from the pool's free cash. What the pool cannot pay yet joins a first-in, first-out
queue, with no guaranteed time. `SettlementPriced.trader` is only what was paid now. Read the queue:

```ts
const cap = decodeCapitalState(capitalBytes);   // account at capitalPda()
const queue = decodeQueue(queueBytes);          // account at queuePda()
queuePosition(toHex(bookAddress), cap, queue);  // amount ahead, funded, delivered, age. No forecast
```

Show the amount paid now, the amount queued, the amount ahead and the age. Never show an estimate of
the wait. Anyone can deliver funded queue money with `payQueue`.

## Handle a refusal

```ts
const refusal = errorForCode(programErrorCode(err) ?? -1);   // name, code, cause, fix, retryable
```

| `retryable` | Do |
| --- | --- |
| `never` | Fix the request. A retry is a loop. |
| `after-state-changes` | Wait for the world to move, then ask again. Back off. |
| `after-governance` | Stop. Only a change by the venue's authority clears it. Tell the person. |
| `immediately` | Retry on the next slot. These are almost all price freshness. |

For the order-and-close codes (6203 to 6238) use `retryClassOf(code)`. It says "done", "send the other
instruction" or "retry with the right quote".

- A **returned order** or **returned add** is not an error. The stake came back. An order is returned when it does not fit the pool's cover rule at its fill.
- `OracleFrozen` and `SettlesDisabled` stop closes. Read `config.oracleFrozen` and
  `config.settlesDisabled`. Do not retry in a loop.
- `MarketClosed`, `SessionEndsBeforeTenor` and `InsideEventWindow` are the market's calendar.
- After a timeout, never sign a second order for the same intent inside one blockhash life. Send the
  same signed bytes again.

## Never

- Never present a price from the screen as the entry or the exit.
- Never tell a trader they keep part of the stake at the barrier.
- Never present `SettlementPriced.trader` as the amount won. A part may be queued.
- Never hand-compute the barrier, the fees or the payout. Use `openPreview`, `settlePreview` and
  `closePreview`, and pass `settlePreview` the market's fee-terms account for a position with a
  fee-terms slot.
- Never route around a refusal.

## Where to read more

- Quickstart, a working bot: https://docs.rekt.money/sdk/quickstart
- Fees and limits: https://docs.rekt.money/limits
- Referrals: https://docs.rekt.money/referrals
- Orders and closes: https://docs.rekt.money/sdk/orders
- Error handling: https://docs.rekt.money/sdk/errors
- Building an agent: https://docs.rekt.money/sdk/agents
- The docs as an MCP server: https://docs.rekt.money/mcp
- Questions: support@asymmetra.xyz
