Glossary#
Here you can find terminology used in the documentation, decentralised finance and algorithmic trading.
- Aave#
In decentralised finance, Aave is one of the largest decentralised lending protocols and credit markets.
Aave was started in 2017 under EthLend name. Aave means a ghost in the Finnish language. The latest version, Aave v3, was launched in 2023. Aave has an ERC-20 token AAVE.
As the writing of this, Aave has been deployed several blockchains, including Ethereum, Polygon, Arbitrum and Optimism.
Aave has a protocol subset for real-world assets (RWAs) called Aave Arc.
See also
- Active strategy#
Active strategy in relation to algorithmic trading refers to a type of investment or trading approach that uses algorithms to make regular, data-driven decisions about buying and selling assets. This approach is designed to generate higher returns and outperform passive investment strategies.
Active strategies in algorithmic trading differ from passive strategies, which simply follow the market and hold assets for the long-term, in that they actively seek to generate higher returns through regular buying and selling of assets. This can involve taking advantage of short-term market movements, or making trades based on a variety of market indicators and economic data.
See also
- Aggregate return#
Aggregate returns in portfolio refer to the percentage difference from period to period of the value of a portfolio.
It is calculated by taking the change in the value of the portfolio and expressing it as a percentage of the original invested amount. This generates a time series of interim net asset values.
- Airdrop#
In decentralised finance, airdop is a method to distritube tokens for the project users for free.
The goals of an airdrop include making the protocol more decentralised and rewarding the users. The airdrop involves sending tokens or making them claimable to the users through a Merkle tree method.
Historically famous airdrops include Uniswap, Optimism and Juno.
Liquidity mining is somewhat similar mechnanism to airdrop.
See also
- Algorithmic trading#
Algorithmic trading is a method of executing orders using automated pre-programmed trading instructions accounting for variables such as time, price, and volume.
It involves making trading decisions based on pre-set rules that are programmed into a computer. Python is often used for algorithmic trading due to its ability to handle complex calculations and its flexibility. Algorithmic trading strategies can be used to find potential trades and optimise the timing of trades.
Developing algorithmic trading strategies is called backtesting.
See also
- Alpha#
In quantitative finance, “alpha” refers to a measure of an investment strategy’s performance compared to a benchmark index, after adjusting for risk. It represents the excess return generated by the strategy beyond what would be expected based on its level of risk. Alpha is often used to assess the skill or effectiveness of portfolio managers, traders, or investment strategies in generating returns.
Mathematically, alpha is typically calculated using the Capital Asset Pricing Model (CAPM) or similar models that relate an asset’s return to its level of risk. In these models, alpha is the intercept term of the regression equation, representing the excess return not explained by the systematic risk factors.
Positive alpha indicates that the trading strategy has outperformed the benchmark, while negative alpha suggests underperformance.
Alpha is a crucial concept in quantitative finance, as it helps investors evaluate the effectiveness of their investment decisions and identify sources of added value beyond market movements.
See also
- Alpha generation platform#
In quantitative finance, alpha generation platform is a technology used in algorithmic trading to develop quantitative financial models, or trading strategies, that generate consistent returns.
Alpha generation platforms are tools used by hedge funds, banks, CTAs and other financial institutions to help develop and test quantitative trading strategies. Alpha generation platforms support quants in the creation of efficient and productive quantitative trading strategies.
See
:term:`Trading strategy
- Alpha model#
An alpha model is a mathematical or quantitative framework used to generate trading signals that can be used in portfolio construction.
The alpha model seeks to identify assets that are likely to outperform or underperform their peers, based on a variety of factors and variables.
Alpha models can be constructed using a variety of techniques, such as statistical analysis, machine learning algorithms, or financial modeling. The inputs to an alpha model may include company financial statements, price and volume data, macroeconomic indicators, and other market data.
Once an alpha model generates trading signals, the portfolio manager can use those signals to construct a portfolio that aims to generate alpha (i.e., excess returns) relative to a benchmark index. The portfolio manager may use other tools, such as risk management techniques or diversification strategies, to manage portfolio risk and optimize performance.
It is important to note that alpha models are not foolproof and can be subject to various biases and errors. As such, portfolio managers must continually test and refine their alpha models to ensure that they are producing accurate and robust trading signals.
See also
- Alpha signal#
In quantitative finance and portfolio construction, an alpha signal refers to a metric or indicator used to identify investments that are likely to outperform the broader market. Alpha signals can be derived from a variety of sources, including fundamental analysis, technical analysis, and quantitative models. Portfolio construction is a specific type of :term:``trading strategy`.
Alpha signals are also known as trading signals.
The goal of using an alpha signal is to identify securities that are undervalued or overvalued compared to their peers, and to use that information to construct a portfolio that generates excess returns (i.e., alpha) relative to a benchmark index.
Examples of alpha signals include measures of company profitability, earnings growth, price momentum, and valuation ratios. A portfolio manager may use one or more alpha signals to construct a portfolio that is expected to outperform the benchmark index.
Some of the common alpha signals include
Trading pair momentum, or the raw price movement
Machine learning-based indicators extracted from OHLCV market data
Alternative data sources and their derivatives
When alpha signals of different industry verticals are compared, it is called factor investing.
See also
- Alternative data#
In quantitative finance, Alternative data refers to non-traditional data sources that are used by investors and businesses to gain insights into markets, industries, and consumer behavior. This data is often sourced from digital platforms and devices, such as social media, mobile devices, sensors, and web traffic.
Alternative data can provide a wealth of information that is not available through traditional data sources, such as financial statements and economic indicators. For example, social media data can be used to gauge consumer sentiment and preferences, while satellite imagery can be used to track changes in physical assets like inventories or construction sites.
Alternative data is often used in conjunction with traditional data sources to gain a more complete understanding of market trends and consumer behavior. By leveraging alternative data sources, investors and businesses can make more informed investment and business decisions, and gain a competitive edge in their respective markets.
See also:
- AMM#
Automated market maker (AMM) is a bonding curve based decentralised exchange.
An automated market maker (AMM) is a type of decentralised exchange (DEX) protocol that uses algorithmic smart contracts to make it easy for individual traders to buy and sell crypto assets. Instead of trading directly with other people as with a traditional order book, users trade directly through the AMM. AMMs facilitate the decentralised exchange of digital assets using liquidity pools rather than conventional market order books.
AMMs can be often seen as the opposite of order book markets. In an AMM, the user is trading against liquidity pool.
AMMs can be
Bonding curve based using XY liquidity model.
CLMM based using concentrated liquidity model
Example AMMs include Uniswap, Curve, Sushi, Trader Joe.
See also
- Annual Percentage Rate (APR)#
APR stands for Annual Percentage Rate in quantitative finance. It is a standardized way of expressing the cost of borrowing money or the return on investment over a yearly basis. In quantitative finance, APR is commonly used in various financial instruments such as loans, mortgages, credit cards, and investment products.
In trading Compound Annual Growth Rate (CAGR) is more commonly used. APR is used for loans, delta neutral trading strategies and yield farming in decentralised finance.
APR does not account compounding interest, unlike Annual Percentage Yield (APY).
See also
- Annual Percentage Yield (APY)#
APY stands for Annual Percentage Yield in quantitative finance. It is a measure used to represent the effective annual rate of return or the annualized rate of interest earned on an investment or deposit, taking into account the effect of compounding interest.
Unlike Annual Percentage Rate (APR), which only considers the nominal interest rate, APY factors in the compounding frequency of interest payments. This means that APY reflects the total amount of interest earned or paid over a year, including the effect of reinvesting interest earnings or paying interest on previously earned interest.
APY is particularly useful for comparing the true returns of different investment or deposit options, as it provides a standardized way of expressing the annualized rate of return while accounting for compounding. It allows investors to make more informed decisions about where to allocate their funds based on the actual returns they can expect to earn.
In trading Compound Annual Growth Rate (CAGR) is more commonly used. APY is used for loans, delta neutral trading strategies and yield farming in decentralised finance.
See also
- Apache Arrow#
Apache Arrow is an open-source, cross-platform columnar data format that is used for storing and processing large amounts of data efficiently. It was designed to address some of the performance and scalability challenges associated with traditional row-based data storage and processing methods.
Arrow provides a common format for storing data, which can be used across multiple platforms and programming languages, including C++, Java, Python, and R. This allows for faster data processing and improved performance, as data can be shared and processed efficiently between different applications and systems.
In addition to its performance benefits, Arrow also provides a number of other advantages, such as support for a wide range of data types and low overhead. This makes it well-suited for use in big data and analytics applications, as well as other data-intensive projects with large datasets.
See also
- API key#
API key is an authentication method for machine-to-machine communications.
API keys are usually needed with HTTP based API services.
Blockchain and decentralised finance protocols do not need API keys, because the authentication happens with public key cryptography and wallets.
- App Chain#
An App Chain, also known as an application-specific blockchain, is a blockchain that is exclusively designed to operate one specific application.
App Chain eliminates competition for resources away from everyone else using the chain, allowing for greater scalability and flexibility
Popular app chains include
DyDx decentralised futures exchange
Vega Protocol exchange
Stargaze NFT chain on Cosmos
Swimmer Network - the app chain for Crabada idle-game
See also
- APR#
- APY#
- Arrow#
See Apache Arrow.
- Auto-compounding#
Auto-compounding is a trading strategy in which the investors’s investment yields are automatically reinvested into the investment principal at regular intervals. This is called :compound.
Auto-compounding strategies are benchmarked using metrics having compounding factored in
Compounding is a powerful investing concept that involves earning returns on both the original investment and on returns received previously.
See also
- Automated trading strategy#
Automated trading strategies are computer programs that follow a defined set of instructions to execute trade orders.
Common automated trading strategies include moving average cross strategies, which buy when the stock price rises above the moving average and sell when it falls below, and trend-following strategies, which follow the mainstream trends and momentum in the market.
See also
- Autonomous agent#
An autonomous agent is a software program or system that can operate independently and make decisions on its own, without direct intervention from a human. This type of technology is designed to perform specific tasks or functions, such as data processing, problem-solving, decision-making, and even physical actions.
Autonomous agents typically use artificial intelligence (AI) and machine learning algorithms to analyse data, make decisions, and interact with the environment. They are designed to work in complex, dynamic environments, and can respond to changes in real-time.
See also
Decentralised finace
- Avalanche#
Avalanche is a blockchain based on Avalanche consensus protocol.
Avalanche supports subnets, where each subnet is partially independent blockchain having its own properties. Some subnets, like Avalanche C-Chain are EVM-Compatible. Some subnets, can be more optimised. Subnets can be also app chains.
The native token of Avalanche is AVAX. The most popular decentralised exchange on Avalanche is Trader Joe.
Popular subnets include
Avalanche C-Chain, generic EVM-Compatible chain
Dexalot - EVM-Compatible decentralised exchange chain
Swimmer Network - the app chain for Crabada idle-game
See also
- Average Directional Index (ADX)#
In quantitative finance, ADX stands for Average Directional Index. It’s a technical analysis indicator used in algorithmic trading to measure the strength and direction of a trend. Developed by J. Welles Wilder, Jr., the ADX is non-directional, meaning it does not indicate whether the price is trending up or down, but rather the strength of the trend regardless of direction.
ADX is calculated based on the spread between two directional movement indicators, typically the positive directional movement indicator (+DI) and the negative directional movement indicator (-DI). These indicators are derived from price movement over a specified period. The ADX value ranges from 0 to 100, with higher values indicating a stronger trend.
In algorithmic trading, ADX can be used in various ways, such as:
Trend Confirmation: Traders may use ADX to confirm the presence of a trend before entering a trade. A high ADX value suggests a strong trend, while a low value indicates a weak or sideways market.
Trend Strength: ADX values can help traders assess the strength of a trend. A rising ADX suggests strengthening momentum, while a falling ADX may indicate a weakening trend.
Trend Reversals: Changes in the direction of the ADX line can signal potential trend reversals. For example, if the ADX has been rising but starts to decline, it may indicate that the current trend is losing strength.
Filtering Trades: Some algorithmic trading strategies use ADX as a filter to avoid trading in choppy or range-bound markets. They may only take trades when the ADX is above a certain threshold, indicating a trending market.
Overall, ADX is a versatile tool in algorithmic trading that helps traders assess the strength and direction of trends, allowing for more informed trading decisions.
See also:
- Average True Range (ATR)#
In quantitative finance, ATR stands for Average True Range. It’s another popular technical indicator used in algorithmic trading to measure volatility in the market. Developed by J. Welles Wilder, Jr., ATR is calculated based on the true range of price movement over a specified period.
The true range is the greatest of the following:
The difference between the current high and the current low.
The difference between the previous close and the current high.
The difference between the previous close and the current low.
ATR is then calculated as the average of these true ranges over the specified period, typically 14 periods.
In algorithmic trading, ATR has several applications:
Volatility Measurement: ATR provides a measure of market volatility. Higher ATR values indicate higher volatility, while lower values suggest lower volatility.
Setting stop loss and Take Profit Levels: Traders can use ATR to set dynamic stop loss and take profit levels based on the current volatility of the market. For example, they may set stop losses a certain number of ATR units away from the entry price to account for market fluctuations.
Position sizing: ATR can be used to adjust position sizes based on market volatility. In highly volatile markets, traders may reduce their position sizes to manage risk, while in low volatility markets, they may increase position sizes to take advantage of potential larger moves.
Filtering Trades: Some trading strategies use ATR as a filter to only take trades when volatility is above or below a certain threshold. This helps traders avoid entering trades in excessively volatile or quiet market conditions.
See also:
- Backtest#
Backtesting is simulating the efficiency of a trading strategy against historical data.
Backtesting is the process of analysing historical market data to see how a trading strategy would have performed statistically in the past. It is a key component of effective trading system development and can be used to test a trading hypothesis/strategy on the historical data. Backtesting results are then benchmarked against each other and indices like SP500, Bitcoin price. Backtesting results are often too promising due to overfitting. It can be always assumed that the live trading performance is worse than the strategy backtested results.
Backtesting is usually performed by specialised tool, or a backtesting framework written in some programming language. Different backtesting frameworks offer compromises between speed (how many combinations you can test and how fast), complexity (single pair. vs multi pair vs. portfolio construction strategies), supported market data and supported trading activities (volatility-based, debt-based, etc.)
Trading Strategy Framework is one of the backtesting frameworks for Python, designed for decentralised finance. TradingView’s Pine Script is the most well-known backtesting framework in the world.
Backtesters can be implemented in two ways, making a compromise with the speed of backtesting vs. how complex the strategy logic can be:
Vectorised: quickly compare thousands of grid search options using parallel computation. Popular Python-based vectorised backtesting frameworks include Moonshot, VectorBT. To speed up computation, vectorised framework sometimes need to compromise with realism of the results. Vectorised frameworks can also easily utilise machine learning.
Event-driven: support complex decision making process and logic for the trade decisions. Event-driven approach usually enables easier re-use of the strategy code between backtesting and live trade execution. One popular Python-based event-driven backtesting framework is Zipline. Read more about event-driven logic here.
Here is more about compromised between vectorised and event-driven frameworks.
See the list of Python backtesting frameworks.
See also
- Backtrader#
An old Python based algorithmic trading framework for strategy backtesting and live execution. No longer maintained.
- Base blockchain#
Base is a layer two EVM-compatible blockchain from Coinbase.
Base does not have its own token. Native token of base is Ether.
See also
- Base token#
In the context of quantitative finance and algorithmic trading, a base token refers to the primary token or asset used in a specific trading pair or exchange. The base token is the token that is being traded or exchanged for another token, typically a quote token, see also quote token. For example, in the trading pair BTC/USD, BTC is the base token and USD is the quote token. The price of the quote token is quoted in terms of the base token.
The base token is an important concept in the cryptocurrency market, as it determines the value of the other token in a trading pair. In other words, the price of the quote token is derived from the price of the base token. This relationship between the base token and the quote token is used to determine the price of the quote token, which can then be used to determine the value of other assets that are pegged to it.
For example trading pair can be: BTC-USDT. In this case the base token BTC and quote token is USDT.
Note
If you are looking information about Base blockchain, Base does not have a token.
See also
- Bear market#
A bear market is a condition in the stock market where the overall trend is downward and prices are falling. It is characterised by widespread pessimism and negative investor sentiment, leading to a decrease in the prices of securities. In a bear market, most asset classes tend to decline, and it can last anywhere from a few months to several years. During a bear market, it is common for investors to sell their holdings, leading to further declines in prices. The opposite of a bear market is a bull market, where prices are rising and investor sentiment is positive. Bear markets can be caused by various factors, such as economic recession, high unemployment, and declining corporate earnings.
- Benchmark#
In quantitative finance, benchmarking is comparing different portfolios or trading strategies against each other.
The comparison examines
Fees paid or generated
Common comparison methods include
Equity curve comparison
Volatility risk-based and risk-adjusted metrics like Sharpe and Sortino ratios
Benchmark can compare
Different trading stragies to each other
Different portfolios to each other
Strategies and portfolios to a trading pair buy and hold performance
See also
- Best trading algorithm#
- Best trading strategy#
The best trading strategy is one that makes most excessive profit, or alpha, for the least risk.
Depending on the the market situation and available trading pairs, the current best trading strategy can vary day by day, or depending whether the markets are in bull market or bear market. Also, depending on the trader risk apetitve
A trading algorithm can generally yield 5% - 300% yearly profit depending on the amount of deployed capital and the market size. The goal is to beat risk-free rate, with risk-adjusted return having profits enough to cover any volatility or other risk taken.
In quantitative finance, different trading strategies can be objectively compared based on their performance metrics. Some usual ways to benchmark include:
Risk-adjusted return, like Sharpe and Sortino ratios
See also
- Bid-Ask Spread#
The bid-ask spread is the difference between the highest price a buyer is willing to pay for an asset (the bid) and the lowest price at which a seller is willing to sell (the ask). It serves as a measure of the asset’s liquidity and is a cost that traders have to consider when entering and exiting positions.
Example: If the bid price for a stock is $50 and the ask price is $51, the bid-ask spread is $1.
Usage: The bid-ask spread is important for traders and investors as a narrower spread generally indicates higher liquidity and lower transaction costs, while a wider spread can signify the opposite.
See also
- Blockchain snapshot#
A chain snapshot is a dump of the chain state. By downloading the snapsnot a new blockchain node can sync faster to the chain tip, instead of downloading each block and verifying each transaction individually from the peer-to-peer network.
The snapshot may be
Chain built-in sync mechanism: Ethereum Snapshot Protocol (SNAP)
Manually hosted snapshot: Polygon manually hosted snapshot downloads
Different snapshots offer different security guarantees. For example, when downloading a snapshot from a Polygon manually hosted snapshot repository, you trust that the admins of this repository have not modified the current historical blockchain state. The built-in Ethereum Snapshot Protocol verifies from the peer-to-peer network that the snap state is correct.
How much snapshot speeds up the node sync depends on what kind of node you want to run: full node without event history, a full node with event history or archive node. For example, even with a snapshot syncing a BNB Chain full node with event history will take several weeks, because Erigon needs to construct the historical events from the raw blocks after the download, as historical events are not precomputed in the snapshot.
- BNB Chain#
See BNB Smart Chain.
- BNB Smart Chain#
BNB Smart Chain is an EVM-Compatible blockchain from the Binance cryptocurrency exchange. It is called as BNB Chain, though these two are separate.
BNB Smart Chain is a direct fork of Ethereum.
BNB Smart Chain offers good interaction with the Binance cryptocurrency exchange (CEX), making it attractive for the users of this exchange. As of the writing of this, Binance has a 70% market share of the cryptocurrency trading volume, making it very dominant in the blockchain industry.
BNB Smart Chain is based on centralised, proof-of-authority. model. BNB Chain was recently halted in a hack. It uses BNB token as its native token.
The dominating decentralised exchange on BNB Chain is PancakeSwap.
See also
- Bollinger bands#
Bollinger Bands are a technical analysis indicator used to measure market volatility and identify potential buying or selling opportunities. The indicator consists of a set of three lines plotted on a price chart, with the middle line being a simple moving average of the security’s price, and the upper and lower bands serving as a measure of volatility, typically set 2 standard deviations away from the moving average.
In a market with low volatility, the Bollinger Bands will be closer together, while in a market with high volatility, the bands will be further apart. When prices move outside the upper band, it can be a sign that the security is overbought, and a potential selling opportunity, while a move below the lower band can indicate that the security is oversold and a potential buying opportunity.
Bollinger Bands are widely used by traders and investors in making investment decisions, as well as in setting stop-loss orders and determining potential profit targets.
Read technical deep dive into Bollinger Bands.
See also
- Bonding curve#
In a bonding curve based exchange, like an AMM, market makers do not set limit orders to provide liquidity. Instead, the liquidity follows a predefined mathematical function. Every time there is a buy or a sell, the price moves up or down defined by this function.
Read more about xy=k curve slippage, price impact on Paradigm’s post.
See also: XY liquidity model.
- Bucket#
The (time) bucket to a time period for candle data. It is also known time frame by some systems.
For example, you can have one minute, one hour or time buckets, describing for the what period of a time the candle includes the trades.
Also known as time frame, candle length or candle duration.
See also
- Bull market#
A bull market is a condition in the stock market where the overall trend is upward and prices are rising. It is characterised by widespread optimism and positive investor sentiment, leading to an increase in the prices of securities. In a bull market, most asset classes tend to rise, and it can last anywhere from a few months to several years. During a bull market, it is common for investors to buy assets, leading to further price increases. The opposite of a bull market is a bear market, where prices are falling and investor sentiment is negative. Bull markets can be driven by various factors, such as a strong economy, low unemployment, and rising corporate earnings.
- Buy and hold#
In quantitative finance, a buy and hold trading strategy is to buy an asset and not sell it ever, or for a long period of time.
In cryptocurrency trading, this kind of trading strategy is called “diamond hands.”
The benefit of this kind of strategy is that you are not paying any trading fees. Holding an asset is usually free.
Even if you never sell the asset, you can use it as collateral and borrow money against it.
On of the most famous diamon hands are Michael Saylor and his company MicroStrategy that are only buying more and more bitcoin since 2019.
See also
- CAGR#
- Candle#
Candle, or a candlestick is a type of price chart used in technical analysis that displays the high, low, open, and closing prices of an asset for a specific time period, or bucket.
More information on Wikipedia.
See also
- Carried interest#
In quantitative finance, carried interest refers to a share of profits or investment gains that are allocated to investment managers or general partners in certain types of investment funds, particularly private equity funds, venture capital funds, and sometimes hedge funds. It represents a portion of the fund’s profits that the manager or general partner is entitled to receive as compensation.
Carried interest is typically structured as a profit-sharing arrangement. It is distributed to the investment manager or general partner after the fund’s investors, also known as limited partners, have received a predetermined return on their investments, often referred to as the hurdle rate or preferred return. The manager or general partner receives a share of any profits above this hurdle rate, usually a percentage ranging from 10% to 30%.
The term “carried interest” derives from the concept that the investment manager or general partner carries an interest in the fund’s profits, in addition to their capital investment. The carried interest serves as an incentive for the manager to maximize the fund’s performance and generate strong investment returns, as their compensation is directly tied to the success of the investments.
Because carried interest is not exited or liquidated, it is more tax efficient there are no capital gains for holding.
See also:
- Carry trade#
See cash and carry.
- Cash and carry#
In quantitative finance, a “cash and carry trade” refers to a strategy where an investor simultaneously buys an asset and sells (or “carries”) a related derivative contract. This trading strategy is typically employed when the asset is expected to appreciate in value over time, and the investor seeks to profit from the price difference between the asset and its derivative.
This trade can be also known as carry trade and spot-forward basis.
Cash and carry trades are commonly used in markets where futures or forward contracts are actively traded and where there are opportunities for arbitrage or speculation based on expected price movements.
In cryptocurrency markets, the most popular carry trade is to hold spot cryptocurrency (Bitcoin, Ether), against the similar sized short perpetual contract, creating a delta neutral position. Ethena popularised this strategy by creating a USD stablecoin out of this. Because in perpetual markets, short pays longs, longs pays short, a in a bull market, Ethena trade earns interest on its open short position from traders that have the opposite long position open. Ethena also earns additional yield in the staking rewards of its staked Ether.
See also
- CEX#
CEX is an acronym for a centralised cryptocurrency exchange.
It is the opposite of DEX. In a centralised cryptocurrency exchange, the exchange takes custody of your assets in a non-transparent manner. You are 100% trusting that the exchange does not have technical issues or fraud issues when it comes to managing your assets.
- CLMM#
CLMM stands for Concentrated Liquidity Market Maker.
CLMM is a form of AMM. CLMMs provide more capital-efficient liquidity on a DEX.
CLMM protocol allows liquidity providers to set specific price ranges, add single-sided liquidity and do range order trading, similar to order books.
See also
- Clone#
Fork is a a product launched based on the open source code of another existing product. Also known as fork.
See fork for details.
- Closed position#
A closed position in finance and trading refers to a trade that has been completed by taking an action that is the opposite of the initial transaction. This means selling assets in a long position or buying back assets in a short position, thereby neutralizing the market exposure and locking in any realized gains or losses.
- Composability#
Composability in decentralised finance refers to the ability of different financial protocols or applications to seamlessly interact and interoperate with each other. In the context of DeFi, financial primitives such as lending, borrowing, trading, and yield farming are often implemented as separate protocols or smart contracts. Composability allows these protocols to be combined or “composed” in various ways to create more complex and sophisticated financial services.
Here are some key aspects of composability in DeFi:
Interoperability: DeFi protocols are designed to be interoperable, meaning they can communicate and interact with each other without friction. This allows developers to combine different protocols to create new financial products and services.
Building Blocks: DeFi protocols are often modular, meaning they can be used as building blocks to construct more complex applications. For example, a lending protocol can be combined with an automated market maker (AMM) to create a decentralized exchange with lending functionality.
Composable Assets: Composability extends beyond protocols to the assets themselves. Many DeFi tokens and assets are designed to be composable, meaning they can be used as collateral, traded, or otherwise interacted with across different protocols.
Permissionless Innovation: Composability enables permissionless innovation, allowing developers to experiment and build new financial products without needing approval from centralized authorities. This has led to a rapid pace of innovation in the DeFi space.
See also:
- Compound#
In quantitative finance, compounding returns refer to the process of reinvesting profits or earnings generated from a trading strategy back into the itself. It involves earning returns not only on the initial investment but also on the accumulated earnings from previous periods.
When returns are compounded, they have the potential to grow exponentially over time, thanks to the compounding effect. The compounding effect arises from reinvesting the returns, allowing them to generate additional returns in subsequent periods. As the investment grows, the compounding effect becomes more significant, leading to accelerated growth over the long term.
To illustrate the concept, consider an investment with an annual return of 10%. If the returns are compounded annually, the initial investment will grow by 10% each year. However, if the returns are compounded more frequently, such as quarterly or monthly, the growth rate will be higher due to the reinvestment of earnings more frequently. This compounding effect can be especially powerful when investing over long periods.
The compounding effect is commonly observed in various investment vehicles, such as stocks, bonds, mutual funds, and other financial instruments. It is an essential concept in quantitative finance as it influences the calculation of investment performance, risk assessments, and the determination of investment strategies.
When analyzing investment performance or projecting future returns, it is crucial to consider the impact of compounding. Investors often use compound interest formulas or specialized software to calculate and project the compounded returns based on the investment’s expected growth rate and compounding frequency.
Common benchmark metrics that deal with compound include
If an automated strategy does compounding it is called auto-compound strategy.
See also
- Compound Annual Growth Rate (CAGR)#
CAGR, or Compound Annual Growth Rate, is a financial metric that measures the average annual growth rate of an investment over a specified period of time, typically longer than one year. It provides a smoothed-out view of an investment’s performance by accounting for compounding effects. In quantitative finance, CAGR is used to compare performance of different portfolios. CAGR does not account for investment risk.
Here’s how to calculate CAGR:
Beginning Value (BV): Determine the value of the investment at the start of the period.
Ending Value (EV): Find the value of the investment at the end of the same period.
Number of Years (n): Calculate the total number of years in the investment period.
Divide the ending value by the beginning value.
Raise the result to an exponent of one divided by the number of years.
Subtract one from the subsequent result.
Multiply by 100 to express the answer as a percentage.
The CAGR represents the hypothetical constant annual growth rate that would lead to the same final value if the investment grew at that rate every year and profits were reinvested annually. It’s important to note that this smooths out variations in returns and provides a more easily understandable comparison across different investments.
For example, let’s say you invested $10,000 in a portfolio with the following returns:
From Jan. 1, 2018, to Jan. 1, 2019: Portfolio grew to $13,000 (30% in year one). From Jan. 1, 2019, to Jan. 1, 2020: Portfolio was $14,000 (7.69% growth). From Jan. 1, 2020, to Jan. 1, 2021: Portfolio ended at $19,000 (35.71% growth).
While the annual growth rates varied significantly, the CAGR over the entire period would be approximately 23.86%1.
See also
- Continuous trading#
A continuous trading strategy, often referred to as a continuous execution strategy, is an approach to trading that involves making ongoing trades throughout the trading day or over extended periods, rather than executing trades at specific, predetermined times. Here are the key aspects:
Ongoing execution: Trading positiosn are rebalanced at frequent intervals, often using automated systems.
Algorithmic implementation: These strategies typically rely on computer algorithms to analyze market data and execute trades based on predefined rules.
Adaptability: The strategy continuously adjusts to market conditions, aiming to take advantage of small price movements or market inefficiencies.
Volume management: Often used to execute large orders by breaking them into smaller pieces to minimize market impact.
Risk management: Continuous monitoring and adjustment of positions to manage risk exposure.
The opposite of continuous trading is discrete trading.
Continuous trading strategies are commonly used by institutional investors, high-frequency traders, and some advanced individual traders. They require sophisticated technology and often aim to profit from small but frequent opportunities in the market.
Continuous trading and portfolio construction are related:
Dynamic rebalancing: Continuous trading allows for ongoing portfolio adjustments, helping maintain desired asset allocations as market conditions change.
Risk management: It enables real-time monitoring and adjustment of portfolio risk exposures.
Implementation of complex strategies: It facilitates the execution of more sophisticated portfolio strategies that require frequent adjustments.
Liquidity management: Continuous trading can help manage portfolio liquidity by spreading trades over time, especially for large positions.
See also:
Technical indicator-based strategies
- Credit market#
Credit markets are a key component of the financial system where various forms of debt are traded. Credit markets facilitate the buying and selling of debt instruments and loans.
Typical credit markets include:
Bond markets (government and corporate)
Loan markets (bank loans, syndicated loans)
Money markets (short-term debt instruments)
Credit markets participants contain:
Borrowers (governments, corporations, individuals, traders)
Lenders (banks, institutional investors, individual investors)
Intermediaries (brokers, dealers)
Credit markets provide financial market functionality like:
Provide capital to borrowers
Offer investment opportunities for lenders
Determine interest rates based on supply and demand
Facilitate risk transfer
Offer leverage for traders
Allow to hedge trading positions to make delta neutral trading strategies, often needed for market making and providing deeper liquidity
In decentralised finance, lending protocols take some of the role of credit markets.
See also:
- Cross validation#
Cross-validation is a technique for evaluating the performance of a predictive model by testing it on a subset of data that was not used to train the model. It is a method for assessing how well the model generalizes to new data.
Cross-validation is a common practice in machine learning and statistical modeling. It is used to assess the predictive accuracy of a model and to detect overfitting, which occurs when a model performs well on the training data but does not generalize well to new data.
The process involves splitting the dataset into two subsets: a training set and a test set. The model is trained on the training set and then evaluated on the test set. The results are compared to determine how well the model performs on new data.
Cross-validation can be used to compare different models or to tune the parameters of a model. It can also be used to select the best features for a model or to determine the optimal number of features.
See also
- Crystallisation#
In quantitative finance, “crystallisation” typically refers to the process by which the value of a fund investment is determined or realized. It involves calculating the net asset value (NAV) of the fund and providing investors with a clear picture of their investment’s worth.
Crystallisation in funds occurs at specific intervals, such as daily, weekly, monthly, or quarterly, depending on the fund’s valuation frequency. At these intervals, the fund’s assets are evaluated, and the NAV per share or unit is calculated. The NAV represents the total value of the fund’s assets minus its liabilities, divided by the number of outstanding shares or units.
Investors use the crystallized NAV to assess the value and performance of their fund investments. It allows them to understand the current worth of their holdings and make informed decisions regarding buying, selling, or redeeming fund shares.
Crystallisation is particularly significant in open-end mutual funds and exchange-traded funds (ETFs) where shares can be bought or sold on a regular basis. It provides transparency and liquidity to investors by ensuring that the value of their investments is regularly determined and accessible.
It’s important to note that crystallisation in funds does not refer to the same process as crystallisation in investments, where it signifies the realization of gains or losses. Instead, in the fund context, it pertains to the determination of the fund’s value for the benefit of investors.
See also:
- CSV#
CSV, or comma-separated values, is a file format that stores tabular data in plain text. It is a common format for storing data in spreadsheets and databases. It is also a common format for exchanging data between applications.
CSV files are typically used to store data in a tabular format. Each line in a CSV file represents a row in a table, and each column in a row represents a field in the table. The fields are separated by commas, and the rows are separated by newlines.
CSV files are often used to store data in a tabular format. They are also used to exchange data between applications.
See also
- Cumulative profit#
In quantitative finance, cumulative profit tells the overall profit of trading strategy over a time.
Cumulative profit is the excess of net income and gains over net losses, determined on a cumulative basis from the inception of an investment fund through to its termination date. It includes realized trading P&L, positions open P&L, and other total profits or losses generated since the trading strategy’s inception.
As trading strategies reinvest earlier profits, the cumulative profit compounds.
Cumulative profit is expressed as % of yearly gains, as:
Compound Annual Growth Rate (CAGR) (volatile trading)
Annual Percentage Yield (APY) (loans, delta neutral strategies)
To calculate cumulative profit, one must add together all net profit numbers over a specific time frame.
If a trading strategy automatically reinvests its profits to itself, it is called auto-compounding.
See also
- Cumulative return#
Cumulative return is the total change in the investment price over a set time, taking into account reinvested dividends or capital gains. It allows for investors to measure the performance of an investment over a certain period of time. It is is distinct from annualized return which measures the rate of return over a given period of time.
Cumulative return is calculated by taking the gain (or loss) of the investment over a certain time period and dividing it by the principal value of that investment. It can also be calculated using the standard returns of each period, where Rc = (1 + R1)(1 + R2) - 1.
- Curl#
cURL (Client URL) is a command-line tool that enables data exchange between a device and a server through a terminal. It provides a library (libcurl) and command-line tool (curl) for transferring data using various network protocols. cURL commands allow users to transfer data without user interaction using supported libcurl libraries[5]
- Custodial#
A custodial service in cryptocurrency refers to a third-party company or service that holds and manages the private keys associated with a user’s cryptocurrency assets. The private keys are used to access and control the user’s cryptocurrency holdings, so entrusting them to a custodial service offers increased security and convenience compared to holding them on an individual’s own device or exchange.
In a custodial setup, the user’s cryptocurrency assets are stored on the custodian’s servers and the user can access and manage their assets through the custodian’s platform. This can be useful for individuals or institutions who are concerned about the security of their assets or who do not have the technical expertise to manage their own private keys.
Custodial services typically offer a variety of features such as multi-signature authorization, offline storage, and insurance for the assets in their care. However, it is important to note that custodial services also come with some risks, as the user is relying on the security and reliability of the custodian to protect their assets. Additionally, users must trust the custodian to act in their best interests and to follow the appropriate procedures and regulations in the event of a security breach or other issue.
As such, it is important for users to carefully consider the reputation and track record of a custodial service before entrusting their assets to them, and to ensure that they understand the risks and benefits associated with this type of service.
See also non-custodial.
- Cycle duration#
Cycle duration defines how often the strategy main loop triggers. This can be different from the candle bucket the strategy is using. For example, a strategy can have a cycle duration of 16h and makes trades based on 4h candles.
- Dataclass#
A dataclass is a type of class in the programming language Python that is used to define data structures. It provides a convenient and efficient way of representing structured data, such as records, tuples, or database tables. Dataclasses allow for the creation of classes with automatically generated special methods, such as the __init__, __repr__, and __eq__ methods, which are commonly used for defining classes that represent data.
With dataclasses, developers can declare fields and their types using the @dataclass decorator and the field function. This reduces the amount of boilerplate code that needs to be written and makes it easier to maintain and update the code. Additionally, dataclasses provide the ability to add default values for fields, define ordering using the order function, and customise the representation of the class using the repr function.
Dataclasses were introduced in Python 3.7 and are considered a modern and convenient way of defining data structures in Python. They can be used in a variety of applications, including data analysis, machine learning, and web development.
- Dataset#
In quantitative finance, a dataset is a data bundle consisting of candles or other quantitative data sources. The most usual dataset is hourly or daily OHLCV candles for multiple assets.
Datasets can be anywhere between megabytes to several gigabytes.
See Trading Strategy free and open datasets.
See also
- Dataset server#
The server than indexes blockchains and creates candle and other datasets for research, analysis and trade execution. Currently centralised and you need an API key to access.
- Decentralised exchange#
Decentralised exchange (DEX) is an asset trading exchange where all trades happen purely on-chain.
These exchanges are public, fair, cheap and especially censorship proof. There is no middleman like a broker when you are trading on these venues, but you get equal access to the trade flow. Users trade using their non-custodial wallets performing swaps.
A decentralised exchange is an opposite of CEX. Decentralised exchanges are always smart contract based.
Decentralised exchanges can be based on different models:
Some of the most popular decentralised exchanges are Uniswap, Sushiwap and PancakeSwap.
See also
- Decentralised finance#
Decentralised finance (DeFi) is an emerging financial technology that challenges the current centralised banking system.
Decentralised finance refers to a set of newly emerging financial products and services that operate on blockchains using cryptocurrency and smart contract technology. DeFi eliminates the fees that banks and other financial institutions charge, making it more accessible to anyone with an internet connection. Thus, decentralised finance is the opposite of traditional finance (TradFi).
Decentralised finance activities happen on-chain, and are protocol based where users connect with their wallets. The underlying concept that DeFi services are non-custodial without direct counterparty humans and intermediates make them very efficient. Different decentralised finance protocols can be effectively composed to more complex financial applications.
Decentralised finance can be seen to be a subset of web3. If decentralised finance trades real-world assets, they are called RWAs.
Example decentralised finance protocols includ decentralised exchanges, like Uniswap and lending protocols like Aave. Other famous decentralised finance protocols include Curve, MakerDAO, Compound, Euler and SushiSwap.
See also
- DeFi#
DeFi stands for Decentralised finance.
See decentralised finance for the full description.
- Delta hedged#
Delta hedging is a technique used in quantitative finance to manage risk associated with options trading.
The most popular way to delta hedge in cryptocurrency markets is perpetual futures: buy spot, short perpetuals. This is cash and carry-style trade is popularised by Ethena.
An example:
Hedging with Spot or Opposite Futures: To delta hedge, traders can use either the underlying cryptocurrency (spot market) or an opposite position in the same perpetual futures contract. For example, if you have a long perpetual futures position with a delta of 0.8, you can hedge by:
Selling 0.8 units of the underlying cryptocurrency: This reduces your overall exposure to price increases in the cryptocurrency.
Opening a short perpetual futures position with a delta of 0.8: This creates an offsetting position that profits if the price goes down, counteracting potential losses in your long position.
If the price moves too fast, delta hedging might not be enough, but you need be gamma hedged.
See
- Delta neutral#
In quantitative finance, a delta neutral trading strategy is not exposed to the volatility of underlying assets.
A delta neutral strategy, also known as market neutral strategy does not make any losses regardless if asset prices more up or down.
See also
- Demeter#
Demeter is a liquidity provision backtest framework for Uniswap, Aave and other decentralised finance protocols.
Demeter allows you to simulate high-frequency trading market making using Python code.
Demeter is good for backtesting
CLMM strategies
Delta hedged strategies (e.g. with Aave)
Gamma hedged strategies (e.g. with decentralised options market places like Aevo or Derive)
Examples of Demeter strategies are available in Trading Strategy’s Getting started repository.
See
Demeter website by Zelos Alpha
Liquidity provision
- Deterministic#
In mathematics, computer science and physics, a deterministic system is a system in which no randomness is involved in the development of future states of the system. A deterministic model will thus always produce the same output from a given starting condition or initial state.
- DEX#
DEX is an acronym for DEcentralised eXchange.
For more information see decentralised exchange description.
- Directional strategy#
A directional strategy is a type of a trading strategy that involves taking a bullish or bearish view on a particular asset or market, and then attempt to make :term`profit <cumulative profit>` on the volatility of the asset. This means that the strategy is based on the expectation of the asset or market moving in a specific direction, either up or down.
Directional strategies are typically used by traders and investors who are trying to profit from market movements. They can take various forms, including long positions (where an investor buys an asset with the expectation that its price will increase), short positions (where an investor sells an asset with the expectation that its price will decrease), or a combination of both.
Some common examples of directional strategies include trend-following, momentum trading, and breakout trading. These strategies often involve using technical analysis, fundamental analysis, or both to identify market trends, momentum, or key price levels, and to make investment decisions.
The opposite of directional strategy is market neutral strategy.
See also
- Discrete trading#
In discrete trading, a trading strategy shifts between positions in discrete, usually large and complete, steps.
Here are the key characteristics of discrete trading:
Scheduled execution: Trades are made at specific, predetermined times rather than continuously throughout the trading day.
Less frequent: Trading occurs at intervals, which could be daily, weekly, monthly, or even quarterly.
Manual intervention: Often involves more human decision-making and less reliance on automated systems.
Batch processing: Orders are often grouped and executed together at set times.
Traditional portfolio management: More commonly associated with traditional buy-and-hold strategies or periodic rebalancing approaches.
Discrete trading is the opposite of continuous trading.
Discrete algorithmic trading usually uses technical indicators thresholds to enter and exit positions fully.
See also:
Technical indicator-based strategies
- Discretionary investment management#
Discretionary management in the context of quantitative finance refers to a trading approach where human traders have the authority to make final decisions about trade execution based on their expertise and judgment, even though algorithms and automated systems might be used to generate trading signals or suggestions.
See also
- Docker#
Linux process and packaging management framework. Ideal for managing long-running server-side processes.
See Docker.com for more information.
See also
- Dollar cost averaging (DCA)#
Dollar cost averaging (DCA) is an investment strategy in which an investor divides a larger sum of money into smaller investments, made at regular intervals over a longer period of time. The goal of dollar cost averaging is to reduce the impact of market volatility on the investment portfolio by spreading out the investment over time, rather than investing the entire amount at once.
For example, an investor who wants to invest $10,000 in a stock may choose to invest $1,000 every month for 10 months, rather than investing the full $10,000 in one lump sum.
This approach can help to reduce the impact of short-term market fluctuations and allow the investor to accumulate more shares when prices are low and fewer shares when prices are high.
- Drawdown#
How much in percent terms the asset goes or can go down.
Drawdown refers to the peak-to-trough decline in the value of an investment, usually measured as the percentage of an investment’s peak value. It is a measure of the risk of an investment, as it indicates the amount that an investment can decline before it reaches a new high. Drawdown can also refer to the period of time during which an investment’s value is in decline.
See also
- EMA#
Exponential moving average. One of the most common technical indicators. By comparing the current price of an asset to the moving average price, one can determine if the current price is likely dislodged above or below the market trend.
See this post for more information on simple and exponential moving average.
See also
- Environment file#
Environment file, or env file for short, is a standard way to communicate options and arguments for a process in software development.
An environment file consists of environment variables maintained as a configuration file.
There are different environment file formats for UNIX shells, Docker, JavaScript and others. A tool like shdotenv can be used to import and convert between different formats.
Typically environment file has a file name extension .env. The best practice in JavaScript development is to have a file with name .env (no name body) that is ignored in version control and contains the secrets needed by a software developer for the local development.
See also:
- Enzyme protocol#
Enzyme is a fund back-office protocol for EVM-compatible blockchains.
Enzyme offers vaults where investors can invest to different trading strategies. Enzyme protocol is non-custodial.
Read Enzyme Finance for more information.
See also
- Equity curve#
An equity curve is a graphical representation of the change in the value of a trading account over a time period.
Equity curves are used by traders to determine the viability of their trading strategies. A good equity curve has an even slope, small and short-lived drawdowns, and a good amount of trades to make the observation statistically significant.
Equity curve trading is a methodology where a trading strategy is turned on and off based on the performance of an equity curve, which is a plot showing the growth of capital over time from one specific trading strategy or portfolio.
See also
- ERC-20#
ERC-20 is the original token standard for Ethereum.
ERC-20 is a technical standard used to issue and implement tokens on the Ethereum blockchain. It was proposed in November 2015 by Ethereum developer Fabian Vogelsteller and defines a common set of rules such as how the tokens can be transferred, how transactions are approved, and the total supply of tokens. ERC-20 tokens are the most commonly used tokens on the Ethereum network and are designed to be used for paying for functions.
ERC-20 token standard has several limitations and architectural shortcomings. Its approve() and permit() based functions, originally planned for having better smart contract security in Solidity, have proven to be an attractive vector for scams as normal users do not understand they are transferring tokens when calling these methods from their wallets.
The token standard has been adopted by other EVM-based blockchains like BNB Chain, Polygon, Avalanche C-Chain and Fantom.
See also
- Erigon#
The Erigon node is an implementation of Ethereum written in Go, designed to run archive nodes that manage large amounts of on-chain data. It is a decentralized blockchain node provider that provides a secure, private, and scalable blockchain infrastructure. If you want to host your own JSON-RPC API access to raw EVM blockchain data, Erigon is a good option.
Erigon is one of the two most popular Ethereum clients, alongside GoEthereum. The benefits of Erigon over GoEthereum include better disk space usage and performance due to more advanced database structures. Internally Erigon uses Lightning Memory-Mapped Database Manager (LMDB).
Erigon supports some alternative blockchains to Ethereum mainnet, like Polygon and BNB Chain. Erigon is not available for all EVM-compatible networks, as the project was started many years after GoEthereum, which had become the de facto standard EVM implementation at that point.
- Ethena#
Ethena is a decentralised finance protocol which popularised cash and carry trade.
In cryptocurrency markets, the most popular carry trade is to hold spot cryptocurrency (Bitcoin, Ether), against the similar sized short perpetual contract, creating a delta neutral position. Ethena popularised this strategy by creating a USD stablecoin out of this. Because in perpetual markets, short pays longs, longs pays short, a in a bull market, Ethena trade earns interest on its open short position from traders that have the opposite long position open. Ethena also earns additional yield in the staking rewards of its staked Ether.
See also
- Ether#
Ether, or ETH, is the second most popular cryptocurrency in the world.
Ether is the native gas fee token of Ethereum blockchain and its various layer two chains.
Ethereum is a proof-of-stake blockchain. Staked ether earns around ~4% annual yield.
See also
- EVM#
EVM stands for Ethereum Virtual Machine.
It is the execution environment that runs Ethereum blockchain transactions and smart contracts.
EVM was originally created in 2014 and is old in blockchain architecture terms
EVM is used by multiple chains outside Ethereum, like Avalanche and BNB Chain
There exists multiple implementations of EVM in different programming languages: Go, Rust, Python, etc.
Some transactions do not concern or touch EVM; for example beacon chain (staking) happens partially outside EVM domain
Due to age and limitations of EVM, there have been efforts to extend EVM for more functionality and faster transaction processing. Some efforts include
See also
- EVM-compatible#
EVM compatible means that a blockchain uses the same EVM architecture as the original Ethereum mainnet and is its clone.
EVM compatible blockchains can use the existing smart contracts like ERC-20 unmodified. They can also blockchain explorers, wallets and such with little modifications. This has lead to born to Ethereum clone chains like Polygon, Avalanche C-Chain and BNB Chain.
For EVM-compatible chains
Same Solidity and Vyper smart contracts work
Same JSON-RPC API works
Same wallets work, assuming your wallet gives you an option to set up a node JSON-RPC URL to a different EVM chain
Same libraries like Web3.py and Web3.js, SDKs and development tools work
However, you might need
Run a blockchain node yourself
Get another node provider as there is no consistency of who is running, connecting and offering services to different peer-to-peer networks
For an example list of EVM-compatible blockchains see Trading Strategy’s supported blockchains.
See also
- Excess returns#
See alpha.
- Exposure#
The risk of a strategy for the volatility of a particular asset. For example, if you have 100% exposure to ETH and ETH prices drops to zero, you lose all of your money.
See also
- Face value#
In finance, the face value is the nominal value of a financial instrument such as a bond, stock, or currency. For a bond, the face value is the amount that the bond will be worth when it matures. For a stock, the face value is the original value assigned to the stock when it is issued. For currency, the face value is the value printed on the currency.
For example, Digital Currency Group took over the defaulted Three Arrows Capital loan of $1.1B from its subsidiary, Genesis at its face value even though it is unlikely the money will ever be recovered. The fair value of this loan would have been much less.
See also Fair value.
- Factor investing#
Factor investing is a trading strategy that chooses securities based on attributes that have historically been associated with higher returns.
There are two main types of factors: macroeconomic and style. Investing in factors can help improve portfolio outcomes, reduce volatility and enhance diversification.
See also
- Fair value#
In finance, fair value is an estimate of the intrinsic value of an asset or liability, based on the most recent market data or other relevant information. The concept of fair value is used to measure the value of an asset or liability that is not traded in an active market, such as in accounting and financial reporting. It’s the estimated amount for which an asset or liability should exchange on the measurement date between a willing buyer and a willing seller in an arm’s-length transaction. It’s used for financial reporting and taxes, among other purposes. The calculation can be complex, as it often involves estimates and assumptions about future events, such as cash flow projections, volatility, risk, and other factors.
For example, Digital Currency Group took over the defaulted Three Arrows Capital loan of $1.1B from its subsdiary Genesis at its face value even though it is unlikely the money will ever be recovered. The fair value of this loan would have been much less.
See also Face value.
- Fastquant#
Fastquant allows you to easily backtest investment strategies with as few as three lines of Python code. Its goal is to promote data driven investments by making quantitative analysis in finance accessible to everyone. Fastquant builds on the top of Backtrader. See Github repository.
- Fee model#
In quantitative finance, there are different models how traders, investors, strategy developers, funds and other stakeholders of the ecosystem are paid for their work.
There are several fee models
Management fee: the operator collects % of fees regularly regarless of profit and loss. E.g. with 2% management fee, 2% is collected every
Performance fee: the operator collects fees if an investor is in profit over crystallisation period.
Carried interest is uncollected fees for the operator.
Deposit and withdrawal fees. E.g. 0.5% is collected when an investor exits.
See also:
- FinRL#
FinRL is a popular Python-based ramework for algorithmic trading using reinforced learning.
See also:
- Fork#
Fork is a a product launched based on the open source code of another existing product. Often forks are also called clones.
In the context of on-chain forks, forks usually are hostile to the original project and competes from the same users. Forks often do not innovate, or make the product technically better.
Unlike traditional open source projects, fork rarely co-operate. Because many forks lack the same technical understanding as the original founding tech team, forks suffer from hacks and are often abandon after a short period of time.
Forks in practice:
Blockchains can be forked. The most forked blockchain is Ethereum and its EVM architecture. Ethereum forks include Polygon, BNB Smart Chain, Avalanche C-Chain, Fantom.
Uniswap is the most forked protocol. Uniswap forks include Sushi, PancakeSwap, Trader Joe and others
See also
- Forward fill#
In data research and analysis, “forward fill” refers to a method of handling missing or incomplete data by carrying forward the last observed value to fill in the gaps. It is also known as “last observation carried forward” (LOCF).
When dealing with time series data or datasets with missing values, forward fill involves replacing missing data points with the most recent known value. This approach assumes that the value remains constant until a new observation is available. By using the previous observation as a substitute, forward fill helps maintain continuity in the data and allows for continued analysis or modeling.
Forward fill is often employed when missing data is considered to be missing at random (MAR), meaning the missingness is not related to the actual value. It can be a useful technique when the missing data points are intermittent or occur sporadically.
However, it is important to note that forward fill may not always be appropriate or suitable for all datasets or analysis scenarios. It assumes that the missing values should be carried forward, which may not be accurate or appropriate in all cases. Researchers should carefully consider the nature of the data and the implications of using forward fill before applying it. The opposite of forward fill is backward fill.
Alternative methods for handling missing data include backward fill (carrying the next observed value backward) or more sophisticated imputation techniques that estimate missing values based on statistical methods or predictive models. The choice of method depends on the specific characteristics of the dataset and the objectives of the analysis.
The Trading Strategy Framework gives you various Python functions for forward-fill, especially for OHLCV data. See ref:forward filling data in the documentation for more information.
See also
- Fundamental analysis#
Fundamental analysis is a method used in finance and investing to evaluate the intrinsic value of a security or asset by examining its underlying economic and financial characteristics and performance. The goal of fundamental analysis is to assess the economic viability and financial health of a company, and to determine if the current market price of its securities reflects its true worth.
In fundamental analysis, investors analyse a wide range of financial and economic data, including financial statements, industry trends, and macroeconomic indicators, to gain insight into a company’s earnings potential, growth prospects, and risk factors. Key metrics analysed include revenue, earnings, profitability, and cash flow, as well as debt levels, management quality, and competitive position.
See also
- Futures#
In quantitative finance, Futures are standardized financial contracts that obligate the buyer to purchase an asset (or the seller to sell an asset) at a predetermined future date and price. Futures contracts are traded on organized exchanges and can be based on various underlying assets, such as commodities, currencies, or indices.
Futures contracts are often used for hedging, speculation, or price discovery purposes. They allow market participants to manage their exposure to price fluctuations and take advantage of potential profit opportunities.
See also:
- Gamma hedged#
Gamma hedging in quantitative finance is a more advanced risk management technique used in options trading to mitigate the risk associated with changes in delta. It’s essentially hedging the change in the hedge itself.
Gamma measures the rate of change of delta for every one-point move in the underlying asset’s price.
In simpler terms, it tells you how much the delta of an option is expected to change as the price of the underlying cryptocurrency moves. A high gamma means the delta is very sensitive to price changes, requiring more frequent adjustments to your delta hedge.
Benefits of gamma hedging include:
Reduce Gamma Risk: Delta hedging only neutralizes the first-order risk (delta). Gamma hedging aims to reduce the second-order risk, which is the risk that delta changes significantly, making your initial delta hedge less effective.
Maintain Delta-Neutral Position: Gamma hedging helps maintain a delta-neutral position, especially in volatile markets where prices can move rapidly.
Improve Hedging Accuracy: By accounting for changes in delta, gamma hedging provides a more precise and dynamic hedge.
How build gamma hedged position:
Options with Opposite Gamma: To gamma hedge, traders typically use options with opposite gamma to their existing position. For example, if you have a long call option with positive gamma, you might buy a short call option with negative gamma to offset it.
Adjusting the Underlying: In some cases, gamma hedging can also involve adjusting the position in the underlying cryptocurrency to counteract the gamma risk.
See
- Gas fee#
Gas fee is a term used in blockchains to describe the transactions cost a user pays to block producers to have their block in includedin the blockchain.
The gas fee is dynamic. During the blockchain cognestion or high activity, block space is more premium, as users are competing to get their transaction included in a block.
There can be irregular events causing gas fee spikes
As the blockchain technology developers, the gas fees, or the transaction costs, are becoming lower and lower. New blockchains always are more gas efficient than their predecessors, as their code and consensus mechanisms are optimised for higher throughput. The costs go down from Bitcoin $20/tx to Ethereum mainnet’s 10$ tx to Polygon’s 0.20$ to Solana’s fractions of cents.
See also
- GM#
In decentralised finance and web3, GM is a meme of saying “good morning”.
It is a polite greeting people use to notify they have arrived online. Despite what the name says, it can be used at any time of a day.
The meme is very popular. For example, Warpcast client for Farcast Web3 protocol has a built-in “GM” button.
See also
- Google Colab#
Google Colab is a free Jupyter notebook environment that runs entirely in the cloud. It does not require a setup and allows users to combine executable code, rich text, images, HTML, LaTeX and more in a single document. It provides free access to GPUs and TPUs for anyone who needs them to build machine learning or deep learning models.
See also
- Grid search#
In algorithmic trading, grid search is a hyperparameter optimization technique used to backtest the best combination of hyperparameters for a trading strategy. Grid search involves exhaustively searching through a manually specified subset of the hyperparameter space and evaluating each combination for cumulative profit and risk-adjusted return.
Although grid search can be computationally expensive, it is often used when the search space is relatively small or when a more thorough exploration of the hyperparameter space is desired. Other optimization techniques, such as random search or Bayesian optimization, can be more efficient in cases where the search space is large or the performance landscape is complex.
Blindly using grid search may result to overfitting and the trading strategy does not have any real alpha.
See also:
- Heatmap#
A heatmap is a graphical representation of data that uses color coding to represent the values of a matrix or a two-dimensional dataset. In quantitative finance, heatmaps are often used to visualize correlation matrices, volatility surfaces, or other forms of multidimensional data.
Heatmaps can be useful for quickly identifying patterns or trends in the data, as well as for highlighting areas of high or low values. They can also be used to compare different datasets or to track changes in the data over time.
Heatmaps can be created using various software tools, such as Python’s Matplotlib library or R’s ggplot2 package.
See also:
- High-frequency trading#
High-frequency trading, or HFT for short, is a trading strategy where you compete with technical speed.
HFT strategies include arbitration, cross-market market making or such and compete against the other actors with your technical speed. In decentralised finance, there is a special category of high-frequency trading called MEV.
See also
- Historical market data#
Historical market data refers to past market information, including prices, volume, and other related metrics, for a specific security, asset class, or financial market. This data is used by traders, investors, and financial professionals to analyse market trends, evaluate investment opportunities, and make informed investment decisions.
Historical market data can be collected and analysed over various time frames, including daily, weekly, monthly, or even yearly, and can cover different asset classes, including stocks, bonds, commodities, and currencies. This information is critical in providing insights into past market behaviour and can be used to identify patterns and trends, develop trading strategies, and make informed predictions about future market movements.
Historical market data is widely available through a variety of sources, including financial data providers, stock exchanges, and government agencies.
You can download decentralised finance historical data using Trading Strategy client.
See also
- Honey pot#
In decentralised finance a honey pot describes a trading pair or a token designed to fool trading strategies. This is made possible by ERC-20 flexibility allowing it to have custom transfer and ownership rules, where the token owner and deployer manipulates balances.
The scams include “buy only” tokens, tokens with token tax or trading pools where the owner can drain quote token away. Usually trading algorithms are baited with “up only” price manipulation techniques and wash trading to believe that the trading pair is robust with good momentum and volume.
See also: term:token tax.
- Hyperparameter optimization#
Hyperparameter optimization refers to the process of finding the optimal set of hyperparameters for a machine learning model or trading algorithm. Hyperparameters are external configuration settings that cannot be learned directly from the data and must be set before the training process begins.
Some common hyperparameter optimization techniques include grid search, random search, and Bayesian optimization. These methods aim to maximize the performance of the model or algorithm by systematically searching the hyperparameter space and evaluating different configurations using a predefined performance metric, such as accuracy or Sharpe ratio.
Hyperparameter optimization can help improve the performance of a model or trading strategy by fine-tuning its configuration to better fit the underlying data and problem.
See also:
- HyperSDK#
HyperSDK is an optimised software development kit to build blockchains from Avalanche.
HyperSDK is MerkleDB and has very optimised state sync. The high performance makes HyperSDK optimal for building trading focused app chains. Theoretical transaction throughput can be up to 50 transactions per second (TPS). Internally HyperSDK nodes uses Pebble database.
See also
- IndexVM#
IndexVM is a blockchain virtual machine built on the top of HyperSDK dedicated to increasing the usefulness of the world’s content-addressable data by enabling anyone to index it.
See also
- JSON#
JSON (JavaScript Object Notation) is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate.
It is a text format that is used to transmit data between a server and a web application, as well as between different parts of a web application. JSON is commonly used in web development for tasks such as sending and receiving data between a server and a client-side web application, or for storing data in a format that can be easily exchanged between different systems.
JSON is based on a subset of the JavaScript programming language, and it is often used with JavaScript, although it can be used with any programming language that can parse and generate JSON data.
JSON data is organized into key-value pairs, where keys are strings and values can be strings, numbers, arrays, objects, booleans, or null.
See the JSON specification for more information.
Also see an example of using JSON with TradingStrategy data in the JSON example
See also
- JSON-RPC#
In blockchain development, JSON-RPC is a popular Remote Procedure Call (RPC) protocol used by blockchain node applications.
JSON-RPC was popularised by the original bitcoind node and then copied to Ethereum. JSON-RPC is human readable and simple protocol for programmatically asking information from your blockchain node.
This includes
Querying the current state information
Broadcasting transactions
JSON-RPC is used by
Wallets (query tokens, balances)
Decentralised application frontends
You can get a JSON-RPC API for your blockchain application by
Self-hosting a blockchain node and then turning on the JSON-RPC API port
Using a software-as-a-service provider - see ethereumnodes.com for details
Popular alternatives for JSON-RPC includes Protobuf, as used by Cosmos SDK.
See also
- JSONL#
JSONL, also known as JSON Lines, is a convenient format for storing structured data that may be processed one record at a time. Each line in a JSONL file is a valid JSON object, allowing for simple append operations and easy processing of large files. The format is particularly useful in cases where the data consists of many small records, as it allows for line-by-line iteration, reducing memory usage when dealing with large datasets.
This format, although not an official standard, has gained popularity due to its simplicity and efficiency in handling data. The JSONL file format is especially useful in the fields of data processing and machine learning, where dealing with large datasets is common.
See the JSONL specification for more information.
Also see an example of using JSONL with TradingStrategy data in the JSONL example.
See also
- Jupyter notebook#
Jupyter Noteook is a popular Python based data science tool.
Jupyter allows users to run data research notebooks interactively.
Jupyter notebooks can be easily shared, run on your local computer or on a hosted cloud environment, both free and paid.
Jupyter is an especially popular software development tool among quants.
More information on Jupyter website.
See also
- Last trade#
In Trading Strategy Protocol, last trade is the date when a trading strategy successfully executed a trade last time.
This metric tells who lively the underlying algorithm has been recently.
See also
- Lending pool#
In decentralised finance, a lending pool is a pool of a single asset in a lending protocol.
Sometimes a lending pool is also called reserve (:term`Aave).
The assets are typically held in a pool and are lent out to borrowers, who can use them for a variety of purposes such as margin trading, liquidity provision, or to meet other financial obligations.
Lending pools typically offer a high yield investment opportunity for lenders, as they can earn interest on their cryptocurrency assets without having to sell them. Borrowers, on the other hand, can access the assets they need to meet their financial obligations, without having to sell their own assets or go through the traditional lending process.
Lending pools are typically run on decentralised finance (DeFi) platforms, which use blockchain technology to create a decentralised, trustless financial system. This means that the platform operates on open-source software and operates transparently and immutably, allowing for secure and transparent transactions.
See also
- Lending protocol#
A lending protocol is a decentralised finance credit market for lending and borrowing tokens.
Lending protocols are smart contract-based non-custodial protocols to lend and borrow your assets.
Lending protocols enable shorting of different lending pool tokens.
Popular lending protocols include Aave, Compound and Euler.
See also
- Leverage#
Leverage in trading is the use of borrowed funds to increase one’s trading position beyond what would be available from their cash balance alone.
Leverage trading is also known as margin trading.
It enables traders to open a position worth much more than the money they deposit.
Leverage can be used in longing or shorting.
In a long, 2x leverage means that you can make 2x profit when the price moves up 1x
In a short, 1x leverage means that you can make 1x profit when the price moves up 1x
If the price moves too much your deposited money is liquidated
Shorting always involves borrowing
In leveraged markets often longs pay shorts, short pays longs as a zero-sum trading game
Leverage requires collateral. If the leveraged trade goes belly up, the account doing the leveraged trade may be liquidated.
See also
- Limit order#
See order book.
- Liquidation#
In trading, liquidation happens when a trader has insufficient funds to keep a leveraged trade open.
The exchange or lending protocol closes the position.
Any collateral that was used to open the position is sold (“liquidated”)
The proceedings of collateral liquidation is used to paid the trades who took the opposite side of the trade
In decentralised finance, liquidation also happens on lending protocols.
See also
- Liquidity#
Liquidity refers to the depth of the order books: how much volume a single trade can achieve without moving the price.
It can be expressed as slippage or absolute depth of the order book. The latter is very easy for AMM based exchanges where the liquidity is a continuous function.
Trading Strategy provides datasets for AMM liquidity.
See also
- Liquidity mining#
Liquidity mining is a process where AMM liquidity providers for a token are subsidised from a token treasury.
Effectively, you are paying people to create liquidity in an AMM trading pair or an order book.
This is to bootstrap the liquidity from zero to meaningful level, so that users and traders can enter and exit positions without significant price impact. The liquidity mining program assumes that after a certain liquidity level is artificially bootstrapped, it can maintain itself better as it has attracted active traders with larger capital pools who now have started to trade the token.
See also
- Liquidity pool#
Liquidity pool is the available trading liquidity of a single trading pair in AMM.
In a liquidity pool, liquidity providers pool together one of more tokens that users can trade against. For providing liquidity, the providers are rewarded in swap fees.
Liquidity pools are often their own smart contracts that can be easily explored and tracked in a blockchain explorer.
See also
- Liquidity provider#
Liquidity providers (LPs) are users that deposit their assets to the liquidity pools of an Automated Market Maker (AMM).
Liquidity providers are crowdsourced collections of crypto assets used by the AMM to trade with people buying or selling one of these assets. AMMs use pre-programmed mathematical equations to adjust prices based on supply in order to make sure the ratio of assets in any liquidity pool is maintained.
See also
- Longing#
Longing means to make a trade where one assumes the price of an asset is going up.
To go long is the opposite of shorting.
Longs can be be spot market purchases (consider it as 1x leverage
Longs can be levered for higher profits on success
In decentralised finance, you can build a levered long trade using lending protocols.
See also
- Look-ahead bias#
In quantitative finance, Look-ahead bias occurs when a trading strategy or model uses information that would not have been available at the time the trade was executed. This can lead to an unrealistic assessment of a strategy’s performance, as the model appears to have access to future information.
To avoid look-ahead bias, it is essential to ensure that the data used in backtesting and strategy development is strictly limited to the information that would have been available at the time of the trade. This can be achieved by using time-stamped data and careful data management techniques.
See also:
- Loss function#
In machine learning, the loss function is a measure of how well a model fits the training data. It is a function that is minimized during training.
The loss function is typically a mathematical function that measures the difference between the predicted values and the actual values. It is used to train the model by minimizing the loss function.
The loss function is used to train the model, while the test set is used to evaluate the performance of the model. The test set is typically a random sample of the dataset that is not used to train the model.
See also
- Loss-Versus-Rebalancing (LVR)#
In decentralised finance, loan-versus-rebalancing refers to form of arbitrage that occurs whenever an AMM decentralised exchange has an outdated (stale) price in comparison to some other trading venue.
For liquidity providers (LP) this can be seen as toxic order flow, which eats their profits.
Arbitrageurs exploit this difference by trading from the AMM, like Uniswap, to the more liquid exchange (usually a centralized exchange like Binance), correcting the arbitrage and extracting value from LPs in the process.
In the worst case, centralised exchanges can themselves exploit this difference, if they have a priviledged access to their own order book and MEV.
See:
Original research from the Columbia University: Automated Market Making and Loss-Versus-Rebalancing
It is not possible to get rid of LVR completely, but it can be mitigated e.g. with
Shorter block times: arbitrage difference cannot grow that big
Price oracles: By fetching the price from a centralised exchange, it is not possible to have a price difference
Batch auctions: Instead of clearing market taker traders right away, short very high frequency auctions where multiple orders are matches and batches together, like CowSwap does
See also:
- Machine learning#
Machine learning is a subfield of artificial intelligence (AI) that focuses on the development of algorithms and statistical models that enable computers to learn from and make predictions or decisions based on data, without being explicitly programmed to perform specific tasks.
In quantitative finance, machine learning is used to drive trading strategies:
Algorithmic Trading: Machine learning algorithms play a crucial role in algorithmic trading systems, where they analyze market data in real-time to identify trading opportunities and execute trades automatically. Reinforcement learning algorithms are particularly suitable for this task as they can learn optimal trading strategies through trial and error.
Predictive Modeling: Machine learning algorithms are employed to predict financial market movements, asset prices, trading volumes, and other relevant variables. Techniques such as regression, decision trees, random forests, support vector machines (SVM), and deep learning are commonly utilized for this purpose.
Risk Management: Machine learning models are used to assess and manage financial risk by predicting market volatility, portfolio losses, and other risk factors. Risk management can be tied to position sizing.
Portfolio construction: Machine learning algorithms aid in constructing optimized investment portfolios by analyzing historical market data, asset correlations, and investor preferences. Portfolio optimization models aim to maximize returns while minimizing risk or achieving specific investment objectives.
High-Frequency Trading: Machine learning techniques are applied in high-frequency trading strategies, where trades are executed within milliseconds to exploit fleeting market inefficiencies. These algorithms leverage advanced statistical models and data analysis techniques to identify profitable trading opportunities in high-speed trading environments.
:term:`Sentiment Analysis: Machine learning models analyze news articles, social media feeds, and other textual data sources to gauge market sentiment and investor opinions. Sentiment analysis helps traders and investors make informed decisions by assessing the impact of public sentiment on financial markets.
See also
- Management fee#
A management fee is a recurring fee charged by investment managers or fund managers for managing and overseeing investment portfolios or funds on behalf of investors. It is a compensation mechanism for the services provided by the manager in managing the assets and making investment decisions.
The management fee is typically calculated as a percentage of the total assets under management (AUM). The percentage fee can vary depending on the type of fund, investment strategy, or asset class. It is usually expressed as an annual rate and is deducted from the fund’s assets on a regular basis, such as quarterly or annually.
The management fee covers various costs associated with managing the fund, including research, analysis, portfolio construction, trading, administrative expenses, regulatory compliance, and compensation for the investment manager’s team. It is meant to compensate the manager for their time, expertise, and resources devoted to managing the investments and ensuring the fund’s operation.
Management fees are disclosed in the fund’s prospectus or investment management agreement, providing transparency to investors regarding the costs associated with their investment. The fee structure is an important consideration for investors when evaluating investment options, as it directly affects the net return they will receive.
It’s worth noting that management fees are separate from other fees that may be associated with investment funds, such as transaction fees, custodial fees, performance fees (in certain funds), or expense ratios (in mutual funds and ETFs). These additional fees cover specific services or costs beyond the general management of the fund.
See also:
- Margin trading#
Leverage trading is also known as margin trading.
See leverage.
- Market data feed#
A time-series data on which automated trade decisions are based on. One of the most common data feeds is the price data as OHLCV candles.
- Market Exposure#
Market exposure refers to the extent to which an investment portfolio is subject to fluctuations in the overall financial market or a specific asset class. It describes the amount of risk or potential for gain that an investor or organization faces as a result of having invested in a particular market, sector, or individual security.
Example: An investor with a portfolio heavily weighted in technology stocks has significant market exposure to the technology sector. If the technology sector performs well, the investor stands to gain; conversely, if the sector performs poorly, the investor is at risk of incurring losses.
Unrealized risk and market exposure are often interconnected, as the level of market exposure can directly impact the degree of unrealized risk in a portfolio. A portfolio with high market exposure to volatile sectors will inherently carry a higher degree of unrealized risk until positions are closed.
See also
- Market making#
Market making is a crucial function in financial markets that involves providing liquidity and facilitating trades.
Market makers are firms or individuals who stand ready to buy and sell a particular asset on a regular and continuous basis at publicly quoted prices.
Process: They simultaneously provide bid (buy) and ask (sell) prices for a security, profiting from the spread between these prices.
Function: Market makers ensure liquidity in the market, reduce price volatility, and enable smoother trading by being willing to trade when other buyers or sellers might not be immediately available.
Market makers are especially important in less liquid markets or for less frequently traded securities. They take on inventory risk by holding positions in securities, which allows other market participants to trade more easily and efficiently.
In decentralised finance, a specific form of market making is used, called liquidity provision. AMM (Automated market maker) is a specific type of decentralised exchange where liquidity providers do not need to adjust their positions to react the market situation, but the price of an asset is determined by bonding curve.
Market makers often do not want to take inventory risk and try to stay delta neutral when providing liquidity.
See also:
- Market neutral strategy#
Market neutral strategies are trading strategies that have little or no exposure to crypto asset volatility. They are often high-frequency trading strategies, like arbitrage. Good market neutral strategies can make 10% - 20% monthly yield in cryptocurrency markets.
See also
- Market order#
A market order is a trade where a trader order is instantly fulfilled whatever is the availability liquidity and price at the markets.
Specifically
Market orders remove liquidity (also known as a market taker)
Market buys move price up, market sells move price ddown
The opposite of a market order is often a limit order. On AMMs the opposite is liquidity provider position.
On AMM decentralised exchanges every swap is a similar to a market order.
Market orders, as a market taker, typically have higher fees than market makers (provides liquidity), as liquidity is the key selling point for any exchange.
See also
- Market regime#
In quantitative finance, market regime means the current general state of the market. It can concern a single trading pair, of the market as a whole.
Popular market regimes includes
Bull market - everything goes up
Bear market - everything comes down
Crab market - everything moves sideways
Market regime can be also volatility based, for the risk management
High volatility - avoid trend following strategies, as trend is unclear
Low volatility - breakouts are less likely, avoid breakout strategies
See also
- Market Sentiment#
Market sentiment refers to the overall attitude or tone of investors toward a particular financial market or asset. It is often gauged through various indicators such as price movements, trading volume, news, and other market activities. Market sentiment can be bullish (optimistic), bearish (pessimistic), or neutral.
Example: If most news articles about a particular stock are positive and its trading volume is high, the market sentiment is likely to be bullish.
Usage: Market sentiment is closely monitored by traders and investors as it can influence price trends and market volatility. Understanding market sentiment can help in making more informed investment decisions.
See also
- Market trade#
See market order
- Maximum Adverse Excursion (MAE)#
MAE measures the largest loss suffered by a trade while it is open.
MAE analysis is one of the keys to understanding how your trading strategy works. Trades with a high MAE tend to revert, and many times these trades ended in a small loss or even in profit. This is typical with too tight stop loss.
More on how to understand MAE.
See also
- Maximum Drawdown#
In quantitative finance, maximum drawdown (MDD) refers to the maximum loss from a peak to a trough of a portfolio, before a new peak is attained. It is a measure of the largest loss that an investment portfolio has experienced over a specified time period.
Maximum drawdown is an important metric in risk management as it helps investors understand the potential downside risk of an investment. It is often used to assess the risk of a portfolio and to compare different investment strategies.
For example, suppose an investment portfolio has a maximum drawdown of 20%. This means that the portfolio has experienced a loss of 20% from its peak value before a new peak is reached. In other words, the portfolio has lost 20% of its value at some point in the past.
Maximum drawdown is typically expressed as a percentage of the portfolio’s value. It can be calculated using the following formula:
\[MDD = \frac{P - T}{P}\]where P is the peak value of the portfolio and T is the trough value.
As a rule of thumb, the maximum drawdown should not be more than 1/3 of the strategy annual returns. For example, if a strategy has an annual return of 30%, the maximum drawdown should not exceed 10%.
See also
- Maximum pullback#
Maximum decrease in profitability % as a result of consecutive losing positions with respect to the portfolio’s initial value. Intuitively, this can be thought of as the biggest losing streak. Not to be confused with maximum drawdown.
See also
- Mean#
The mean is a measure of central tendency that represents the average value of a data set. It is calculated by dividing the sum of all values by the number of values in the data set. It is also known as the arithmetic mean or average.
Example: For the data set [1, 3, 3, 6, 7, 8, 9], the mean is (1+3+3+6+7+8+9)/7 = 5.14
Usage: The average is widely used in various fields for summarizing data sets, comparing different groups, or tracking changes over time. However, it can be susceptible to the influence of outliers.
See also
- Mean reversion#
A mean reversion strategy is a type of trading strategy that assumes that prices of an asset will eventually return to their average or mean levels over time.
This strategy is based on the idea that prices tend to move in cycles and that extreme deviations from the average are temporary and eventually return to their historical average. In a mean reversion strategy, a trader buys an asset when its price is lower than its average and sells when the price is higher than its average, with the goal of profiting from the reversion to the mean. Mean reversion strategies can be applied to a variety of assets, such as stocks, bonds, commodities, and currencies, and are commonly used in quantitative finance and algorithmic trading.
See also
- Median#
The median is a measure of central tendency that separates a data set into two equal halves. It is the middle value when all data points are arranged in ascending or descending order. In the case of an even number of observations, the median is the average of the two middle numbers.
Example: For the data set [1, 3, 3, 6, 7, 8, 9], the median is 6. If the data set were [1, 3, 3, 6, 7, 8], the median would be (3+6)/2 = 4.5
Usage: The median is often used in statistical analyses to provide a measure of the “typical” value in a distribution, particularly when the data set may contain outliers that could heavily influence the mean. It is also used to calculate the median absolute deviation (MAD), which is a measure of dispersion that is less sensitive to outliers than the standard deviation.
See also
- Mercenary capital#
In decentralised finance, mercenary capital is a term used to refer to cryptocurrency investment and trading funds who chase liquidity mining and other token rewards without long term commitment to the token success.
Mercenary capital moves from a project to a project, chasing best subsidised yield farming and liquidity mining opportunities, without actually contributing to the token success any way.
See also
- MEV#
Malicious Extractable Value (MEV) is a measure of the profit a blockchain block producer can make through their ability to arbitrarily include, exclude, or re-order transactions during the block production process. It refers to the maximum amount of value that can be extracted from block production in excess of the standard block reward and gas fees.
MEV is also known as Miner Extractable Value (original proof-of-work term) and Maximum Extractable Value.
MEV is applicable to a blockchain that have a consensus model where there is a single elected leader for each block, round or epoch (terminology varies). This leader sees the content of new transactions and can decide what are transactions and which order they are going to be included in the next block, effectively deciding the final execution order of the transcations. The leader can also insert their own transactions to at any point of the new block. If any of transactions contain trades, the leader can insert their own trades before or after the transactions of other blockchain users.
A block producer in a position to do MEV can harm traders in multiple ways:
MEV operators frontrun trades and liquidity provisions to get a better price for themselves as they see the market is about to change, by inserting their own trades before others.
MEV operators perform sandwitch attack to manipulation the market, by frontrunning and backrunning s single trade to set the price to some arbitrary value.
MEV operators backrun trades and extract any arbitrage opportunities which open up after executing a trade.
Because of MEV, traders using blockchain may lose money they would not lost in trading otherwise. Ethereum mainnet block producers have been manipulating on-chain markets via MEV since 2020. This money goes to the block producers as excessive profits from their MEV trades. Most of MEV is a harmful for traders and protocols as it extracts value out from the system and moves it to a third party, unrelated to the actual trading activity. If a rational trader can choose between two otherwise equal markets, they will always choose the market without MEV.
From community acceptance and legal standpoint a third-party MEV, where traders and the protocols are not participants, can be considered harmful:
Frontrunning and market manipulation are illegal in many jurisdictions and different contexts.
- -Backrunning is generally found acceptable,
especially if it distributes some of arbitrage profits back to traders and protocols.
Not all blockchains are suspectible to MEV. Getting rid of MEV is often referred as “solving MEV” or “minimising MEV.”
MEV can be prevented and mitigated by
Making transactions invisible to block producers. This is called to shuttering or shielding. One way to achieve this is to use two-phase commit and reveal scheme, also known as commitment scheme. for including transactions in a block. In this scheme, the block producers ability to see the transaction content is removed. Commit-and-reveal schemes can happen on the block production level (hardcoded for all transactions) or on the application level (a special DEX smart contract needed with two separate transactions). Shutter Network is a commit-and-reveal scheme for EVM block building. Commit-and-reveal schemes usually do not remove the block producers ability to do backrunning.
Setting a slippage tolerance for traders. The slippage is the amount of price change between the user creating a trade and the time the trade gets executed. If the trade outcome is not within the slippage tolerance, the trade fails and the trader may try again. The slippage tolerance sets the upper bound for the value frontrun and sandwich attacks can extract. However, the requirement to use tight slippage tolerance to avoid harmful MEV will also cause legimate trades to fail, and MEV participants will still extract value, just lower.
Using private mempools. A mempool is a public peer-to-peer network where transactions are broadcasted before they are included in a block. A private mempool operator submits transactions to the block producers with a honour agreement “do not negatively manipulate these” and there is some sort of revenue sharing agreement with the private mempool operator and block producers about this. Multiple private mempool solutions for EVM blockchains exist. Users are incentivised to use a private mempool by paying back some of the backrun arbitrage profits from users trades in the form of a kickback. A simple solution for ordinary users is to change the JSON-RPC node configuraiton of a wallet to point to in the form of a kickback. a private mempool, like MEV Blocker. So far all private mempools are trust-based, so they are not ideal solution as a rogue private mempool operator does not need to respect any honour agreements.
Backrunning built into the protocol itself to capture any arbitrage left after routing a trade. Osmosis is doing this if the form of ProtoRev module. More about ProtoRev solution here.
Most EVM-compatible blockchains and virtual machines are not powerful enough to do backrunning on-chain, but off-chain solutions like CowSwap and MEV Blocker exist.
Creating a blockchain block production system where there is no single leader who can decide on transactions. See Advanced consensys system design presentation here.
Having a blockchain that is too dumb to support logic needed to calculate trades. Bitcoin is such a blockchain and that’s why there cannot be trading on Bitcoin, and all of its trading needs to happen outside native Bitcoin blockchain.
CEX-DEX arbitrage, though not always MEV but harmful for decentralised finance ecosystem due to its harm for passive liquiditity providers, can be mitigated with dynamic fees, introduced by Uniswap version 4. More on dynamic fees mitigating arbitrage here.
Read elsewhere
See also
- Mid Price#
The mid price, in the context of AMM, is the price that reflects the ratio of reserves in one or more pairs. There are three ways we can think about this price. Perhaps most simply, it defines the relative value of one token in terms of the other. It also represents the price at which you could theoretically trade an infinitesimal amount (ε) of one token for the other. Finally, it can be interpreted as the current market-clearing or fair value price of the assets.
The mid price, in the context of order book based exchange is \((best bid + best ask) / 2\), i.e. the price between the best sell offer and the best buy offer.
More information about the mid price on Uniswap documentation.
- Momentum#
In trading strategy, momentum refers to the rate of change in the price of a financial asset over a given period of time.
The price change si often expressed as a change in the open-close data. E.g. the price of an asset at the opening of the week vs. closing price as the end of the week.
Momentum traders seek to profit from short-term price trends by buying assets that have been performing well and selling those that have been performing poorly.
Momentum traders typically use technical analysis to identify assets that are exhibiting strong positive or negative momentum. They may look at indicators such as moving averages, relative strength index (RSI), and MACD (moving average convergence divergence) to determine the current trend and potential entry and exit points.
One common strategy used by momentum traders is to buy assets that have recently experienced a significant price increase, on the assumption that the upward trend will continue. This is known as a “breakout” strategy. Conversely, they may sell assets that have experienced a significant price decrease, on the assumption that the downward trend will continue.
It is important to note that momentum trading can be risky, as price trends can quickly reverse direction, leading to significant losses if a trader’s positions are not properly managed. It is therefore important for traders to have a well-defined strategy, strict risk management rules, and the discipline to stick to their plan even in the face of short-term fluctuations.
See also
- Money Flow Index (MFI)#
The Money Flow Index (MFI) is a technical indicator used in quantitative finance and trading to measure the strength and direction of money flowing in and out of a security over a specific period, typically 14 periods. It combines both price and volume data to provide insight into the buying and selling pressure within a security.
Traders use the Money Flow Index to identify overbought or oversold conditions in an asset, divergence between price and money flow, and potential trend reversals.
The calculation of the Money Flow Index involves several steps:
Typical Price (TP): This is the average of the high, low, and closing prices for each period. It’s calculated as (High + Low + Close) / 3.
Money Flow (MF): This is the product of the Typical Price and the volume traded for each period. If the Typical Price is higher than the previous period’s Typical Price, it’s considered positive money flow, and if it’s lower, it’s considered negative money flow.
Money Flow Ratio (MFR): This is the ratio of positive money flow to negative money flow over a specific period (usually 14 periods). It’s calculated as (14-period Positive Money Flow) / (14-period Negative Money Flow).
Money Flow Index (MFI): Finally, the Money Flow Index is calculated using the formula 100 - (100 / (1 + MFR)). It ranges from 0 to 100. A high MFI value suggests that the security is overbought, indicating a potential reversal, while a low MFI value suggests that the security is oversold, indicating a potential buying opportunity.
See also
- Native token#
Also known as “gas token”. The native token is the cryptocurrency used to pay transaction fees on EVM-compatible blockchain. For Ethereum it is ETH, for Polygon it is MATIC and for Binance Smart Chain it is BNB.
See also
- Netflow#
In the context of trading strategy, netflow typically refers to the net amount of money that flows into or out of a available capital over a specific period. It represents the difference between the inflows (capital deposited) and outflows (capital redeemed or withdrawn) from the fund.
Netflow is an important metric related to Total value locked (TVL) as it can effect on the trading strategy performance.
Positive netflows indicates that TVL is growing
Negative netflows indicate that more capital is being redeemed, which can reduce its TVL
See also
- NFT#
In web3, NFT stands for non-fungible tokens.
NFTs are tokens that unique and thus have value, like artistic value or in-game benefits. Usually NFTs represent digital content, but can also represent real-world assets.
Like with all other decentralised finance protocols, NFTs are non-custodial and do not need an intermediates like banks to track and change their ownership.
See also
- Non-custodial#
Non-custodial means that a third party does not have ownership of your assets in a service.
A non-custodial model usually means s smart contract based service model where the owner of the assets never lose the control of the assets. This is opposite to most traditional finance services where you cannot see what happens to your money after the deposit or whether you are able to withdraw. The integrity of the service provider in the traditional finance thus needs to be guaranteed through regulation or government bailouts. The non-custodial model is specific to smart contracts and cannot be achieved without a blockchain. Read more.
Non-custodial protocol models have become popular in a blockchain, after FTX and Celsius blow-ups: not your keys, not your coins.
See also
- Notebook#
A notebook is a web-based interactive platform for writing and running code, as well as documenting and sharing work in a variety of formats, including text, code, and graphics. It is commonly used in the fields of data science, machine learning, and scientific computing for developing and testing algorithms, analysing data, and creating visualisations.
In a notebook, users can write code in a variety of programming languages, including Python, and run it directly within the platform. The output of the code, including any visualisations or results, is displayed within the notebook alongside the code itself. This allows users to iteratively develop and test their algorithms, as well as document their work in a readable and reproducible format. Notebooks also provide a convenient platform for collaboration and sharing, as they can be easily exported and shared as files, or hosted on platforms such as Jupyter or Google Colab. This makes them a popular choice for data scientists and researchers who need to share their work with others, as well as for organisations who need to collaborate on large data projects.
Overall, notebooks provide a powerful and flexible platform for data analysis, scientific computing, and code development, making them an essential tool for many researchers and data professionals.
The format was popularised by Jupyter notebook.
- Off-chain#
In decentralised finance, off-chain refers to software and code that is run outside the blockchain nodes.
Off-chain activities are needed because some activities are not possible or too expensive (transaction cost wise) to handle in a blockchain core protocol or smart contracts:
Computation cost using smart contracts would be too high due to CPU, IO and memory requirements.
Information needs to be fetched for real-world assets or other items that do not have native blockchain data, like centralised exchange cryptocurrency prices. Because blockchains are new technology, most things in the world do not have good blockchain data available yet and off-chain data fetch and validation is needed.
In the future, the amount of activities that need off-chain computation is going to decrease, as blockchains are getting more powerful.
Usual off-chain computation use cases include
Order books run on a centralised server like 0x protocol or DyDx
See also
- OHLCV#
A typical candle contains open, high, low and close price and trade volume for a time bucket. Because on-chain exposes more data than centralised exchanges, Trading Strategy data also contains individual buys and sells, US dollar exchange rate and so forth.
See also
- On-chain#
In decentralised finance, on-chain refers to transactions or activities that are recorded and processed directly on a blockchain network. It is the opposite of off-chain.
In a blockchain, transactions are verified by nodes in the network and added to the chain of blocks that make up the blockchain. These transactions are permanent and unalterable, and the state of the blockchain can be seen by anyone on the network.
When an activity is referred to as “on-chain,” it means that it is recorded directly on the blockchain, as opposed to off-chain, which refers to transactions or activities that are not recorded on the blockchain but are still facilitated by the network.
On-chain transactions are typically considered to be more secure and transparent than off-chain transactions, as they are recorded in a public ledger that is immutable and auditable. Additionally, on-chain transactions are often processed more quickly and with lower fees than off-chain transactions, as they do not require intermediaries or intermediating networks.
Examples of on-chain activities include cryptocurrency transfers, smart contract execution, and decentralised applications (dApps). These activities are all processed directly on the blockchain network, providing a secure and transparent means of conducting transactions and executing code.
See also
- Open position#
An open position in finance and trading refers to a trade that has been initiated but has not yet been closed or settled. It represents an active market exposure that carries with it the risk of loss as well as the potential for profit. The position can be either long, indicating ownership and the expectation that the asset will appreciate in value, or short, indicating a borrowed asset that is sold with the expectation of buying it back at a lower price.
See also
- Options#
In quantitative finance, Options are financial contracts that give the buyer the right, but not the obligation, to buy (in the case of a call option) or sell (in the case of a put option) an underlying asset at a specified price (strike price) on or before a certain date (expiration date). The seller of the option, in return, receives a premium from the buyer.
Options are versatile financial instruments that can be used for various purposes, such as hedging, speculation, or income generation. They allow market participants to manage their risk exposure and take advantage of potential profit opportunities.
See also:
- Oracle#
In decentralised finance, oracle allows smart contracts to access external data.
An oracle in a blockchain is an entity that connects blockchains to external systems, allowing smart contracts to execute based upon inputs and outputs from the real world.
Oracles are third-party services that provide smart contracts with external information, while blockchain technology itself is defined as a ledger of decentralized data that is securely shared by select participants.
The most common use case for oracle is to tell the fair value of an asset. This can be a token or a real-world asset.
Oracles are security critical system, as they often report prices and if the price is wrong the underlying protocol may suffer what is called an oracle attack or a price manipulation attack. For example, if in a lending protocol the collateral price is wrong, the loands can be incorrectly liquidated.
Popular oracles protocols include
ChainLink (on EVM-Compatible blockchains)
Python (Solana)
See also
- Order book#
An order book is a type of market that operates based on an order book, a record of all buy and sell orders for a particular asset.
In an order book exchange, users can place limit orders, specifying the price and quantity they are willing to buy or sell an asset for. When a matching buy and sell order is found, a trade is executed, and the exchange takes a small fee for facilitating the transaction. Order book exchanges provide more precise price discovery and allow users to take advantage of market inefficiencies, but can suffer from liquidity issues and are more susceptible to front-running and other forms of market manipulation.
Overall, order book exchanges offer a more traditional trading experience compared to Automated Market Maker (AMM) exchanges, but with the added benefits of being decentralised and secure.
See also
- Overfitting#
In term:quantitative finance, overfitting of trading strategy means that the trading strategy results in backtest where mostly luck-driven and there is no real alpha.
Because of limited historical data, backtesting results, especially grid search results may look too rosy. Trading strategy is excessively tailored to historical market data, to the point that it performs well on past data but fails to generalize to new, unseen data or real-world market conditions. This phenomenon can occur when trading algorithm is optimised too much based on historical data, effectively fitting the strategy too closely to the noise or random fluctuations present in that data (luck-driven vs. finding real alpha).
Examples of overfitting include
Data snooping bias: Traders or developers sift through historical market data to find patterns or relationships that may not actually exist. By repeatedly testing different strategies on the same dataset, they might stumble upon strategies that seem to perform exceptionally well purely by chance.
Curve fitting: Traders may excessively tweak the parameters of their trading algorithms to make them fit historical data perfectly. While this may result in high returns on historical data, it often leads to poor performance in real-world trading because the strategy becomes too sensitive to past market conditions.
Optimization bias: Optimizing trading strategies based on past data can lead to strategies that are highly specialized to those specific market conditions. When market conditions change, these strategies may fail to adapt and perform poorly.
Complexity: Introducing unnecessary complexity into a trading strategy can increase the likelihood of overfitting. A complex model may capture noise in the data rather than true underlying relationships.
Overfitting bias can be mitigated with various methods
Using different datasets for strategy backtesting and validation of the backtest, a usual method in machine learning
Monte Carlo-method by creating random asset prices where the behavior resembles the :term:`
For continuous markets like cryptocurrency markets, you can do shifted trading hours <https://tradingstrategy.ai/blog/outperfoming-eth>__ and shifted OHLCV data.
See also
- Pandas#
Pandas is a powerful and widely used open-source data analysis library in Python. It provides data structures and functions needed to work with structured data, such as tabular data in the form of tables or spreadsheets. With pandas, it’s easy to manipulate, clean, and analyse data, as well as perform complex operations such as grouping, merging, and aggregating data.
Pandas is designed to handle a variety of data types, including numerical, categorical, and time-series data. It also integrates well with other libraries, such as NumPy and Matplotlib, making it a popular choice for data analysis and visualisation in the scientific and research communities.
One of the key features of pandas is its DataFrame object, which is a two-dimensional labelled data structure with columns of different data types. With pandas, you can easily perform operations on the DataFrame such as filtering, sorting, and grouping data, as well as handling missing values and dealing with time-series data. More information.
See also
- Parquet#
Parquet is a columnar storage format for big data processing and analysis, commonly used in the Apache Hadoop and Apache Spark ecosystems. It is optimised for fast querying and efficient storage of large, complex data sets, and supports a wide range of data formats and compression options. By organising data into columns rather than rows, Parquet enables more efficient compression and encoding, as well as improved query performance, making it a popular choice for data warehousing and analytics applications. More information.
Parquent comes from Apache Arrow ecosystem.
Parquet files have internal compression, usually Zstd, to make transferring large data series faster.
See also
PyArrow - Python library
Apache Arrow - open source data science ecosystem project
OHLCV - market and price data type
- Passive strategy#
Passive investing is a long-term trading strategy for building wealth by buying securities that mirror stock market indexes and holding them long term.
A passive strategy involves minimal trading in the market, with investors buying and holding a diversified mix of assets to match, but not beat, the performance of an index. The passive investing strategy is based on the premise that a low-cost, well-diversified portfolio will produce an average market return.
Often, in decentralised finance, passive strategies aims to beat risk-free rate without any additional exposure and drawdown.
See also
- Performance fee#
In quantitative finance, a performance fee is a form of compensation that investment managers or fund managers may receive based on the performance of an investment or a fund. It is typically an additional fee on top of the management fee and is structured to align the interests of the manager with the investors.
The performance fee is earned when the investment or fund achieves certain predefined performance benchmarks or exceeds a specified hurdle rate. The specific terms and conditions of the performance fee are outlined in the fund’s prospectus or investment management agreement.
The calculation of a performance fee can vary depending on the fund or investment strategy. Commonly, it is calculated as a percentage of the investment gains or profits generated by the fund. For example, if the fund’s performance fee is set at 20% and the fund achieves a return of 10%, the performance fee would be 20% of the 10% gain, resulting in a 2% fee. Fees are calculated for a specific crystallisation period.
Performance fees are intended to incentivize fund managers to deliver superior investment results. By linking compensation to investment performance, investors hope to encourage the manager to make strategic investment decisions that maximize returns. It aligns the manager’s interests with those of the investors, as the manager benefits from generating positive investment results.
It’s important to note that performance fees are more commonly associated with alternative investment vehicles such as hedge funds, private equity funds, or certain types of actively managed mutual funds. Traditional mutual funds, index funds, or passive investment strategies generally do not include performance fees.
- Perpetual future#
Perpetual futures contracts, also known as perps, in quantitative finance are a special type of derivative that allow traders to speculate on the price of a cryptocurrency without an expiration date. Think of them like a continuous futures contract.
Perpetual futures are very popular in cryptocurrency trading, but unknown in traditional finance. They were popularised by BitMEX exchange.
Here’s a breakdown of their key features:
No Expiration: Unlike traditional futures contracts that have a set expiry date, perpetual futures can be held indefinitely. This eliminates the need to “roll over” contracts as they approach expiration.
Funding Rate: To keep the price of the perpetual futures contract in line with the underlying cryptocurrency’s spot price, a funding rate mechanism is used. This periodic payment system incentivizes traders to keep the futures price close to the spot price.
Leverage: Perpetual futures contracts often offer high leverage, allowing traders to control a larger position with a smaller amount of capital. This can amplify potential profits but also increases the risk of losses.
Long or Short: Traders can go long (betting on price increase) or short (betting on price decrease), providing flexibility in different market conditions.
How
Trading: Perpetual futures are traded on cryptocurrency exchanges, similar to spot trading.
Funding Rate: The funding rate is periodically paid between long and short position holders. If the funding rate is positive, long position holders pay short position holders, and vice versa. This mechanism helps to anchor the perpetual futures price to the spot price.
Profit and Loss: Profit or loss is realized based on the difference between the entry price and exit price of the contract, multiplied by the contract size and leverage.
In :decentralised finance, you do not need perps to get leverage. Instead, you can build leveraged positions on the top of lending protocols.
See
- Pine Script#
Pine Script is a popular backtesting framework for trading strategies.
A proprietary trading strategy programming language for TradingView. Read more.
Pine Script is a high-level scripting language that is specifically designed for use in creating custom trading indicators and strategies for financial markets. It is used by traders to create custom technical indicators, such as moving averages, Bollinger Bands, and Relative Strength Indicators, as well as more complex algorithms for automated trading.
Pine Script also trades speed to limitations, and it cannot be used for complex trading strategies.
See also
- Poetry#
Poetry is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you. Poetry offers a lockfile to ensure repeatable installs, and can build your project for distribution.
Read more in Poetry documentation.
See also
- Portfolio#
In quantitative finance, portfolio means the list of assets that a trading strategy is currently holding.
Assets can include
Equity - stocks
Bonds - loans
Cryptocurrencies
Derivatives
Depending on the asset, the holdings are expressed as assets, or tokens in cryptocurrencies and trading pair (derivatives).
When the portfolio changes, assets are bought or sold, it is called rebalancing,
See also
- Portfolio construction#
Portfolio construction a trading strategy method of selecting securities to your portfolio optimally to achieve maximum returns while taking minimum risk.
Portfolio constructions involves understanding how different asset classes, funds, and weightings impact each other and an investor’s objectives
Portfolio construction has several phases
Asset allocation models - to determine the optimal mix of asset classes (stocks, bonds, and commodities) in a portfolio, based on historical returns, volatility, and correlations.
Optimization techniques - to identify the best combination of individual securities within each asset class, based on factors such as expected return, risk, and liquidity.
Risk management tools - such as stop-loss orders, hedging strategies, and diversification techniques, to manage portfolio risk and reduce exposure to individual assets or market risks
Alpha generation strategies - such as factor investing, statistical arbitrage, and trend-following, to identify assets that are likely to outperform or underperform the broader market.
Volatility basket is a specific portfolio construction strategy that focuses on the volatility of the assets
See also
Volatility basket
- Position#
In trading strategy, a position means a long or short position of a particular asset betting the price of an asset goes up or down.
In long positions, the trader expects the asset price go up, or appreciate. In short positions, the trade expects the asset price go down.
A position can be a spot market position or a levered position.
See also
- Position sizing#
Position sizing in quantitative finance refers to the process of determining the appropriate size or quantity of an investment position to take in a financial instrument, such as a stock or a derivative, based on a predefined set of rules or strategies. It is a crucial aspect of portfolio management and risk control.
The goal of position sizing is to allocate capital efficiently, taking into account factors such as risk tolerance, investment objectives, market conditions, and statistical analysis. The position size is typically determined by a combination of quantitative models, statistical techniques, and risk management principles.
Some commonly used approaches to position sizing include:
Fixed Fractional Position Sizing: This approach involves allocating a fixed percentage of the total capital to each trade or investment. For example, a strategy might allocate 2% of the total capital to each trade, regardless of the size or risk of the trade.
Kelly Criterion: The Kelly Criterion is a mathematical formula that helps determine the optimal position size based on the probability of different outcomes and their corresponding payoffs. It aims to maximize the long-term growth rate of capital while considering the risk involved.
Risk Parity: Risk parity strategies allocate capital based on the risk contribution of each asset in the portfolio. The position size is determined by the volatility or risk of the asset, aiming for equal risk contributions from each asset class.
Value-at-Risk (VaR): VaR is a risk management metric that estimates the maximum potential loss within a specified confidence level over a given time horizon. Position sizing based on VaR involves allocating capital in a way that limits the potential loss to a predetermined threshold.
Optimization techniques: Mathematical optimization methods can be used to find the optimal position size that maximizes a specific objective function, such as risk-adjusted returns or portfolio diversification.
See also
- Price impact#
Price impact is the difference between the current market price and the price you will actually pay when performing a swap on a decentralised exchange.
Price impact tells how much less your market taker order gets filled because there is not available liquidity. For example, if you are trying to buy 5000 USD worth of BNB token, but there isn’t available liquidity you end up with 4980 USD worth of token at the end of the trade when you pay 5000 USD. The missing fill is the price impact. It can be expressed as USD value or as percent of the trade amount.
Illiquid pairs have more price impact than liquid pairs.
Liquidity provider fees are included in the price impact in AMM models.
Another way to see this: AMMs usually have a trading fee, of 0.30%, for liquidity providers and sometimes for the protocol. This translates to a spread of 0.6% between the best buy order and the best sell order. In other words, even the most liquid AMM trade has an implicit 0.3% price impact. Note that due to competition, the LP fees are going down on newer AMMs.
Read a detailed analysis of how price impact is calculated on Uniswap v2 style AMMs.
See ParaSwap documentation on price impact.
See also XY liquidity model.
See also Slippage.
- Private strategy#
A trading strategy where the source code of the strategy is not disclosed to the public. Private strategies can still be non-custodial and enjoy the benefits of Trading Strategy protocol trade execution and fee distribution.
- Private trading strategy#
A private trading strategy is an investment approach that is not publicly disclosed and is only available to a select group of individuals or institutions. Unlike public trading strategies, which are widely available and marketed to the general public, private trading strategies are typically developed and used by professional traders, hedge funds, or other institutional investors.
Private trading strategies may be based on proprietary algorithms, mathematical models, or unique market insights and are typically designed to provide an edge over more widely available public strategies. The use of private trading strategies can be a means for institutional investors to achieve higher returns and to gain an advantage over the general public in competitive financial markets.
- Profitability#
In quantitative finance, profitability tells how much a trading strategy has generated or is estimated to generate profits.
The profitability is expressed usually as yearly returns %. E.g. 20% profitability means that the trading strategy generates 1/5x return on investment capital yearly.
For multi-user trading strategies, profitability calculations get more complex as you need to take account the funding flow, deposits and redemptions.
TradingStrategy.ai offeres several methods of profitability calculation, for details see Profitability calculations documentation.
Compounding realised positions profit is the preferred method to display profitability across different strategies
See also
- Protocol#
In decentralised finance, a protocol is non-custodial financial service.
In protocol, its users are doing directly transactions on-chain with each other without intermediates, in peer-to-peer manner. Protocols can be built into a blockchain or be smart contract based.
Unlike in traditional finance, in decentralised finance the user is always in control of their assets, making protocols different from centralised services.
See also
- Protocol fee#
In AMM-based decentralised exchanges a protocol fee is the fee taken from your trading costs that goes towards the protocol treasury.
Protocol fee is revenue for the protocol itself.
The distribution of the protocol fee is decided by a DAO.
Usually protocol fee is 0.00% (Uniswap v3 default) - 0.005% (PancakeSwap, Sushi).
See also
- Public trading strategy#
A public trading strategy is an investment approach that is disclosed to and available for use by the general public. This type of strategy is often marketed and sold through books, courses, seminars, or other educational materials. Public trading strategies are designed to provide individuals with a set of guidelines and rules for making investment decisions in financial markets. They typically involve the use of technical analysis, fundamental analysis, or a combination of both to identify opportunities in various asset classes, such as stocks, bonds, commodities, or currencies.
Public trading strategies may also incorporate elements of quantitative analysis, using mathematical models and algorithms to analyse market data and make predictions about market movements. The goal of a public trading strategy is to provide individuals with a systematic approach to investing that can help them achieve their financial goals.
- PyArrow#
PyArrow is Python API for Arrow library.
PyArrow is an open-source Python library that provides a fast, efficient way to process and analyse large datasets, especially those in Apache Arrow format. It is used for handling columnar and/or chunked data in memory, including reading and writing data from/to disk and interprocess communication. PyArrow also provides a rich set of data structures and algorithms for working with arrays, tables, and data frames, as well as support for various data formats such as Parquet, Avro, ORC, and others. The library is designed to be highly performant and can be used in a variety of applications, including data science, machine learning, and data engineering.
See also
Apache Arrow - native library
Parquet - file format
Python - programming language
Jupyter Notebook - data research tool
Trading Strategy Framework - build automated trading strategies with Python
- PyCharm#
PyCharm is an integrated development environment (IDE) used for programming in Python. It provides code analysis, a graphical debugger, an integrated unit tester, integration with version control systems, and supports web development. PyCharm also has a free version specifically designed for education purposes. PyCharm supports Jupyter Notebooks well.
See also
- Python#
One of the most popular and loved programming languages. Python is the number one programming language in quantitative finance.
Python is a high-level, interpreted programming language known for its readability, simplicity, and versatility. It was first released in 1991 and has since become one of the most widely used programming languages in the world. Python is used for a variety of applications, including web development, scientific computing, data analysis, artificial intelligence, and more. It has a large standard library and a supportive community, making it easy to learn and use. Python is also highly extensible, allowing developers to add functionality through libraries and modules. With its clean syntax, readable code, and ease of use, Python is a popular choice for both beginner and experienced programmers.
- QSTrader#
QSTrader is an old Python based algorithmic trading framework.
QSTrader offers strategy backtesting and live execution using portfolio construction theory.
QSTrader is jo longer maintained.
- Quant#
Quants are financial professionals who specialise in the use of quantitative methods to analyse financial data and make investment decisions. They are experts in mathematics, statistics, and computer science and use complex models and algorithms to analyse financial data and make predictions about market movements
Quants work in a variety of settings, including hedge funds, investment banks, and asset management firms, and play a significant role in the field of finance. They use their expertise in data analysis and modelling to develop trading strategies and make investment decisions, often using high-frequency trading technology to execute their trades.
Quants are known for their ability to analyse large amounts of financial data and make decisions quickly, using a data-driven approach to investment.
See also
- Quantitative analysis#
Quantitative analysis is a method of evaluating securities by using mathematical and statistical models. It is a data-driven approach to investment that involves the use of numerical and computational techniques to analyse financial data and make investment decisions.
Quant traders, use tools such as statistical models, algorithms, and high-frequency trading technology to analyse market data, identify trends, and make predictions about future market movements. They rely on historical data, such as stock prices, interest rates, and economic indicators, to develop their models and test their predictions.
Quantitative analysis is commonly used in the field of finance, particularly in hedge funds and institutional trading desks, and can be applied to a variety of asset classes, including stocks, bonds, commodities, and currencies.
- Quantitative finance#
Quantitative analysis is the use of mathematical and statistical methods in finance and investment management. Those working in the field are quantitative analysts (quants). Quants tend to specialise in specific areas which may include derivative structuring or pricing, risk management, algorithmic trading and investment management.
See also
- Quantstats#
Quantstats is a popular Python software development library for quantitative finance calcualtions and charts.
It provides many tools out of the box to analyse your strategies, including
Monthly returns and return distribution charts
Metrics calculations like Maximum drawdown and other risk-adjusted return numbers
See also
- Quote token#
In algorithmic trading, the token that acts as a nominator for the price when you are buying or selling. Usually this is more well-known token of the pair: ETH, BTC or any of various USD stablecoins. The opposite is base token.
For example trading pair can be: BTC-USDT. In this case the base token BTC and quote token is USDT.
See also
- Real yield#
In decentralised finance, real yield means true profit earned by protocol. Real yield is sustainable, and usually comes from trade fees or profits: there is user demand for the service and users are willing to pay for it.
The opposite of real yield is subsidised profit, which is paid from the protocol treasury or with minted new token (“printing tokens”). The most infamous case of non-real yield was Terra’s Anchor protocol that promised “guaranteed 20% Annual Percentage Yield (APY)”. The yield was funded from Terra’s treasury and then the treasury and token value collapsed, it took Anchor depositors with it.
- Realised profit and loss#
Realized Profit and Loss refer to the actual gains or losses incurred from the sale or closure of an investment or asset. A “realized profit” occurs when an asset is sold for a price higher than its purchase price, while a “realized loss” occurs when an asset is sold for a price lower than its purchase price. These are different from “unrealized” profits or losses, which represent potential gains or losses on assets that are still owned and have not yet been sold. Realized profits and losses are typically recorded in financial statements and are subject to taxation.
See also
- Realised risk#
Realized risk refers to the actual risk that has manifested in a financial investment or trading position, leading to either a loss or lower-than-expected returns. It is the quantifiable loss or underperformance that occurs once a position is closed, as opposed to potential or “unrealized” risks that exist while a position remains open. Realized risk essentially captures how much an investor’s concerns or expectations about market risk have actually materialized.
Example: If an investor buys a stock at $100 per share and later sells it at $90, the realized risk is a 10% loss on the investment. This is an example of a risk that has been “realized” because the position is closed and the loss is confirmed.
See also
- Rebalance#
In a trading strategy, rebalance refers to the process of re-weighting the portfolio by selling some assets and buying new ones.
Rebalances are needed in order for the strategy to follow its alpha model.
Rebalances can be done at fixed intervals, usually hourly, daily or weekly.
In the process, the strategy opens new and closes existing positions.
See also
- Rebase token#
Rebase tokens, also known as elastic tokens, are cryptocurrencies whose supply is algorithmically adjusted in order to control its price. They adjust their circulating supply in response to price fluctuation and are designed in a way that the circulating token supply adjusts (increases or decreases) automatically according to a predetermined formula.
An example of a rebase token is Klima.
See also
- Regime filter#
In a trading strategy, a regime filter tells the current market regime.
The strategy should modify its behavior based on the direction of the markets
In a bull market make more aggressive bets
In a bear market - conserve cash and open more short positions
Some regime filters are
Bitcoin 200-days moving average - if we are above 200 days moving average cryptocurrencies are in a bull market
Machine learning based clustering
Market regime filter examples
See also
- Regularization#
In machine learning, regularization is a technique for reducing overfitting by adding a penalty term to the loss function. It is a form of regression that constrains the model to prevent it from learning the training data too well.
Regularization is a common practice in machine learning and statistical modeling. It is used to prevent overfitting, which occurs when a model performs well on the training data but does not generalize well to new data.
The process involves adding a penalty term to the loss function that penalizes the model for learning the training data too well. The penalty term is typically a function of the model parameters, such as the sum of the squared weights or the sum of the absolute values of the weights. The penalty term is added to the loss function to create a new loss function that is minimized during training.
Regularization can be used to compare different models or to tune the parameters of a model. It can also be used to select the best features for a model or to determine the optimal number of features.
See also
- Reinforced learning#
Reinforcement learning is a type of machine learning where an agent learns to make decisions by interacting with an environment. The agent receives feedback in the form of rewards or penalties for its actions, allowing it to improve its decision-making over time. This approach enables the agent to learn optimal strategies for achieving goals in complex, dynamic environments without explicit programming of every possible scenario.
Reinforced learning is used in algorithmic trading to predict the success of trades and train a model that can automatically trade.
A popular tool to use reinforced learning for trading strategies is FinRL.
Learn more about AI trading in Trading Strategy learning resources.
See also:
- Relative strength index (RSI)#
The Relative Strength Index (RSI) is a popular momentum indicator used in technical analysis to measure the strength of a security’s price action. It compares the magnitude of recent gains to recent losses, in order to determine overbought or oversold conditions, and potential buying or selling opportunities.
The RSI is calculated as a ratio of average gains to average losses, and is represented as a value between 0 and 100. Values above 70 are considered overbought and may indicate a potential sell opportunity, while values below 30 are considered oversold and may indicate a potential buy opportunity. The RSI can be used for various time frames and for multiple securities, including individual stocks, bonds, commodities, and currencies.
See also
- Reserve currency#
In the trading strategy terminology, a reserve currency refers to the base currency of the strategy to which profits are withdrawn.
A common reserve currency for decentralised finance strategies is USDC stablecoin.
- Risk of ruin#
In quantitative finance, Risk of ruin refers to the probability of incurring losses severe enough to render a trading account or strategy unviable. This can occur due to a series of consecutive losing trades, excessive leverage, or poor risk management practices.
To minimize the risk of ruin, traders should employ prudent risk management techniques, such as setting appropriate position sizes, using stop-loss orders, and maintaining a diversified portfolio. Additionally, monitoring the performance of a trading strategy and making adjustments as needed can help reduce the likelihood of ruin.
See also:
- Risk-adjusted return#
Risk-adjusted return is a calculation of the return (or potential return) on an investment such as a stock or corporate bond when compared to the amount of risk the investment has represented throughout a given period of time.
It is measured by taking into account the risk associated with an investment and comparing it to its return. The risk can be measured e.g. as a maximum drawdown.
See also
- Risk-free rate#
The expected return for the money that is considered (almost) risk-free.
In traditional finance, the risk-free rate is considered to be treasury note or government bond yield, although you still have some risks like the sovereignty risk.
In decentralised finance, a risk-free rate is considered to be an US dollar lending pool rate, like one you would get from Aave USDC pool.
See also
- RSI#
- Rug pull#
A project where the development team or founders decide to maliciously cash out early, not fulfilling their promises and disappear with the investor money.
A rug pull is a type of crypto scam in which fraudsters lie to the public to attract funding and quickly run off with investors’ digital tokens. Developers behind rug pulls often promote their tokens on social media platforms to attract as many retail investors as possible. The name comes from the phrase “pulling the rug out” and involves a developer attracting investors to a new crypto project, then pulling away all liquidity.
- RWA#
In decentralised finance, RWA stands for Real World Asset.
Unlike cryptocurrencies and pure digital assets, like art NFTs, real-world assets have a real-world ownership representation.
RWAs can be
Real-estate
Bonds
Stock
Land
Forest
Energy
Carbon certificates
RWAs can trade on lending protocols and decentralised exchanges. RWAs need special oracles to bring information about the real-world asset data to on-chain.
As the writing of this, most popular RWA classes are stablecoins and bonds.
For RWA case studies, see
See also
- Sentiment analysis#
In quantitative finance, Sentiment analysis, also known as opinion mining, is a technique used to analyze and classify the sentiment or emotion expressed in a piece of text. This can be done by using natural language processing and machine learning algorithms to identify and extract subjective information from the text, such as opinions, emotions, and attitudes.
Sentiment analysis can be used to determine the overall sentiment of a document, sentence, or even individual words, and can help businesses and organizations gain insights into customer feedback, social media posts, and online reviews. By analyzing sentiment, companies can better understand customer needs and preferences, improve their products and services, and make more informed business decisions.
Sentiment analysis can also be used in a variety of other applications, including political analysis, market research, and brand management.
There are several libraries available in Python that you can use to perform sentiment analysis. One of the most popular libraries is the Natural Language Toolkit (NLTK).
See also:
- Sharpe#
Sharpe, or The Sharpe Ratio, is a widely used financial metric that measures the risk-adjusted return of an investment. It was developed by Nobel laureate William F. Sharpe in 1966.
The Sharpe ratio is calculated by subtracting the risk-free rate (such as the yield on a Treasury bond) from the return of the investment, and then dividing the result by the standard deviation of the investment’s returns. The formula is:
Sharpe Ratio = (Return of investment - Risk-free rate) / Standard deviation of investment’s returns
The Sharpe ratio helps investors evaluate an investment’s return in relation to the risk taken to achieve that return. A higher Sharpe ratio indicates that an investment has generated higher returns relative to the amount of risk taken, while a lower Sharpe ratio indicates the opposite.
Generally speaking, a Sharpe ratio above 1 is considered good, and a Sharpe ratio above 2 is considered excellent. However, what is considered good or excellent can vary depending on the context. For example, a lower Sharpe ratio may be acceptable for investments with lower risk or lower volatility, while a higher Sharpe ratio may be necessary for investments with higher risk or higher volatility.
See also
- Shorting#
Short selling, also known as shorting or going short, is a trading strategy in which an investor borrows as aasset, sells the borrowed asset, and then aims to buy the asset back at a lower price to make a profit.
The goal of short selling is to profit from a decline in the price of the security being shorted. In a short sale, the investor borrows shares from another investor, typically through a brokerage, and sells the borrowed shares on the open market. If the price of the security drops, the investor can buy the shares back at a lower price and return the borrowed shares to the lender, pocketing the difference as profit. However, if the price of the security increases, the short seller incurs a loss, which can be unlimited.
Short selling is a high-risk strategy that requires a solid understanding of market dynamics and a careful risk management plan.
In decentralised finance, you can build a short trade using lending protocols.
See also
- Slippage#
Slippage is the loss because markets changed after the trade was initiated but before it was executed.
Slippage occurs because of changing market conditions between the moment the transaction is submitted and its verification. Slippage cannot be backtested easily, because it is based on the trade execution delays and those cannot be usually simulated (but can be measured).
DEX swap orders have a slippage tolerance parameter with them. You set it when the order is created. If the price changes more then the slippage tolerance between the creation of the order and the execution of the order, the DEX will cancel the order (revert).
Setting a low slippage tolerance value prevents frontrunning your trades, because frontrunners cannot extract more value than what your slippage tolerance is.
See ParaSwap’s excellent documentation on slippage.
See also Price impact.
- Smart contract#
Smart contract is automated transactional service running on any of the blockchains.
A smart contract contains the terms of the agreement between parties, and automatically executes the terms when certain predetermined conditions are met. Smart contracts are tamper-proof, transparent, and autonomous, and they eliminate the need for intermediaries such as lawyers, brokers, or banks. This makes them a secure and efficient way to automate financial transactions, manage digital assets, or automate other types of agreements
An automated transactional service running on any of the blockchains supporting smart contracts. Typically runs on Ethereum-based blockchain and is written in the Solidity programming language.
See also
- Sortino#
The Sortino ratio is a risk-adjusted return measure that is used to evaluate the return of an investment relative to its downside risk, as measured by the standard deviation of negative returns. It was developed by Frank A. Sortino, a financial researcher and academic.
The Sortino ratio is similar to the Sharpe ratio, but instead of using the total volatility of returns, it only considers the downside volatility. This is based on the premise that investors are more concerned with the risk of losing money than they are with the risk of missing out on potential gains.
The Sortino ratio is useful in comparing the risk-adjusted performance of different investments or portfolios. A higher Sortino ratio indicates a better risk-adjusted return, while a lower ratio indicates a lower risk-adjusted return.
As a rough guide, a Sortino ratio of 1 or higher is considered good, while a ratio of 2 or higher is considered excellent.
Relationship to downside volatility
The Sortino ratio is more closely related to downside volatility because it specifically targets the negative fluctuations in returns. This focus on downside risk makes the Sortino ratio particularly useful for investors who are more concerned about potential losses than overall volatility.
Downside focus: The Sortino ratio acknowledges that upside volatility is generally not a concern for investors, as they typically welcome positive surprises in returns.
Penalizing negative returns: By using only the downside deviation, the Sortino ratio penalizes investments with a higher frequency or magnitude of negative returns more heavily than the Sharpe ratio would.
Applicability: The Sortino ratio is especially useful for evaluating investments or strategies with asymmetric return distributions or those designed to limit downside risk.
Complementary use: Both ratios can be used together to provide a more comprehensive view of an investment’s risk-adjusted performance.
Examples
Cryptocurrency: Highly volatile, but you only care about number going up
Investing in stocks over three years time horizon: In this time horizon if market goes dow it may have no time to recover
Formulas
The formula for calculating the Sortino ratio is as follows:
Sortino ratio = (Rp - Rf) / downside deviation
Where:
Rp = portfolio return Rf = risk-free rate of return Downside deviation = standard deviation of negative returns
See also:
- Spot market#
A spot market is a market where actual assets are traded as the opposite of interest to the assets.
In cryptocurrency markets, spot market is where you receive actual tokens for your purchases.
In stock markets, you will receive stock certificate
In commodities markets (oil, wheat, etc.), you will receive a physically delivered item
Spot market itself does not have shorting, or leverage.
See also
- Spot-forward basis#
See cash and carry.
- Stablecoin#
A stablecoin is a type of cryptocurrency whose value is tied to an asset such as the U.S. dollar or gold to maintain a stable price. Stablecoins aim to provide price stability and reduce volatility compared to other cryptocurrencies.
Example stablecoins include
Circle USD - USDC.
Binance dollar - BUSD
Tether dollar - USDT
See also
- Standard Deviation#
Standard deviation is a statistical measure that quantifies the dispersion or variability of a data set around its mean (average). In finance and investment, standard deviation is often used as an indicator of risk or volatility. A higher standard deviation indicates greater variability in the data set or more volatility in a financial asset, while a lower standard deviation indicates less variability or lower volatility.
Example: For the data set [1, 3, 3, 6, 7, 8, 9], the standard deviation is 2.92
Usage: In financial markets, standard deviation is commonly used as a measure of an asset’s volatility, which helps investors and traders understand the asset’s risk profile. A higher standard deviation implies more unpredictability in price movement, signaling higher risk, while a lower standard deviation indicates less risk and more stable returns.
Standard deviation and volatility are closely related concepts, especially in the context of finance. Volatility is essentially a practical application of standard deviation, often used to gauge the risk associated with different financial instruments.
See also
- Statistical arbitrage#
Statistical arbitrage is a high-frequency trading trading strategy that uses statistical and quantitative techniques to identify and exploit pricing inefficiencies in financial markets.
The strategy involves taking long and short positions in pairs of securities that are believed to be mispriced relative to each other.
The basic idea behind statistical arbitrage is to identify pairs of securities that are highly correlated in terms of their price movements. If the prices of these securities diverge from their historical correlation, a statistical arbitrageur will take a long position in the underpriced security and a short position in the overpriced security, in the hope of profiting from the convergence of prices.
Statistical arbitrage strategies typically involve a high level of automation, using computer algorithms and mathematical models to analyze large amounts of data and make trades in real time. These algorithms may use a variety of statistical and mathematical techniques, such as regression analysis, machine learning, and time series analysis, to identify and exploit pricing inefficiencies.
One advantage of statistical arbitrage is that it can be used in a variety of market conditions, including both up and down markets. However, the strategy can be complex and may require significant computational resources and expertise to implement effectively. In addition, as with any investment strategy, there is always the risk of losses due to unforeseen market events or unexpected changes in correlations between securities.
See also
- Statistical modeling#
Statistical modeling is the process of using statistical techniques to analyze data and make predictions about future events. It is a form of regression that uses statistical methods to estimate the parameters of a model.
Statistical modeling is a common practice in machine learning and data science. It is used to analyze data and make predictions about future events.
The process involves fitting a statistical model to the data and then using the model to make predictions. The model is typically a mathematical function that describes the relationship between the variables in the dataset. The model is fitted to the data by estimating the parameters of the model using statistical methods.
Statistical modeling can be used to compare different models or to tune the parameters of a model. It can also be used to select the best features for a model or to determine the optimal number of features.
See also
- Stochastic oscillator#
The Stochastic Oscillator is a widely used technical indicator tool in quantitative finance that helps traders assess the momentum of an asset’s price movement. The primary function of the stochastic oscillator is to determine the position of the current closing price relative to the price range (i.e., the high-low range) over a specified period. This oscillator is particularly effective in identifying potential reversal points, overbought and oversold conditions, and confirming trends.
See also
Technical indicator-based strategies
- Stochastic RSI indicator#
Stochastic RSI (StochRSI) is a technical indicator used in quantitative finance, combining the concepts of the :term;`Stochastic Oscillator` and the Relative Strength Index (RSI). It is primarily used to identify overbought and oversold conditions in a market, as well as potential price reversals. The Stochastic RSI is more sensitive and responsive than the traditional RSI, making it popular among traders looking for early signals.
Key Components:
Relative Strength Index (RSI): RSI is a momentum oscillator that measures the speed and change of price movements. It ranges from 0 to 100, typically with thresholds at 70 (overbought) and 30 (oversold).
Stochastic Oscillator: The Stochastic Oscillator measures the level of the close relative to the range of highs and lows over a certain period. It also ranges from 0 to 100, with common thresholds at 80 (overbought) and 20 (oversold).
Examples:
Buy Signal: When StochRSI moves above 20, indicating the asset might be transitioning out of oversold territory.
Sell Signal: When StochRSI moves below 80, indicating the asset might be moving out of overbought territory.
See also:
- Stop loss#
Stop loss is a risk management tool used by investors and traders to limit their potential losses on a trade.
Stop loss can be implemented by
Having a special order type on order book
Manually, by using market orders
A stop loss order is an instruction to automatically sell a security or other asset when its price falls to a certain level, known as the stop price.
For example, if an investor buys a stock at $50 per share and sets a stop loss order at $45 per share, the stop loss order will be triggered if the stock falls to $45 or below. At that point, the stop loss order will automatically sell the stock, limiting the investor’s potential loss to $5 per share.
Stop loss triggers can be particularly useful in volatile markets or when trading more speculative assets with higher levels of risk. By setting a stop loss order, traders can limit their exposure and losses in the event that the market moves against them, while still allowing for potential gains if the trade is successful.
It’s important to note that stop loss orders are not foolproof and can be subject to market fluctuations and gaps in trading. In addition, stop loss orders can be triggered during periods of high volatility or sharp price movements, resulting in a sale at a price below the stop price. As with any investment strategy, it’s important to carefully consider the risks and benefits of using stop loss orders and to use them in combination with other risk management tools and techniques.
See also
- Storj#
The Storj protocol is a decentralized cloud storage platform that allows users to rent out unused hard drive space for digital file storage. It offers zero-trust security and can be used for large file storage, streaming and backups. Storj runs on its own blockchain model, but for the interaction the user does not need to know about the blockchain at all.
Due to its decentralised mode, Storj storage and egress costs are very competitive compared to centralised cloud offerings such as from Amazon, Microsoft or Google.
Storj has an ERC-20 token called STORJ.
See also
- Strategy#
In a decentralised finance, strategy refers to :trading strategy.
See trading strategy.
- Strategy age#
In trading strategy, the age refers to the duration how long the strategy has been doing live trading.
Performance metrics need enough live trading data to be available to be calculated. Longer the strategy has been trading, more high quality and refined its data get.
If live trading data is not available, estimations of the strategy performance can be made based on backtests.
See also
- Strategy cycle#
In Trading Strategy Framework, the strategy cycle refers to the timestamped process of developing, testing, and implementing a trading strategy.
This process typically involves several steps, including research and analysis, design, optimization, backtesting, and live trading. The strategy cycle is an iterative process, and the results of each step can influence the next. The goal of the strategy cycle is to identify and develop a profitable and reliable trading strategy that can be consistently executed. The end result of the strategy cycle is a well-designed, thoroughly tested, and successfully deployed trading strategy that can help achieve investment goals.
See cycle duration.
- Strategy decay#
In quantitative finance, strategy decay means that a trading strategy loses is excessive profit, or alpha generation, capabilities over time.
“Strategy decay is one of the trickiest aspects to manage within the realm of quantitative trading. It involves previously performing strategies that gradually, and sometimes rapidly, lose their performance characteristics and end up becoming unprofitable.”
“Quantitative trading strategies almost unilaterally rely on the concept of forecasting and/or statistical mispricing. As more and more trading entities–retail or institutional–implement similar systematic strategies the mispricings give way to price efficiency. The gain derived from such strategies is eroded and then usually falls to the level of transaction costs required to carry it out, making them unprofitable.”
“This means that quantitative trading is not a “set and forget” activity. In reality quant traders need to have a portfolio of strategies that are slowly rotated out over time once any arbitrage opportunities begin to erode. Thus constant research is required to continually develop new profitable edges that replace those that have been arbed away”.
One common way to measure and visualise strategy decay is visualising rolling Sharpe ratio. If Sharpe is getting worse over time, the strategy is decaying.
See also
- Strategy developer#
A strategy developer is a financial professional who designs and implements investment strategies. They are responsible for analysing market data, identifying trends and opportunities, and creating investment plans that aim to achieve specific financial goals.
Strategy developers use a combination of quantitative and qualitative analysis to make investment decisions, drawing on their expertise in economics, finance, mathematics, and computer science. They also use a variety of tools and technologies, including statistical models, algorithms, and high-frequency trading systems, to support their work.
Strategy developers work in a variety of settings, including hedge funds, asset management firms, and investment banks, and may specialise in a specific asset class, such as stocks, bonds, commodities, or currencies. They are typically highly skilled and experienced professionals who have a deep understanding of financial markets and investment strategies. Effective strategy development requires a combination of technical expertise, market knowledge, and creativity, as well as a sound risk management plan to ensure that investment decisions align with the goals and risk tolerance of the investor.
See also
- Supervised learning#
Supervised learning is a type of machine learning that involves training a model using labeled data. It is a form of regression that uses labeled data to train a model.
Supervised learning is a common practice in machine learning and data science. It is used to train a model using labeled data.
The process involves fitting a model to the data and then using the model to make predictions. The model is typically a mathematical function that describes the relationship between the variables in the dataset. The model is fitted to the data by estimating the parameters of the model using statistical methods.
Supervised learning can be used to solve classification and regression problems. Classification problems involve predicting a discrete class label, while regression problems involve predicting a continuous quantity.
See also
- Survivorship bias#
In quantitative finance, Survivorship bias refers to the tendency to focus on assets, strategies, or systems that have survived or performed well over a certain period, while ignoring those that have underperformed or ceased to exist. This can lead to an overestimation of the performance or reliability of a trading strategy, as the analysis does not take into account the entire population of assets or strategies.
Survivorship bias can be mitigated by incorporating a more comprehensive dataset that includes both successful and unsuccessful assets or strategies, and by carefully considering the potential impact of survivorship bias on performance evaluations.
See also:
- Sushi#
In decentralised finance, Sushi, also known as SushiSwap, is one of the largest AMM decentralised exchanges.
Sushi started as a fork of Uniswap. The later Sushi versions added support for CLMM liquidity models and many other trading features.
Sushi is launched on many blockchains, including Ethereum mainnet, Polygon, Avalanche and BNB Chain. View Sushi on Ethereum mainnet.
See also
- Swap#
In AMM-based decentralised exchanges trades called called swaps.
In a swap you you trade against liquidity providers with market order like trades.
The user interacts with a liquidity pool using :their term:non-custodial wallet to perform a swap.
Some example swaps:
In a buy swap, you bought cryptocurrency token with a stable coin, e.g. you buy AVAX with USDC stablecoin
In a buy sell, you bought cryptocurrency token with a stable coin, e.g. you sell AVAXs to gain USDC in your wallet
Swaps are used on AMMs <AMM>.
See also
- Swap fee#
Swap fee is the part cost of a trade on AMM markets.
In AMM-based decentralised exchanges trades called called swaps.
Swap fee includes
liquidity provider reward, usually 0.05% - 0.30%
protocol fee, usually 0.00% - 0.05%
Swap fees usually exclude
See also
- Swing trading#
Swing trading is a type of short-term trading strategy that aims to take advantage of intermediate-term price movements, typically holding positions for several days to a few weeks. The goal of swing trading is to identify trends and ride them for a profit, rather than trying to predict the market’s direction in the long-term. Swing traders use technical analysis to identify potential trades, focusing on price patterns, support and resistance levels, and momentum indicators. They typically trade more frequently than long-term investors and hold positions for a shorter period, but with the potential for larger profits or losses. Swing trading can be used in a variety of markets, including stocks, bonds, commodities, and currencies.
- Systematic trading#
Systematic trading is a method of trading financial markets that utilises mathematical models and algorithms to execute trades based on predefined rules and conditions. It aims to remove emotion and subjectivity from the investment process by relying on data-driven decision making.
In systematic trading, trades are executed automatically based on the rules established in the trading system. These rules can be based on technical indicators, market data, or other signals, and are designed to identify and take advantage of market inefficiencies and price discrepancies. The models used in systematic trading are typically back-tested using historical market data to assess their viability and refine their parameters.
Systematic trading is often used in quantitative finance and high-frequency trading, where trades are executed at a high rate and on a large scale. It can be applied to a wide range of financial instruments, including stocks, bonds, futures, options, and currencies.
- Tactical asset allocation#
In quantitative finance, Tactical Asset Allocation (TAA) is an investment strategy in finance that involves actively adjusting the allocation of assets within a portfolio to take advantage of short-term market opportunities or to manage risk.
It is a dynamic approach that aims to capitalize on market inefficiencies, mispricings, or changing market conditions.
TAA differs from strategic asset allocation, which focuses on establishing a long-term allocation mix based on the investor’s goals, risk tolerance, and investment horizon. In contrast, TAA involves making short-term shifts in asset allocation based on market forecasts, economic indicators, or other relevant factors.
The goal of tactical asset allocation is to enhance portfolio performance by overweighting or underweighting certain asset classes, sectors, or geographic regions at specific times. For example, if an investor believes that the stock market is overvalued and poised for a downturn, they may decrease their equity exposure and increase their allocation to bonds or cash. Conversely, if favorable conditions are anticipated for a particular sector or region, the investor may overweight those assets to potentially achieve higher returns.
TAA strategies can be implemented using various techniques, including fundamental analysis, technical analysis, quantitative models, or a combination of these approaches. It requires active monitoring of market trends, economic indicators, and other relevant factors that can influence asset prices. TAA may be executed through individual security selection, the use of exchange-traded funds (ETFs), or other investment vehicles.
See also
- Take Profit#
The predetermined price level at which you plan to close out an open position for a profit. This is set when you initially establish the position. This is the price at which you want to sell and take your profit. It is important to set a take profit target and stick to it. If you don’t, you may end up holding a position for too long and lose your profit.
This can be different to position exit that is profitable. Profitable trades that have been exited due to trailing stop loss without reaching the Take Profit limit are a different category.
The number of ‘Take Profits’ may be difficult to calculate if the strategy developer has implemented their own method without using built in methods. The same goes for trailing stop loss as well.
See also
- Technical analysis#
Technical analysis is a trading discipline employed to evaluate investments and identify trading opportunities by analysing statistical trends gathered from trading activity, such as price movement and volume.
Technical analysis in trading is the study of historical price movements and patterns on charts to predict future market behavior. It uses various indicators, chart patterns, and statistical tools to identify trends, support and resistance levels, and potential entry or exit points for trades. The core assumption of technical analysis is that all relevant market information is reflected in the price, and that price movements are not entirely random but follow identifiable patterns that tend to repeat over time.
Technical analysis is the opposite of fundamental analysis.
More information in Wikipedia.
See also
- Technical indicator#
A technical indicator, or just an indicator, is a calculated value indicating something about the state of the market.
Indicators are usually based on OHLCV data.
By combining several indicators through technical analysis, one can create automated trading strategies.
Example technical indicators are e.g. EMA (exponential moving average) and Average Directional Index (ADX).
If you are developing your algorithmic trading strategy using Trading Strategy framework, see Technical analysis documentation for available technical indicators.
See also
- Test set#
In machine learning, the test set is a subset of data that is used to evaluate the performance of a model. It is a set of data that is not used to train the model.
The test set is typically a random sample of the dataset. It is used to evaluate the performance of the model by measuring its accuracy on the test set.
The test set is used to evaluate the performance of the model, while the training set is used to fit the parameters of the model. The training set is typically a random sample of the dataset that is used to train the model.
See also
- Time frame#
See bucket.
- Time in Market#
“Time in Market” refers to the duration for which a trading strategy or an algorithm maintains positions in the market. In algorithmic trading, strategies are often designed to exploit short-term market inefficiencies or trends, and the duration for which they hold positions can vary significantly.
For example, some algorithmic trading strategies may execute trades within microseconds or milliseconds, aiming to capitalize on very short-term price movements. These strategies have a minimal “time in market” as they quickly enter and exit positions. On the other hand, some strategies may hold positions for longer durations, ranging from minutes to hours or even days. These strategies rely on capturing larger market trends or exploiting fundamental factors that may take time to unfold. They have a longer “time in market” compared to high-frequency trading strategies.
Time in Market can be also percents expressing how long the strategy hold any position open vs. just having cash. For example 30% Time in Market means that the strategy hold the underlying assets for 30% of its life time, and was all cash 70% of the time.
Usually Time in Market also correlates with the position count: if the time in market is low, it means strategy is opening positions less frequently.
See also
- Token#
A token in blockchains and decentralised finance represents an on-chain asset.
Tokens can be
Fungible tokens: assets like crytocurrencies, stablecoins
Non-fungible tokens (NFTS), like tokenised pictures and video game items
ERC-20 is the most popular technical token standard.
See also
- Token distribution#
In decentralised finance, a token distribution refers to how the project tokens have been divided between different stakeholders.
More decentralised token distribution is usually good for price action and robustness of the project; there are less large entities that can dominate the DAO governance discussion or be a single point of a failure. Decentralisation and better token distribution lessen the likelihood of severe price impact events.
Token distribution methods include
Initial coin offering (ICO)
Initial DEX offering (IDO)
Initial token offering (ITO)
Direct market listing
Public sale
Private sale
Simple Agreement for Future Tokens (SAFT)
Proof-of-work (Bitcoin, Chia, others)
See also
- Token tax#
A “token” tax is a term often used to describe tokens with transfer fees that cause deflation or redistribute trade profits to the protocol development:
Each time a token is transferred, some transferred amount is burned, redirected to a development fund or otherwise “taxed”.
Token tax is usually paid by the originator wallet that initiates the transfer. The tax is taken from the sent amount during the transfer: initiated transfer amount > received transfer amount.
Token tax may also reduce the token supply, thus creating deflationary tokens. The deflationary assumption comes from the economic theory that by reducing the supply, the value of the goods should go up. The most famous cryptocurrency having such deflationary mechanics is Ethereum and its EIP-1559 burning mechanism.
Token tax can redirect some of the transfer and trading fees to the protocol development fund. This can guarantee sustainable protocol development outside any initial fundraising.
Usually, the token tax term is not used for the native gas token on a blockchain, like Ether (ETH) on Ethereum, where any transfer fee is considered to be a natural part of the core protocol. The token tax term applies to ERC-20-like tokens that historically have lacked transfer fee features. There is no terminology standard, so different terms are applied in different contexts.
Different % amounts of “taxes” may apply to different types of transactions like buy, sell, and treasury management.
Read more about token tax in our introduction blog post.
Taxed tokens are not supported by Uniswap 3. Note that any bridged tokens cannot have transfer fees, so if you bridge a taxed token from Ethereum mainnet e.g. to Polygon it will work on Uniswap v3.
See also
- Total equity#
In trading strategy, total equity refers to all assets under the management of the strategy minus liabilities.
In decentralised finance, this may also be called Total value locked (TVL) or total assets depending on the use case.
Total equity is usually expressed in US dollars. For a trading strategy, the total equity is
All assets, which may include
Cash
Open trading positions
Minus liabilities
Undercollateralised loans
If a strategy is closed and all assets can be sold without price impact and slippage, each investor will get:
investor shares * total equity / total shares
Equity curve shows how total equity has grown over time. Total equity can grow by trading profits and new deposits, and decrease by redemptions and trading losses.
See also
- Total value locked (TVL)#
In decentralised finance, total value locked (TVL) refers to the amount of the assets locked in a protocol.
The calculation is the same: take amount of assets in a smart contract addresses. However the meaning of the metric may vary depending on what the related protocol is doing:
For wealth management and funds: In traditional finance, the term used is Assets under management (AUM). However, because DeFi protocols are non-custodial and assets are always under the management of the users themselves, AUM term cannot be used.
For trading, like AMM decentralised exchange: This means how many tokens there is sitting in a trading pool, an order book equivalent. Essentially, this is the lit market depth of a token. Based on the DEX pool TVL, and its shape, you can calculate the price impact of any trade, including hypothetical historical trades.
See also
- Trade frequency#
In trading strategies, a trade frequency is a metric telling how often the strategy makes a trade.
High frequency strategies can make several trades per minute
Mid frequency, intra day and breakout strategies can make several trades per day
Low frequency, more macroeconomics strategies, can make some trades per year
Buy and hold strategy makes only two trades: enter the position and then sell it later
The trading frequency does not need to be constant. The strategy can take more positions and trade differently in different market regimes, like bull and bear markets, depending on the volatility of the underlying market.
The higher the trading frequency is, more trading fees will occur. Strategies that make trades too often might not be profitable on high-free trading venues like some decentralised exchanges like Uniswap v2-compatibles.
Trades do not necessarily mean opening and closing the whole position: trades can also occur to adjust the position sizing and risk mitigation measurements.
See also
- Trades last week#
In Trading Strategy Protocol, trades last week is a metric who many successful trades a trading strategy did last week.
This metric tells who lively the underlying algorithm has been recently.
See also
- Trading algorithm#
Algorithmic trading is a method of executing orders using automated pre-programmed trading instructions accounting for variables such as time, price, and volume. Trading algorithms can be fundamentally driven or based on quantitative signals, and can be created using Python with tools such as Trading Strategy.
See also algorithmic trading and automated trading strategy.
- Trading pair#
In decentralised finance, trading pair represents a market for a two or more tokens.
An example trading pair can be BNB/BUSD trading pair on PancakeSwap <https://tradingstrategy.ai/trading-view/binance/pancakeswap-v2/bnb-busd>__.
Trading pairs are named as a “ticker” based on their base token and quote token symbols.
Sometimes trading pairs are also called pools, because they are liquidity pool mechanism based.
Unlike in traditional finance, in decentralised finance a trading pair can also consists of three or more assets. This is especially popular in stablecoin markets.
Trading pairs can be
Order book based
Liquidity pool based
See also
- Trading signal#
A signal that predicts the future price movement.
For the full description, see alpha signal.
- Trading strategy#
In quantitative finance, a trading strategy is a fixed plan that is designed to achieve a profitable returns for its investors.
Common trading strategies include:
Index investing
A trading strategy may look to optimise cumulative profit or risk-adjusted return.
Further strategies can be classified by their activity and risk profile as
The trading strategy can be automated as algorithmic trading and thus become automated trading strategy. Automated strategies can be e.g.
Technical indicator-based strategies
Trend-following
Market-making (see AMM for decentralised finance)
Arbitrage
Scalping
Trading strategies can be objectively compared to each other. This is called benchmarking.
Trading Strategy can also refer to Trading Strategy Protocol which is a solution for creating trading strategies for decentralised finance.
See also
- Trading Strategy client#
Trading Strategy client is a Python library to access the historical market data on Trading Strategy protocol oracles.
The data includes
Decentralised exchanges market data in candle and OHLCV format
You can then examine the data in Jupyter notebook.
Read the API documentation for
tradingstrategy.client.Client
See also
- Trading Strategy Framework#
The Trading Strategy Framework is a Python-based software development library to develop automated trading strategies for decentralised finance markets. The core audience of the library is quants.
The framework consists of
Market data feed reader in the form of Trading Strategy Client
Backtesting framework based on Jupyter Notebook
Third-party capital deposits using vaults
See also
- Trading Strategy Protocol#
Trading Strategy Protocol is an algorithmic trading solutions for decentralised finance using AMMs and lending protocols.
It offers non-custodial way for creating trading strategies. Quants can develop and backtest their strategies using Python.
Live trading strategies can be securely executed using vaults.
For introduction information, visit Trading Strategy website.
See also
- Trading universe#
A trading universe describes all possible assets available for a strategy for its to take different trading positions. The simple trading strategies trade only a single trading pair like ETH/USD. More complex strategies can have trading universe consisting of thousands of trading pairs and assets.
- TradingView#
Trading view is the world most popular trading strategy platform. It lets you discover investment ideas and showcase your talents to a large and active community of traders. Easy and intuitive for beginners, and powerful enough for advanced chartists. Trading View has all the charting tools you need to share and view trading ideas. Real-time data and browser-based charts let you do your research from anywhere, since there are no installations or complex setups. Read more.
- Traditional finance#
In decentralised finance, traditional finance or TradFi, refers to the old financial system.
TradFi consists of regulated securities markets, banks, commodities and FX markets. TradFi markets are considered to be inefficient compared to decentralised finance, due to excessive amount of middlemen, custodials and lack of automation.
See also
- Trailing stop loss#
A trailing stop loss is a special order type or a trigger parameter, which will keep updating the position’s stop loss dollar limit as the market price moves.
Trailing stop loss is set on a position when opening it
Trailing stop loss is usually specified as % of the market price
Trailing stop loss dynamically updates the position’s stop loss upwards if the market price moves upwards
If the market price moves downwards, the highest and the latest trailing stop loss mark is triggered
Trailing stop loss allows you to lock in profits in raising markets
See also
For more information see Trailing stop Loss on CMC Markets.
- Training set#
In machine learning, the training set is a subset of data that is used to train a model. It is a set of data that is used to fit the parameters of a model.
The training set is typically a random sample of the dataset. It is used to train the model by minimizing the loss function, which is a measure of how well the model fits the training data.
The training set is used to fit the parameters of the model, while the test set is used to evaluate the performance of the model. The test set is typically a random sample of the dataset that is not used to train the model.
See also
- Transaction cost#
How much a user pays to the block producers to have their transaction included in a blockchain.
- Trend#
A trend is a general direction of change in a set of data or a market over time. In the financial markets, trends refer to the general direction of prices for a specific security, asset class, or market index. Trends can be either up, down, or sideways, and they can occur over various time frames, including short-term (such as minutes or hours), intermediate-term (such as days or weeks), or long-term (such as months or years).
Trends are important in investment decision-making as they provide insights into market behavior and can indicate potential opportunities for buying or selling securities. Traders and investors often use technical analysis to identify and track trends, using tools such as trendlines, moving averages, and momentum indicators.
See also
- Trend analysis#
In quantitative finance, Trend analysis is the study of historical market data, such as price and volume, to identify patterns and trends that may help predict future market movements. This can be a valuable tool for traders and investors when developing trading strategies or making investment decisions.
Trend analysis often involves the use of technical indicators, such as moving averages, trendlines, and support and resistance levels, to analyze and visualize market trends. It can be applied to various timeframes, from intraday to long-term, depending on the goals and preferences of the trader or investor.
See also:
- Trend-following#
Trend-following is a trading strategy that follows a trend.
Trend-following is a trading strategy that seeks to profit from the directional movement of prices in financial markets. The strategy involves analyzing the historical price data of an asset to identify trends and then making trades in the direction of the trend.
Trend-following traders typically use technical analysis tools and technical indicators, such as moving averages, trend lines, and momentum indicators, to identify trends and determine when to enter or exit trades. The goal is to buy an asset when the trend is bullish (i.e., prices are rising) and sell it when the trend is bearish (i.e., prices are falling).
The key principle of trend-following is to let profits run and cut losses quickly. This means that trend-following traders will typically use stop loss orders or other risk management techniques to limit their potential losses if the trend reverses.
Trend-following strategies can be applied to a wide range of financial instruments, including stocks, bonds, currencies, and commodities. The strategy is popular among both individual and institutional traders and has been used successfully by many well-known traders and hedge funds.
One potential disadvantage of trend-following is that it can be subject to false signals and whipsaws, particularly in volatile or choppy markets. In addition, trend-following can be slow to react to sudden market shifts or changes in investor sentiment, which can result in missed opportunities or losses. As with any trading strategy, it’s important to carefully consider the risks and benefits of trend-following and to use it in combination with other tools and techniques to manage risk and optimize performance.
See also
- TWAP#
TWAP or Time-weighted Average Price is a calculation that defines the weighted average price over a specified period.
The real-time price of decentralised exchanges is subject to quite easy manipulation, especially within the range of one block. A manipulator can use flash loans to access large amount of capital and make trades that a normal trader would not do.
These kind of attacks may cause very high/low price candles. Using the TWAP price mitigates the risk of performing e.g. an unnecessary stop loss trigger on a manipulated price.
On the security and compromises of price oracles.
Read Uniswap v3 TWAP oracle manipulation cost.
See also
- Uniswap#
The most popular AMM based decentralised exchange. Uniswap has two major versions. In version 2 (v2) the liquidity is evenly distributed across the bonding curve. In version 3, the liquidity providers can have liquidity on a partial curve, simulate order book and have better capital efficiency. Most decentralised exchanges are Uniswap v2 clones.
See also
- Unrealised profit and loss#
Unrealized Profit and Loss refer to the theoretical gains or losses on an investment or asset that has not yet been sold or closed. These are “paper” profits or losses, meaning they exist only on paper and have not been actualized through a transaction. An “unrealized profit” occurs when the current market value of an asset is higher than its purchase price, while an “unrealized loss” occurs when the current market value is lower than the purchase price. Unlike realized profits and losses, unrealized amounts are not recorded as income or loss for tax purposes until they are realized through a sale or other transaction.
See also
- Unrealised risk#
Unrealized risk refers to the potential for loss or underperformance in a financial investment or trading position that has not yet been closed or settled. Unlike realized risk, which captures actual losses or gains, unrealized risk represents the possibility of future losses or gains as long as the position remains open. It quantifies the extent to which an asset or portfolio could be impacted by future market fluctuations.
Example: If an investor owns shares of a company that have declined in value but has not yet sold those shares, the decline represents an unrealized risk. Until the investor sells the shares, the potential for loss or gain remains.
See also
- Unsupervised learning#
Unsupervised learning is a type of machine learning that involves training a model using unlabeled data. It is a form of regression that uses unlabeled data to train a model.
Unsupervised learning is a common practice in machine learning and data science. It is used to train a model using unlabeled data.
The process involves fitting a model to the data and then using the model to make predictions. The model is typically a mathematical function that describes the relationship between the variables in the dataset. The model is fitted to the data by estimating the parameters of the model using statistical methods.
Unsupervised learning can be used to solve clustering and dimensionality reduction problems. Clustering problems involve grouping similar data points together, while dimensionality reduction problems involve reducing the number of features in a dataset.
See also
- USDC#
USDC (USD Coin) is a stablecoin, meaning it is a cryptocurrency that is pegged to the value of the US Dollar. It is designed to maintain a value of 1 USDC = 1 USD, and its value is backed by US dollars held in reserve. USDC is used for a variety of purposes in the cryptocurrency space, including as a unit of account for trading, for remittances and as a medium of exchange. It operates on the Ethereum blockchain and is a popular choice for traders looking for a stable store of value in the cryptocurrency markets.
See also stablecoin.
- Variance#
Variance is a statistical measure that represents the spread or dispersion of a set of data points around their mean (average). It quantifies how far each data point in the set is from the mean and, consequently, from every other data point in the set. In finance, variance is often used as a measure of risk or volatility, although it is less commonly used than its square root, the standard deviation.
Usage: Variance is used in various fields, including statistics, finance, and engineering, to quantify variability or dispersion. In finance, it serves as a measure of an asset’s risk. However, standard deviation is more commonly used for this purpose because it is in the same unit as the data, making it more interpretable.
Variance is the square of the standard deviation, and both are used to measure the volatility or risk associated with a financial asset. However, standard deviation is generally preferred in practical applications because it is in the same unit as the original data points.
See also
- Vault#
In decentralised finance, a vault refers to a smart contract that manages assets, in non-custodial manner, for several stakeholders. Usually when you deposit to a vault you receive share or liquidity provider tokens as a return.
See EIP-4626 Tokenised vault standard for more information.
See also
- Visual Studio Code#
Visual Studio Code (VS Code) is a source-code editor made by Microsoft for Windows, Linux and macOS. . VS Code is free and optimised for building and debugging modern web and cloud applications. It comes with features such as code editing, debugging, integrated Git control, syntax highlighting, intelligent code completion, snippets, and more. Visual Studio Code is excellent for editing Jupyter notebooks.
See also
- Volatility#
In quantitative finance, volatility refers to the degree of variation or fluctuation in the price of a financial asset over a certain period of time. It is often measured by statistical metrics like standard deviation or historical price changes. Higher volatility indicates a greater potential for rapid price changes, while lower volatility suggests more stable pricing. Sometimes volatility is shortened as “vol” (not to be confused with volme that is similarly shortened).
Example: If a cryptocurrency experiences rapid price swings within short periods, it is said to have high volatility.
Volatility is a crucial concept in financial markets, often used by traders and investors to assess the risk and potential returns of an asset. High volatility can offer opportunities for greater returns but also poses higher risks.
Each of these terms offers a different lens through which to analyze market conditions and can be used in combination to make more informed trading or investing decisions.
Volatility can be applied to - Asset prices - Asset returns - Portfolio returns
When benchmarking different portfolios for Risk-adjusted return, volatility is the fundamental metric for various risk vs. rewards calculations. Delta neutral trading strategy is a strategy that is immune to volatility: no matter which direction the price moves, the strategy makes profit. A volatility basket trading strategy construct a basket of assets based on their volatility.
Volatility is calculated as returns / standard deviation of return. Returns can be binned daily, weekly, hourly, etc. The period of returns can be trailing months, years, or the whole duration of an asset. Volatility always expressed as a positive number because it measures the magnitude of fluctuations around an average return, regardless of whether those fluctuations are positive or negative. In other words, volatility is a measure of risk or uncertainty, not direction.
Sharpe ratio is the derivation of volatility: returns / volatility.
See also
- Volume#
In the context of cryptocurrency, trading volume refers to the total number of tokens or coins that have been traded for a specific cryptocurrency pair within a given time frame. It serves as a key indicator of the asset’s liquidity and the level of investor interest. High trading volumes often suggest a more liquid and stable market, while low volumes may indicate less liquidity and greater potential for price manipulation.
Example: If the trading volume for the Bitcoin/USD pair is 50,000 BTC, it means that 50,000 Bitcoins have been traded against the US dollar during the specified time frame.
Usage: Trading volume is a crucial metric for traders, analysts, and investors in the cryptocurrency market. It provides insights into market sentiment, liquidity, and potential volatility. High trading volume is generally seen as a sign of market strength and can be a good indicator for entry or exit points. Conversely, low trading volume may indicate a lack of interest or uncertainty.
The trading volume in the cryptocurrency market is often used alongside other metrics and indicators to form a more comprehensive view of market conditions.
See also
- Wallet#
In a blockchain, a wallet refers to an application that offers interaction to your non-custodial blockchain account.
Users interact with different web3 and decentralised finance protocols using their wallets.
Popular wallets include
MetaMask (a web browser extension)
Avalanche Core (a web browser extension)
TrustWallet (a mobile application)
Ledger (a hardware wallet)
Different services and wallets may interoperate using WalletConnect protocol.
See also
- WalletConnect#
In Web3, WalletConnect is a protocol to allow users to use various kind of wallets with different services.
WalletConnect is an abstraction layer that supports connecting different wallet to a web3 and decentralised finance protocols. It supports both non-custodial and custodial wallets.
Wallet types may include
Mobile app based wallets
Desktop app based wallets
Website based wallets
Hardware wallets
Multisignature wallets
Professional custodial wallets like MetaMask Institutional, Fireblock, Q-redo
WalletConnect is supported across multiple blockchains, including e.g. EVM-Compatible ones, NEAR, Chia and Solana.
See also
- Web3#
Web3 is a social and technical movement to decentralised social media and online communities.
Web 2.0 led to the concentration of power to few Silicon Valley based social media conglomerates, like Facebook and Twitter. Many creators, users and governments are dissatisfied these companies, as they see them executing profit sharing and censorship powers unfairly.
Web3 movement aims to address this issue with user owned content. The content is usually digital content and can be pictures, posts, social media profiles or video game assets.
The content is not siloed, truly owned by the user, and can be transferred across different services and protocols. The profit share is made more fair the users, not the corporation owners, have more negotiation power. This is achieved using open source, blockchains, open protocols, public key cryptography and token based governance.
Web3 protocols are funded using decentralised finance instead of private venture capital. Web3 protocols aim to fair token distribution so that users would own the largest share of protocol control and revenues.
Popular Web3 protocols and projects include e.g.
Lens protocol (social media)
Farcast (social media)
Paradise Tycoon (mobile game with NFTs)
Phaver (Reddit for Web3)
Sandbox (metaverse game)
Web3 has also other meanings
Historically, the technical term web3 referred to the three original decentralised technologies that were visioned when Ethereum launched: Ethereum, shh, and bzz.
Web3 foundation is the name of the Swiss non-profit that launched Polkadot blockchain.
See also
- Weight allocation#
In portfolio construction, the weight allocation determines how many percents an individual asset position will make out of the total portfolio.
One of the simplest weight allocation method is “1/Nth” allocation: the asset with the strongest alpha signal receives 1/1th multiplier, the second asset 1/2th. The weightings are then normalised so that all assets make total of 100%.
Read about 1/Nth weight allocation <https://www.r-bloggers.com/2013/06/the-fallacy-of-1n-and-static-weight-allocation>.
See also
- XY liquidity model#
XY liquidity model, as known as XYK, is a bonding curve model where the price of an asset follows the equation:
\(x*y=k_{market\_maker}\)
This model was popularised by Uniswap version 2 decentralised exchange. Anyone can buy or sell coins by essentially shifting the market maker’s, also known as a liquidity provider, position on the
x*y=k
curve.On Trading Strategy, the available liquidity is usually expressed as the US dollar amount of one side of the pair. For example adding 100 BNB + 5000 USD to the liquidity is presented as 5000 USD available liquidity.
See also price impact and slippage.
Read more about slippage and price impact on Paradigm’s post.
- Yield farming#
Yield farming is a passive trading strategy in decentralised finance.
Usually yield farming strategies rely on on-chain liquidity pools and liquidity mining token distributions, which where any tokens are immediately sold. Strategies can be auto-compounding.
Yield farms operate solely on smart contracts and their strategies are limited. Often yield is not real yield.
Yield farms almost always aim for risk-free rate against their quote token.
See also
- zstd#
The Zstd compression is a modern compression algorithm developed by Facebook. It tries to strike a good balance with speed/compression ratio for modern multithreaded CPUs.
zstd is also the command line utility that can be used to compress/decompress files in a terminal. It can be combined with tar to create archives of directories, like blockchain snaphots.
See also