Cover photo

DeFi Curation: Setting LTVs and Caps for Collaterals

DeFi Slippage Analysis for wAVAX / USDC on LFJ

This is the first of multiple blog posts concerning the addition of collaterals to the Keyring vaults.

Curators seemingly rarely publish their quantitative analysis publicly, but understanding the mechanics behind asset onboarding decisions provides valuable insight into risk management. We hope to document the process of bringing new assets onboard with modelling and market microstructure analysis.

This is an attempt at a more rigorous approach to onboarding new assets - specifically the "LTV Limits" (LLTVs) and "Supply Caps" (Caps).

tldr we’re using historical data to model how much $wAVAX might drop in a single block given a specific volume of sells. We'll measure the size of liquidations for various pools and estimate the expected max sell-off for a given vault capacity. We can then calculate the slippage we might get and use that to infer our LTV ratio and Vault capacity params.

The core objective is to estimate the price slippage SS for a given liquidation volume LL which is written as P(SsL=)\mathbb{P}(S \leq s \mid L = \ell) and it's conditional probability density fSL(s)f_{S|L}(s|\ell). Then, we will calculate the expected slippage, E[SL<X,D]\mathbb{E}[S \mid L < X, D] where XX is a percentile of liquidation volumes X=FL1(0.99D)X = F_L^{-1}(0.99 \mid D) for a given pool depth DD, or determined via scenario analysis based on liquidation sizes from other platforms.

Trader Joe (LFJ) Venue Data

The analysis proved more complex than initially anticipated due to numerous unusual market characteristics. Trader Joe is not a well documented trading venue and has several idiosyncrasies that create great benefits for users but also great doom-loops for analytics. Notably, the data revealed instances of large trades that moved markets 6% in favour of traders - a phenomenon that defies conventional market mechanics. The following examples illustrate these data anomalies.

post image
Buys that make the price go DOWN?!

Another anomaly revealed what appears to be probability wave interference effects in the exchange, similar to quantum mechanics (except not in infinite dimensional Hilbert space!). In LFJ they have discretised (quantised) the liquidity bins with specific 10 basis point blocks and the result is a variety of harmonics around the "ground state". This unexpected phenomenon showed interference patterns that deviated dramatically from traditional "bell shaped" return distributions.

post image

This analysis covers wAVAX / USDC, representing the most liquid DEX pair on Avalanche. The dataset encompasses the entire history of swaps until the previous evening, with block, bb, returns calculated by r(b)=VWAP(b)VWAP(b1)r(b) = \text{VWAP}(b) - \text{VWAP}(b-1) using Swap events from HyperSync. The exact cause of this strange return distribution remains unclear, but this anomaly alone delayed the wAVAX pool go-to-market by approximately 2-3 days due to the additional analysis required.

To validate the interference theory hypothesis, we modelled a Poisson distribution with triangular convolution of multiple swaps per block causing interference. This approach looked similar to the empirical observations (subject to proper parameter fitting), enabling a resemblance of sanity.

post image

With a robust model of price movements for various sell sizes on the primary venue for wAVAX/USDC trading, stress testing under various market conditions becomes possible.

Kyle's Lambda

Kyle's Lambda is a core concept in market microstructure, measuring how trades affect prices in financial markets. It helps estimate execution costs, particularly for high-frequency trading (HFT) in single-state executions. The model uses regression to quantify price changes based on trade volume, expressed as rb=λVbsign(Vb)+ϵbr_b = \lambda \cdot \sqrt{|V_b|} \cdot \text{sign}(V_b) + \epsilon_b, where for a given block, rbr_b represents slippage, λ\lambda is the price impact coefficient, VbV_b is the signed trade volume, and ϵb\epsilon_b is the random noise term.

post image

The returns were calculated as the change in VWAP between consecutive transactions rx=VWAPxVWAPx1r_{x} = \text{VWAP}_x - \text{VWAP}_{x-1} where xx denotes the transaction index.

Impact of Slippage

The analysis revealed that atomic liquidations can be performed with minimal slippage on collateral assets. While general collateral degradation may occur, the likelihood of generating bad debt through the liquidation process itself remains very low.

The data demonstrates that liquidating $40,000 worth of $wAVAX from an unhealthy position typically results in only $12 slippage on the AMM. This finding proved surprising and requires further individual transaction analysis, though the data seems to consistently support this conclusion.

The bin-model architecture of the LFJ exchange appears responsible for this favourable slippage profile. Analysis uncovered instances of $600,000 orders executing with zero slippage. While LFJ's pricing can appear confusing to users due to dust-related price distortions that may not reflect actual liquidity, the Volume Weighted Average Price (VWAP) typically provides fair execution.

Next Steps

In the next post we will dive into liquidity data and analyze liquidation sizes across DeFi vaults. We’ll explore Just-In-Time (JIT) liquidity patterns, testing the hypothesis of JIT activity and then analyse the liquidation sizes for various DeFi vaults.