API guide
Perpetual futures explained: funding rate, mark price and index price
A perpetual is a futures contract that never expires, held near its underlying by a payment between traders. It now prices stocks, indices and gold through the weekend, which makes it useful data long before it is a trade.
On this page
Key takeaways
- A perpetual future is a futures contract with no expiry date, kept near its underlying by periodic funding payments.
- When the perpetual trades above its index, funding is positive and longs pay shorts; below it, shorts pay longs.
- Venues value positions and trigger liquidations at the mark price, a smoothed fair value, not at the last trade.
- Perpetuals on stocks, indices and gold trade through weekends, so they show a live price while the underlying market is closed.
- TickerLayer publishes composite quotes and marks for 260+ contracts: reference values, not executable or settlement prices.
A perpetual future is a futures contract with no expiry date. Instead of converging on its underlying at settlement, it is tied to it by a funding rate: a periodic payment between longs and shorts that makes holding the expensive side cost money. Positions are valued at a mark price, which follows an index price of the underlying rather than the last trade.
Perpetual futures, or perps, started in crypto and now reference single stocks, ETFs, indices, gold, oil and currencies, trading 24 hours a day, 7 days a week. This guide explains the three prices and funding with worked numbers, then shows the composite quotes and marks TickerLayer publishes for 260+ contracts. It belongs to our crypto price API cluster, and everything here is about data: TickerLayer does not list, broker or execute any contract.
Perpetual futures: a future without an expiry date
A dated future, such as a quarterly gold or index contract, promises delivery or cash settlement on a fixed day. As that day approaches its price is pulled onto the spot price, and anyone who wants to stay exposed has to close the old contract and open the next one. The cost of that roll depends on the shape of the futures curve, which our contango and backwardation explainer covers.
A perpetual removes the expiry, and with it the roll. Nothing forces it back to the underlying on a known date, so the market needs a different anchor. That anchor is funding.
| Feature | Spot | Dated future | Perpetual future |
|---|---|---|---|
| Expiry | None | Fixed date | None |
| What keeps it near the underlying | It is the underlying | Convergence at expiry | Periodic funding payments |
| Leverage | Usually none | Margined | Margined |
| Ownership of the asset | Only if physically delivered | ||
| Trading hours | Follows its market | The venue schedule | Around the clock on most venues |
| Cost of holding | Custody or financing | A roll at each expiry | Funding, paid or received each interval |
Mark price, index price and last price
Every perpetual has three prices that matter, and most confusion about perps comes from mixing them up.
- Index priceThe venue's estimate of the underlying, usually an average of spot prices from several markets. It is what the contract is meant to track, and what funding is measured against.
- Mark priceThe fair value a venue uses to value positions and trigger liquidations: the index plus a smoothed premium, or a median of several such estimates. Built to ignore one-off trades.
- Last priceWhatever the most recent trade printed. It is what many charts show, and the easiest of the three to push around in a thin book.
The separation exists because of liquidations. If a venue liquidated at the last traded price, one aggressive order into an empty book could close out positions at a price nobody else would trade at. Marking to a smoothed fair value means a wick shows up on the chart but not in anyone's margin.
A thin-book wick: last price against mark price
- Last price
- Mark price
- Index price
Price
A perpetual on a US stock, Monday before the US open
{
"symbol": "KOUSDT",
"name": "The Coca-Cola Company",
"instrument_type": "perpetual",
"underlying_asset_class": "equity",1
"bid": 88.18,
"ask": 88.25,
"mark_price": 88.21,2
"last_price": null,3
"source_count": 3,4
"timestamp": 1790592600905,
"mark_timestamp": 1790592585091,
"prev_close": 88.08,5
"change": 0.135,
"change_percent": 0.1533
}
underlying_asset_classWhat the contract references: equity, etf, commodity, index, forex, pre_ipo or crypto.mark_priceComposite mark, the median of the live source marks. Use it to value a position on screen.last_pricenull here. A snapshot reads the last trade but never starts the trade tape, so it is only as fresh as other demand makes it.source_countHow many independent markets are live behind this price right now.prev_closeClose of the last completed UTC daily bar. A perpetual has no session, so its day turns at 00:00 UTC.
How the funding rate works
Funding is a payment between traders, not a fee to the venue. At each funding time, commonly every eight hours and on some venues every hour, every open position pays or receives its notional times the funding rate. When the perpetual trades above its index the rate is positive and longs pay shorts. When it trades below, the rate turns negative and shorts pay longs.
- Perp above indexBuyers keener than sellers
- Funding turns positivePremium measured against the index
- Longs pay shortsEvery funding interval
- Longs trim, shorts addHolding the rich side costs money
- Price drifts backPremium shrinks toward zero
premium = (perpetual price − index price) ÷ index pricefunding rate ≈ average premium over the interval, plus a small capped interest termpayment = position notional × funding rate
- premium
- How rich or cheap the perpetual is, as a fraction of the index.
- funding rate
- Set by each venue under its own formula, interval and caps.
- notional
- Position size times mark price.
Two consequences matter to anyone reading perp prices. A persistent premium is information: leveraged buyers are paying to stay long. And funding keeps the perpetual near its underlying only on average; between payments, and especially while the underlying market is shut, the gap can be real.
Open interest
Open interest is the number of contracts outstanding. Every long is matched by a short, so it counts one side. Rising open interest with a rising premium means new leveraged longs are arriving; falling open interest means positions are closing. Like funding, it is a statistic each venue reports for its own book.
24/7 exposure to stocks, indices and gold
The US stock market's regular session is six and a half hours a day, five days a week. A perpetual on a US stock or index keeps trading through the night, the weekend and the holiday, which makes it the only live price many screens can show while the exchange is dark. Here is the US 500 perpetual across last weekend:
US500USDT, 4-hour closes, Friday 25 to Monday 28 September 2026
Index points
The perpetual matched Friday's cash close almost to the point, held within about 0.3% of it through Saturday and most of Sunday, then slid from Sunday evening, the window in which regular index futures reopen. By 08:00 UTC on Monday it was about 0.5% below Friday's close. By mid-morning the two agreed again: 7,699.64 bid on the US 500 index at 10:25 UTC, 7,700.90 bid on the perpetual at 10:50. For the index itself during its own hours, the indices API guide covers the US 500 and the rest of our 45 indices.
The same thing at single-stock scale, from /stocks/snapshot/US:KO and /perpetuals/snapshot/KOUSDT: US:KO closed its last regular session on Friday at 87.81. KOUSDT, the perpetual on it, closed the UTC Sunday at 88.08, 0.3% higher. On Monday the stock's last pre-market trade printed at 88.24 at 09:52 UTC, three cents from the perpetual's composite mark of 88.21 at 10:50. That is one stock over one weekend, an example rather than a pattern: a perpetual can equally sit well away from where a stock reopens, so treat weekend perp prices as a signal about sentiment, labelled as what they are.
Perpetuals are not tokenized stocks
Perpetual on a stock
- A leveraged derivative with no expiry.
- No ownership, dividends or voting rights.
- Funding paid or received every interval.
- Can drift from the share, most of all while its market is shut.
Tokenized stock
- A token meant to track or represent a share.
- Rights depend on the issuer's structure.
- No funding; issuer or custody costs instead.
- Redemption and trading hours depend on the issuer and venue.
How TickerLayer builds a composite perpetual price
Every market that lists a perpetual runs its own contract with its own basis, fees and funding. Merging their order books into one best bid and offer would publish a book nobody quoted, so TickerLayer publishes a median instead. The composite bid is the median of the live source bids, the ask is the median of the live source asks, and the mark is the median of the live source marks. The book is therefore never crossed, a single source cannot move the price, and the values are in US dollar stablecoin terms, as the contracts trade. The feed covers 260+ contracts across seven underlying classes, from equities and ETFs to commodities, currencies and pre-IPO companies, with one symbol form and one payload shape for all of them.
Every response and frame carries source_count, the number of sources behind that value. A contract listed on six markets reads 6 while all six are live; when it falls to 1 or 2, the composite is effectively one book, and your screen should say so. History starts when a contract was first listed, which for many is recent, and weekends are in every series because the contract traded through them.
Perpetual futures data over REST and WebSocket
| Route or channel | Returns | Plan |
|---|---|---|
GET /perpetuals/symbols | Every contract with its name, underlying class and source count | Any valid key |
GET /perpetuals/quote/{symbol} | Composite bid and ask with sizes and source_count | Individual, Business |
GET /perpetuals/mark/{symbol} | Composite mark price | Individual, Business |
GET /perpetuals/trade/last/{symbol} | Latest trade with size and aggressor side | Individual, Business |
GET /perpetuals/snapshot/{symbol} | Quote, mark, last trade and daily change in one call | Individual, Business |
GET /perpetuals/agg/{symbol}/... | OHLCV bars from 1 minute to 1 day, weekends included | Individual, Business |
perpetuals.quotes, perpetuals.marks, perpetuals.trades | The same composite values, streamed | Business |
The most useful number you can build from two REST calls is the premium: how far the composite mark sits from the underlying's own price. It is the gap funding exists to close.
import os
import requests
BASE_URL = "https://api.tickerlayer.com"
session = requests.Session()
session.headers["x-api-key"] = os.environ["TICKERLAYER_API_KEY"]
def get(path):
resp = session.get(BASE_URL + path, timeout=10)
if resp.status_code == 403:
raise SystemExit(f"{path}: {resp.json()['message']}")
resp.raise_for_status()
return resp.json()
# Perpetual contract -> the REST quote of what it references.
CONTRACTS = {
"XAUUSDT": "/commodities/quote/XAUUSD",
"BTCUSDT": "/crypto/quote/BTCUSD",
}
for perp, underlying in CONTRACTS.items():
mark = get(f"/perpetuals/mark/{perp}")
quote = get(underlying)
ref = (quote["bid"] + quote["ask"]) / 2
premium_bps = (mark["mark_price"] - ref) / ref * 10_000
print(
f"{perp:<8} mark {mark['mark_price']:>10,.2f} "
f"reference mid {ref:>10,.2f} premium {premium_bps:+5.1f} bps "
f"({mark['source_count']} sources)"
)XAUUSDT mark 4,162.75 reference mid 4,157.35 premium +13.0 bps (6 sources)
BTCUSDT mark 82,943.65 reference mid 82,974.88 premium -3.8 bps (6 sources)Gold's perpetual marked 13 basis points above the gold reference, bitcoin's 3.8 below. Read those carefully. The perpetual is priced in stablecoin terms and the references in dollars; with USDT at about 0.99955 that morning, a stablecoin price should read roughly 4.5 basis points above a dollar price before any premium at all. The two requests were also a fraction of a second apart. Track the premium over time rather than trusting one print.
On Business, the same composite values stream on three channels. Numerics arrive as strings and every frame names its type, so switch on it and ignore anything you do not use:
// npm install ws
import WebSocket from "ws";
const URL = "wss://stream.tickerlayer.com/?apiKey=" +
encodeURIComponent(process.env.TICKERLAYER_API_KEY);
const SUBSCRIBE = {
action: "subscribe",
channels: ["perpetuals.quotes", "perpetuals.marks"],
symbols: ["XAUUSDT", "US500USDT"],
};
const latest = {}; // symbol -> { mid, mark }
let backoffMs = 1000;
function onFrame(msg) {
const row = (latest[msg.symbol] ??= {});
if (msg.type === "quote") {
// Perpetuals numerics arrive as strings.
row.mid = (Number(msg.bid) + Number(msg.ask)) / 2;
row.sources = msg.source_count;
} else if (msg.type === "mark") {
row.mark = Number(msg.mark_price);
} else {
if (msg.type === "system" || msg.type === "error") console.log(msg.type, msg.event, msg.code ?? "");
return; // any other frame type is not part of this view
}
if (row.mid && row.mark) {
const gap = ((row.mark - row.mid) / row.mid) * 10_000;
console.log(
`${msg.symbol.padEnd(9)} mid ${row.mid.toFixed(3)} mark ${row.mark.toFixed(3)} ` +
`mark - mid ${gap.toFixed(2)} bps sources ${row.sources}`,
);
}
}
function connect() {
const ws = new WebSocket(URL, { perMessageDeflate: false });
ws.on("message", (data) => {
const msg = JSON.parse(data.toString());
if (msg.type === "system" && msg.event === "ready") {
backoffMs = 1000;
ws.send(JSON.stringify(SUBSCRIBE));
}
onFrame(msg);
});
ws.on("close", (code) => {
const wait = backoffMs + (Math.random() * backoffMs) / 2;
console.log(`closed with ${code}, reconnecting in ${Math.round(wait)} ms`);
backoffMs = Math.min(backoffMs * 2, 30_000);
setTimeout(connect, wait);
});
ws.on("error", (err) => console.error("socket error:", err.message));
}
connect();system ready
system subscribed
US500USDT mid 7702.700 mark 7702.800 mark - mid 0.13 bps sources 3
XAUUSDT mid 4162.560 mark 4162.384 mark - mid -0.42 bps sources 6
XAUUSDT mid 4162.560 mark 4162.426 mark - mid -0.32 bps sources 6
US500USDT mid 7702.700 mark 7702.900 mark - mid 0.26 bps sources 3
US500USDT mid 7702.950 mark 7702.900 mark - mid -0.06 bps sources 3
XAUUSDT mid 4162.560 mark 4162.437 mark - mid -0.30 bps sources 6In calm markets the mark sits within a basis point of the composite mid, as it does here. A gap that widens is worth an alert, because it means the book and the venues' fair-value estimates disagree. Reconnects, heartbeats and snapshots work as on every other channel; the WebSocket market data guide covers them.
Perpetuals plans and pricing
| Feature | Individual | Business |
|---|---|---|
| Monthly | $179 | $799 |
| Yearly | $1,718 | $7,670 |
| REST quotes, marks, trades, bars | ||
| WebSocket channels | ||
| REST calls | 250K a month | 25M a month |
| Use | Personal and research | Commercial use included |
GET /perpetuals/symbols answers for any valid key, so you can browse the contract list before you buy. Popular contracts also have public pages, delayed by 15 minutes, such as gold and the US 500, and the perpetuals product page has the methodology in full.
Before perpetual prices go on a screen, run through this list:
- Label them as perpetual prices, never as the stock, index or commodity price.
- Value positions with
mark_price; use the book for spreads and depth. - Show or monitor
source_count, and treat 1 as a warning. - Handle
nullin thelast_*fields of a snapshot. - Parse WebSocket numerics from strings.
- Keep the perpetuals notice next to the data for your users.
- Never settle, margin or liquidate on this data without a written agreement.
Questions
What are perpetual futures?
Futures contracts with no expiry date. They stay close to their underlying through periodic funding payments between longs and shorts, and positions are valued at a mark price rather than the last trade.
What is the difference between mark price and last price?
The last price is the most recent trade. The mark price is a smoothed fair value based on the index price, which venues use to value positions and trigger liquidations, so a single thin-book trade cannot liquidate anyone.
What is index price in perpetual futures?
The venue's estimate of the underlying's spot price, usually an average across several markets. Funding measures the perpetual's premium or discount against it.
How does the funding rate work?
At each funding time, every position pays or receives its notional times the rate. A positive rate means longs pay shorts, which happens when the perpetual trades above its index; a negative rate means shorts pay longs.
Can I get perpetual futures historical data?
Yes. GET /perpetuals/agg/{symbol}/{multiplier}/{timespan}/{from}/{to} returns OHLCV bars from 1 minute to 1 day, weekends included. History starts when each contract was first listed, which for many contracts is recent.
Does a perpetual on a stock give you the shares?
No. It is a leveraged derivative with no ownership, dividends or voting rights, and its price can drift from the share, especially while the stock market is closed.