TIL #2 - The AMM Design Trilemma
Recently I have been on a quest to understand AMM’s from a historical context (pre-DeFi). This 2013 paper by Othman et al titled “A Practical Liquidity-Sensitive Automated Market Maker” takes an axiomatic approach to unify AMM designs by characterizing AMMs by three properties - path independence, translation invariance, and liquidity sensitivity.1 - Three properties to characterize AMMs - path independence, translation invariance, and liquidity sensitivityPath IndependencePath independence m...
DeFi Primitive Risk Methodology (DPRM)
“DeFi Primitive Risk Methodology (DPRM) is an open source risk management library (currently in development) that lets users perform both quantitative and qualitative risk analysis on groups of DeFi primitives using stochastic methods to simulate first and second order effects from any combination of tokenomics designs.”Problem - Risk Management in DeFi is hardIn DeFi, a plethora of innovation is occurring with the creation of many new macro DeFi primitives such as liquidity pools, bonds, and...
MEV Arbitrage on Olympus POL
1 - Abstract 2 - Intro 2a - MEV Arbitrage 2b - Olympus POL 3 - Data Collection 3a - Sushiswap LP 3b - Olympus POL 4 - Results 4a - Swap Distributions 4b - Swap Statistics 4c - Buy/Sell Trading Flows 5 - Final Remarks 1 - AbstractMaximal extractable value (MEV) bots perform atomic arbitrage transactions on DEX-based liquidity pools. Although accounting for less than 1% of total unique addresses, these bots execute the majority of transactions in Olympus protocol owned liquidity (POL) both in t...
decentralized bankster
TIL #2 - The AMM Design Trilemma
Recently I have been on a quest to understand AMM’s from a historical context (pre-DeFi). This 2013 paper by Othman et al titled “A Practical Liquidity-Sensitive Automated Market Maker” takes an axiomatic approach to unify AMM designs by characterizing AMMs by three properties - path independence, translation invariance, and liquidity sensitivity.1 - Three properties to characterize AMMs - path independence, translation invariance, and liquidity sensitivityPath IndependencePath independence m...
DeFi Primitive Risk Methodology (DPRM)
“DeFi Primitive Risk Methodology (DPRM) is an open source risk management library (currently in development) that lets users perform both quantitative and qualitative risk analysis on groups of DeFi primitives using stochastic methods to simulate first and second order effects from any combination of tokenomics designs.”Problem - Risk Management in DeFi is hardIn DeFi, a plethora of innovation is occurring with the creation of many new macro DeFi primitives such as liquidity pools, bonds, and...
MEV Arbitrage on Olympus POL
1 - Abstract 2 - Intro 2a - MEV Arbitrage 2b - Olympus POL 3 - Data Collection 3a - Sushiswap LP 3b - Olympus POL 4 - Results 4a - Swap Distributions 4b - Swap Statistics 4c - Buy/Sell Trading Flows 5 - Final Remarks 1 - AbstractMaximal extractable value (MEV) bots perform atomic arbitrage transactions on DEX-based liquidity pools. Although accounting for less than 1% of total unique addresses, these bots execute the majority of transactions in Olympus protocol owned liquidity (POL) both in t...
decentralized bankster
The goal of CFGI attempts to quantify buying and selling opportunities based on the overall fear and greediness of the market and tries to predict when market corrections will occur and when buying opportunities present themselves.
CFGI gathers data from five sources - Volatility (25%), Market Momentum/Volume (25%), Social Media (15%), Dominance (10%), and Trends (10%).Why those weights specifically?
CSI aims to generalize levels of fear and greed to levels of speculation. Positive speculation implies more greed. Less speculation implies a choppy (equilibrium) market condition. Negative speculation implies fear. CSI consolidates categories down from five to two - Momentum and Stablecoin Dominance, both of which are calculated by measuring the acceleration of the change of the indicators.
CSI uses daily data and has both a 30 day and 90 day signal converted to a percentile scale from 0% to 100% for easier understanding. Below are the last 5 days worth of values from the signals in ascending order. Values below ~50% are negative while values above 50% are positive.

The charts below show cumulative levels of speculation accrued in the system throughout the year. These charts show the raw data that the CSI is calculated from and is not in a percentile scale. Interestingly, levels of speculation are overall lower at the beginning 2022 compared to the beginning of 2021.
The 30day chart shows that there were 3 bull markets and 3 bear markets, characterized by the peaks/valleys of the chart. The 90day chart doesn’t have this much granularity but still captures the trend as 2 major bull cycles and 1 major bear market, with a potential second bear market approaching if current market conditions persist.

