new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Quant · Exchange APIs · all subjects

Futures specifics

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

How does funding rate work and when is it charged?

Perpetual swaps anchor to spot via funding: periodic payments between longs and shorts (positive rate = longs pay shorts). Typical cadence is every 8 hours at 00:00, 08:00, 16:00 UTC on Binance, but many symbols run 4-hour (or even shorter) funding — check per-symbol via funding info endpoints rather than assuming. Fee = `position notional x fundingRate`, and you only pay/receive if you hold the position AT the funding timestamp — bots that enter seconds before funding just to collect it are a known (risky) strategy. History: `GET /fapi/v1/fundingRate`; current predicted rate: `premiumIndex`. Persistent 0.05-0.1% per interval compounds brutally against carry positions — model funding in backtests, or your 'market-neutral' arb is quietly bleeding.

Why was my position liquidated when last price never touched my liq price?

Because liquidation is decided by MARK price, not last trade. Mark price is a fair-price calculation from the index (multi-venue composite) plus a smoothed basis, designed to resist single-exchange wicks and manipulation. Your chart shows last price on one venue; the engine watches mark. Consequences: a violent wick in last price may NOT liquidate you (good), and a slow index drift can liquidate you while your chart looks fine (surprising). Monitor the `markPriceUpdate` stream (futures) or `premiumIndex` for the real trigger level, and compute your liq price from the documented formula (depends on wallet balance, bracket, maintenance margin) — do not approximate it as `entry x (1 - 1/leverage)`, that is wrong once funding, fees, and tiers enter.

Cross vs isolated margin — what is the practical difference for a bot?

Cross margin backs every position with the whole futures wallet: positions survive deeper drawdowns, but one runaway position can drain the entire account and cascade-liquidate the rest. Isolated caps each position's loss at its assigned margin (adjustable via add/reduce margin endpoints), but liquidates that position sooner. For bots: isolated is the blast-radius limiter when running multiple strategies on one account; cross is capital-efficient for hedged books. Binance sets it per symbol via `POST /fapi/v1/marginType`, and the change is rejected while a position or open order exists on that symbol. Portfolio margin / unified account modes (Binance PM, OKX multi-currency, Bybit UTA) change the math again — read margin state from account endpoints instead of assuming.

One-way vs hedge mode (dualSidePosition) — what breaks if I mix them up?

One-way mode: one net position per symbol, orders use `positionSide=BOTH`. Hedge mode (`dualSidePosition=true` on Binance): separate LONG and SHORT positions coexist per symbol, and EVERY order must carry `positionSide=LONG` or `SHORT`. Mixing them up throws -4061 ('Order's position side does not match user's setting'), and worse, logic written for one-way silently flips or doubles positions in hedge mode. Query the mode at startup (`GET /fapi/v1/positionSide/dual`) instead of assuming; switching mode is rejected with open positions. Bybit v5 encodes the same thing as `positionIdx`: 0 one-way, 1 hedge-buy side, 2 hedge-sell side. OKX has long/short mode per account with `posSide` on orders. Bake the mode into your order-construction layer, not into scattered if-statements.

What are leverage brackets, maintenance margin tiers, and ADL?

Max leverage falls as position notional grows (e.g. 125x on BTC only for small notionals), and each bracket has its own maintenance margin rate — so your liquidation price JUMPS when growing a position across a tier boundary. Fetch brackets via `GET /fapi/v1/leverageBracket` and size positions inside a tier deliberately. ADL (auto-deleveraging): when the insurance fund cannot cover a bankrupt position, the exchange force-closes profitable opposing positions by ranking (profit x leverage); check the ADL quantile indicator in position data — a high ranking on a big winning position is a real, often ignored, risk. Insurance funds on the major venues absorb negative balances (no socialized clawback on Binance/Bybit as of early 2026), but that is a policy backstop, not a contractual guarantee.

Give your agent this brain