This client code illustrates order handling for coin-margined futures. It configures position mode, margin mode, and leverage, submits buy and sell orders, checks order status, and exposes account, position, contract, depth, and funding-rate queries. Limit…
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
11 documents
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…
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…