  We develop a model of stable assets, including non-custodial stablecoins
backed by cryptocurrencies. Such stablecoins are popular methods for
bootstrapping price stability within public blockchain settings. We derive
fundamental results about dynamics and liquidity in stablecoin markets,
demonstrate that these markets face deleveraging feedback effects that cause
illiquidity during crises and exacerbate collateral drawdown, and characterize
stable dynamics of the system under particular conditions. The possibility of
such `deleveraging spirals' was first predicted in the initial release of our
paper in 2019 and later directly observed during the `Black Thursday' crisis in
Dai in 2020. From these insights, we suggest design improvements that aim to
improve long-term stability. We also introduce new attacks that exploit
arbitrage-like opportunities around stablecoin liquidations. Using our model,
we demonstrate that these can be profitable. These attacks may induce
volatility in the `stable' asset and cause perverse incentives for miners,
posing risks to blockchain consensus. A variant of such attacks also later
occurred during Black Thursday, taking the form of mempool manipulation to
clear Dai liquidation auctions at near zero prices, costing $8m.
