This document compares crypto spot, leveraged spot, and futures trading. It explains that spot positions are not subject to liquidation in the described framework, while borrowed margin positions and futures can be forcibly closed. It outlines long and short…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
1,747 documents
This code provides a client wrapper for trading and querying USDT margined perpetual futures. It configures position mode, margin mode, and leverage, then supports buy and sell orders with limit, market, or other order types. After submission, it checks…
This document describes a client for futures exchange HTTP endpoints. It covers public market data requests for exchange specifications, order books, candlesticks across several intervals, recent prices, and best bid and ask quotes. It also defines common…
The document surveys several ways to seek returns in cryptocurrency markets: lending assets through deposit products, supplying liquidity to earn fees, collecting perpetual-futures funding, trading price differences between contracts with different…
This program wires a double exponential moving average strategy to a Bitcoin perpetual futures market. It creates an authenticated HTTP client, subscribes to websocket market data, and passes incoming ticks to the strategy. A background scheduler…
The document describes a funding-rate trade that pairs a short perpetual futures position with a long spot position of equal size. It proposes opening the hedge when both the funding rate and quoted spread meet configured thresholds, collecting funding…
This document presents an exchange interface for perpetual futures that combines account and market queries with order placement, cancellation, and status checks. Its buy and sell routines submit orders, inspect their reported state, and can react to…
The document explains a market-neutral approach to perpetual futures funding. When funding is positive, it proposes buying spot and shorting an equal amount of the perpetual contract; when funding is negative, it proposes borrowing and selling spot while…
This lesson contrasts spot trading, where profit generally depends on prices rising after purchase, with futures contracts, which allow traders to open and close positions and use leverage. It explains that leverage reduces the margin needed for a position…
The document describes a two-sided futures grid strategy that places orders on both sides of the market and includes take-profit and stop-loss controls. It presents the approach as most suitable for range-bound conditions or periods of relatively low, stable…
The document raises a practical issue in a cryptocurrency perpetual-swap pair-trading strategy: a spread estimated by regression on log returns can produce opposite signals in consecutive observations. The author calculates the spread from rolling historical…
The document explains how closing a futures or perpetual futures position changes a trader’s net exposure. A trader closes a long by selling the contract, which opens or increases a long position for whoever buys it. The original short position remains open;…
The document asks whether a long position in a quarterly bitcoin future and a short position in a perpetual swap can remain market neutral. It explains that perpetual swaps have no expiry and use funding payments to help keep their prices near spot. The…
The note explains how collateral and funding payments relate to liquidation in perpetual futures. In the answer’s account, a position is liquidated when collateral falls below the maintenance margin. Collateral includes the amount initially posted, realized…
The document raises two modeling issues when applying stochastic quanto pricing formulas to crypto futures and perpetual swaps. First, it questions what domestic discount rate to use when the contract is settled in bitcoin, given the absence of a…
The discussion examines how to estimate a cryptocurrency yield curve when perpetual futures are the only obvious derivatives market. One answer emphasizes that a curve describes rates across maturities at a point in time; forecasting future funding rates is…
The discussion asks how to choose the number of historical candles used to estimate a spread z-score in a crypto perpetual swap pairs strategy. The question notes that different pairs appear to perform best with different window lengths in both backtests and…
The document explains how leveraged futures positions are closed when a trader’s margin cannot cover the losses, focusing on the difference between broker-backed conventional markets and crypto exchanges with limited-liability accounts. It uses a…
The document asks how a market maker might hedge a short position in down-and-in Bitcoin puts. Its answer contrasts these barrier options with vanilla puts and gives two possible risk-management actions: use Bitcoin-dollar perpetual swaps or dated futures to…
This indicator builds a price-binned footprint over the visible chart range using either traded volume or changes in open interest. Users choose the number of price rows and whether each row displays totals, an up/down split, or net delta. Positive delta…
This long-only strategy for XRP perpetuals arms an entry when the 4-hour RSI(14) falls below 28. It starts with a base order, then adds up to five safety orders at fixed price declines from the base entry. The default order sizes grow at roughly 1.8 times…
This TradingView strategy is described as reversing trades when price reaches extreme levels around VWAP standard deviation bands. The page shows BTCUSDT perpetual chart context and plots multiple bands, but provides no entry thresholds, exit rules, position…
This TradingView strategy divides a fixed BTCUSDT perpetual-futures price range into configurable levels, using either geometric or arithmetic spacing. It allocates the stated total investment evenly across levels. When a bar closes through an unowned level…
This Bitcoin perpetual-futures strategy combines a daily EMA bias and a four-hour RSI confirmation with hourly RSI, MACD, engulfing candles, elevated ATR, and a volume spike for entries. It places pattern-based stops with a maximum distance, sizes positions…