By having multiple signal time frames, we can identify turning points in the market. For example when the 30 day flips the 90 day in the chart below for an extended period of time, say a week, that provides a high level of confidence that a macro trend reversal is occurring. This can be further expanded to include 5 vs 15, 15 vs 30, 30 vs 60, etc to identify turning points along multiple short term and long term time frames.

Volatility + Market Momentum/Volume categories were replaced with a single Momentum category. Momentum is calculated using a time-invariant “momentum” algorithm on bitcoin and Ethereum market caps. Market caps were used because this takes into account the asset bubble price appreciations that occur during highly speculative markets. Ethereum is included in CSI to account for speculation occurring in the NFT market, of which virtually all assets are primarily denominated in Eth.
Dominance is replaced by Stablecoin Dominance, which expands the original definition to account for more speculative assets. Stablecoin Dominance is a ratio between the market cap fluctuations of the largest stablecoins vs the market cap fluctuations between bitcoin and Ethereum market caps. As Stablecoin Dominance increases, more people are going from speculative assets into stablecoins, thus decreasing levels of speculation. As Stablecoin Dominance decreases, people are decreasing their stablecoin positions to invest in more speculative assets. Stablecoins that are used are USDC, USDT, BUSD, DAI, FEI, FRAX, LUSD, MIM, and UST.
Social Media and Trends were stripped out due to the unquantifiable amount of biased noise that they bring to the model. See here and here for expanded reasoning. More is not always better.
https://colab.research.google.com/drive/1R-L293PPtQvRSeNFLCtONvEj-ND-Q43t#scrollTo=BQeTHMTozpaP
The goal of CFGI attempts to quantify buying and selling opportunities based on the overall fear and greediness of the market and tries to predict when market corrections will occur and when buying opportunities present themselves.
CFGI gathers data from five sources - Volatility (25%), Market Momentum/Volume (25%), Social Media (15%), Dominance (10%), and Trends (10%).Why those weights specifically?
CSI aims to generalize levels of fear and greed to levels of speculation. Positive speculation implies more greed. Less speculation implies a choppy (equilibrium) market condition. Negative speculation implies fear. CSI consolidates categories down from five to two - Momentum and Stablecoin Dominance, both of which are calculated by measuring the acceleration of the change of the indicators.
CSI uses daily data and has both a 30 day and 90 day signal converted to a percentile scale from 0% to 100% for easier understanding. Below are the last 5 days worth of values from the signals in ascending order. Values below ~50% are negative while values above 50% are positive.

The charts below show cumulative levels of speculation accrued in the system throughout the year. These charts show the raw data that the CSI is calculated from and is not in a percentile scale. Interestingly, levels of speculation are overall lower at the beginning 2022 compared to the beginning of 2021.
The 30day chart shows that there were 3 bull markets and 3 bear markets, characterized by the peaks/valleys of the chart. The 90day chart doesn’t have this much granularity but still captures the trend as 2 major bull cycles and 1 major bear market, with a potential second bear market approaching if current market conditions persist.

By having multiple signal time frames, we can identify turning points in the market. For example when the 30 day flips the 90 day in the chart below for an extended period of time, say a week, that provides a high level of confidence that a macro trend reversal is occurring. This can be further expanded to include 5 vs 15, 15 vs 30, 30 vs 60, etc to identify turning points along multiple short term and long term time frames.

Volatility + Market Momentum/Volume categories were replaced with a single Momentum category. Momentum is calculated using a time-invariant “momentum” algorithm on bitcoin and Ethereum market caps. Market caps were used because this takes into account the asset bubble price appreciations that occur during highly speculative markets. Ethereum is included in CSI to account for speculation occurring in the NFT market, of which virtually all assets are primarily denominated in Eth.
Dominance is replaced by Stablecoin Dominance, which expands the original definition to account for more speculative assets. Stablecoin Dominance is a ratio between the market cap fluctuations of the largest stablecoins vs the market cap fluctuations between bitcoin and Ethereum market caps. As Stablecoin Dominance increases, more people are going from speculative assets into stablecoins, thus decreasing levels of speculation. As Stablecoin Dominance decreases, people are decreasing their stablecoin positions to invest in more speculative assets. Stablecoins that are used are USDC, USDT, BUSD, DAI, FEI, FRAX, LUSD, MIM, and UST.
Social Media and Trends were stripped out due to the unquantifiable amount of biased noise that they bring to the model. See here and here for expanded reasoning. More is not always better.
https://colab.research.google.com/drive/1R-L293PPtQvRSeNFLCtONvEj-ND-Q43t#scrollTo=BQeTHMTozpaP
Share Dialog
Share Dialog

Subscribe to 0xEvan

Subscribe to 0xEvan
<100 subscribers
<100 subscribers
No activity yet