Disclosure: AI assistance was used in preparing this technical article. The code is an illustrative research framework, not a complete exchange-data integration.
A cryptocurrency backtest can produce misleading results even when its price calculations are correct.
One reason is survivorship bias.
If a historical investment universe is constructed from assets that remain active today, cryptocurrencies that previously traded but later disappeared may be excluded from the sample.
The resulting portfolio may look stronger than the strategy could actually have performed at the time.
The solution is to reconstruct the asset universe using information available at each historical decision date.
This is known as point-in-time universe construction.
1. Define the historical asset directory
A useful starting point is a historical asset-status table.
Each record should identify an asset, its listing period, and the period during which it was eligible for trading.
import pandas as pd
assets = pd.DataFrame([
{
"asset": "BTC",
"listed_at": "2018-01-01",
"delisted_at": None
},
{
"asset": "ETH",
"listed_at": "2018-01-01",
"delisted_at": None
},
{
"asset": "ALT_A",
"listed_at": "2020-03-01",
"delisted_at": "2023-06-15"
},
{
"asset": "ALT_B",
"listed_at": "2021-01-01",
"delisted_at": "2022-11-10"
}
])
assets["listed_at"] = pd.to_datetime(
assets["listed_at"]
)
assets["delisted_at"] = pd.to_datetime(
assets["delisted_at"]
)
These dates are illustrative.
A real dataset should distinguish exchange-specific trading-pair status from the underlying asset's broader existence.
2. Reconstruct the universe at a historical date
A simple point-in-time universe can be defined as:
[
U_t={i:L_i\leq t<D_i}
]
Where:
- (L_i) is the listing date.
- (D_i) is the effective delisting date.
- (t) is the portfolio formation date.
An asset with no recorded delisting date remains eligible under this simplified rule.
def universe_at(assets, timestamp):
timestamp = pd.Timestamp(timestamp)
active = assets[
(assets["listed_at"] <= timestamp)
&
(
assets["delisted_at"].isna()
|
(timestamp < assets["delisted_at"])
)
]
return active["asset"].tolist()
print(
universe_at(assets, "2022-01-01")
)
The resulting universe includes assets that were eligible on January 1, 2022, even if some of them were delisted later.
This is fundamentally different from using today's active-asset list to reconstruct historical portfolios.
3. Apply eligibility rules using historical information
Listing status alone does not determine whether an asset should enter a strategy.
A real selection process may also require minimum historical volume, price availability, liquidity, or market capitalization.
For example:
market_data = pd.DataFrame([
["2022-01-01", "BTC", 100_000_000],
["2022-01-01", "ETH", 80_000_000],
["2022-01-01", "ALT_A", 5_000_000],
["2022-01-01", "ALT_B", 2_000_000],
], columns=[
"date",
"asset",
"volume_usd"
])
market_data["date"] = pd.to_datetime(
market_data["date"]
)
def eligible_universe(
assets,
market_data,
timestamp,
min_volume=1_000_000
):
timestamp = pd.Timestamp(timestamp)
active_assets = set(
universe_at(assets, timestamp)
)
observed = market_data[
market_data["date"] == timestamp
]
eligible = observed[
observed["asset"].isin(active_assets)
&
(observed["volume_usd"] >= min_volume)
]
return eligible["asset"].tolist()
The volume filter must use information available at the formation date.
It should not use a future rolling window or a subsequently revised asset ranking.
In production research, point-in-time market capitalization and liquidity data also require careful timestamp handling.
4. Preserve delisting events separately
A common data-modeling mistake is to treat delisting as a simple deletion from the asset directory.
A more informative approach is to maintain an event table.
events = pd.DataFrame([
{
"asset": "ALT_A",
"event": "TRADING_PAIR_DELISTED",
"exchange": "EXCHANGE_A",
"effective_at": "2023-06-15",
"reason": "Trading pair removal"
},
{
"asset": "ALT_B",
"event": "TRADING_SUSPENDED",
"exchange": "EXCHANGE_A",
"effective_at": "2022-11-10",
"reason": "Trading suspension"
}
])
events["effective_at"] = pd.to_datetime(
events["effective_at"]
)
This distinction matters because a trading pair can disappear without the underlying token becoming worthless.
A token may continue trading elsewhere, migrate to a replacement contract, or remain withdrawable after exchange trading ends.
The event table should therefore preserve:
- Exchange identity.
- Asset identity.
- Trading-pair identity.
- Event type.
- Effective timestamp.
- Announcement timestamp.
- Documented reason.
- Available exit or conversion information.
For strict point-in-time research, the announcement timestamp also matters.
A delisting decision may be announced before it becomes effective, and a strategy may respond to that information before the final trading date.
5. Compare survivor-only and historical universes
The next step is to compare two portfolio constructions.
One uses the historical universe.
The other uses only assets that remain active at the end of the sample.
end_date = pd.Timestamp("2024-01-01")
survivors = assets[
assets["delisted_at"].isna()
|
(assets["delisted_at"] > end_date)
]["asset"].tolist()
historical = universe_at(
assets,
"2022-01-01"
)
print("Historical universe:", historical)
print("Survivor-only universe:", survivors)
This comparison illustrates how retrospective asset filtering changes the investment universe.
It does not yet calculate a valid strategy return.
For that, the researcher must also define the portfolio weights, rebalancing schedule, transaction costs, asset returns, and actual delisting treatment.
6. Calculate portfolio performance consistently
For a portfolio with asset weights (w_i) and asset returns (r_i), a simple one-period portfolio return is:
[
R_p=\sum_i w_i r_i
]
The weights should be calculated using only information available at the portfolio formation time.
The following example uses a simplified equal-weighted portfolio.
def equal_weight_return(returns):
returns = returns.dropna()
if returns.empty:
return None
weights = 1 / len(returns)
return (weights * returns).sum()
example_returns = pd.Series({
"BTC": 0.20,
"ETH": 0.40,
"ALT_A": -0.40,
"ALT_B": -1.00
})
portfolio_return = equal_weight_return(
example_returns
)
print("Portfolio return:", portfolio_return)
This example assumes that all four assets were held over the same measurement period, with an equal initial allocation and a final value of zero for ALT_B.
In an actual delisting study, that zero-value assumption must be supported by the documented economic outcome.
It is not appropriate to assign zero automatically to every delisted trading pair.
The model should instead distinguish the last executable exit opportunity, residual asset value, conversion arrangements, and transaction costs.
7. Check for look-ahead bias
Point-in-time universe construction is only one part of avoiding historical information leakage.
A backtest should also verify that:
- Asset rankings use data available before the decision time.
- Volume filters do not use future observations.
- Delisting information is timestamped correctly.
- Rebalancing uses the actual decision schedule.
- Price data are not retrospectively revised without disclosure.
- Missing delisting outcomes are not silently removed.
For KAEL AI's quantitative research, these checks are particularly relevant when training models to rank digital assets or identify market opportunities.
A model cannot learn a reliable historical selection process if its training universe has already been filtered using future survival information.
Conclusion
Survivorship bias is not simply a missing-price problem.
It is a problem of reconstructing what the market actually contained at each historical decision point.
A more reliable backtesting framework needs historical asset directories, listing and delisting events, point-in-time eligibility rules, and documented terminal outcomes.
Python can help organize and test these components, but the quality of the results still depends on the completeness and accuracy of the underlying historical records.
A credible backtest must preserve the assets that disappeared, not just the assets that remain.
Research reference
Ammann, M., Burdorf, T., Liebi, L., and Stöckl, S. (2022). Survivorship and Delisting Bias in Cryptocurrency Markets.
Top comments (0)