tldr;
There’s been interest in diversifying Nouns DAO treasury, specifically stETH => rETH
, and we have built a tool that’s tailor-made to help execute these trades: TWAMM. The trade will be executed completely on-chain, transparently with very low fees and minimal gas costs.
The first trade will be for $1M, and after that completes successfully, a larger $14M trade will be proposed.
Background
TWAMM is a concept introduced by Paradigm in July 2021. "It works by breaking long-term orders into infinitely many infinitely small pieces and executing them against an embedded constant-product AMM smoothly over time."
An on-chain AMM protocol to enable large token swaps is essential to increase DeFi adoption and anti-fragility. Some interesting use cases for TWAMMs include treasury diversification, whale liquidations, peg maintenance, etc.
We have been researching and developing TWAMMs since November 2021 and recently launched our protocol: CronFi TWAMM. The code has been audited by SpearbitDAO, open-sourced, and verified on Etherscan. Considerable detail about the protocol is presented on the docs page.
Product Design & Incentives
- AMM: we built our TWAMM as a custom pool on top of Balancer V2 Vault leveraging the security, liquidity, flexibility, and gas advantages of Balancer. Additionally, Balancer has become a Schelling point for protocols that want to leverage their AMM, thus creating network effects & composability advantages.
- Traders: as a long-term trader (Nouns DAO), you only have to pay gas for starting, canceling, or withdrawing proceeds from your order. All the other sub-orders of the DCA are done virtually and cost the Nouns DAO no gas fees. Virtual orders are only written on-chain when the next user interacts with the protocol (generally an arbitrageur).
- Arbitrageurs: as seen on other AMMs like Uniswap, arbitrageurs are important to keep the price of the assets in line with external venues. Arbitrageurs are critical for TWAMMs because trade sizes are significantly larger and last for multiple blocks. Therefore we have built and partnered with dedicated arbitrageurs (BloXRoute) to ensure pools are arbitraged frequently to ensure Nouns DAO gets the best swap return.
- Liquidity: there will be a minimum of $30k liquidity in the pools and we expect that to reach between $50-100k in liquidity before the trade executes. TWAMMs are extremely capital efficient given that the trades are split across multiple blocks and arbitrageurs are consistently bringing new liquidity back to the system to correct price deviations — simulation details below illustrate these efficiencies and swap performance.
Advantages
- Low fees: wstETH/rETH is a stable pair and long-term swappers pay a one-time 0.03% fee.
- Fully on-chain: zero dependencies on off-chain services, oracles, compute etc.
- Flexible: issue, withdraw, and cancel orders with ease.
- Example new order:
sell 7_500 stETH for rETH in 100_000 blocks
~roughly 2 weeks - Helpful periphery contract to issue orders
- Example new order:
- Full control of orders and assets: non-custodial, cancellable, and withdraw proceeds at any time.
- Withdraw multiple times: users can withdraw once at the end, or every set number of blocks – they just pay gas fees.
- DCA over 1000’s of blocks gas-free: Nouns DAO would only pay gas for starting and ending suborders; arbitrageurs pay for placing suborders on-chain.
- Analytics: we will have an analytics dashboard that shows how the order is being filled so the DAO can monitor the trade. There will also be a post-trade analysis and report.
- Monitoring: we will be actively monitoring the trade as the
delegate
to ensure the order is being filled at a reasonable price. In case the trade escapes a reasonable threshold, we will cancel the trade on behalf of the DAO, refunding proceeds and the remaining unsold portion of the order to the Nouns DAO wallet.
Risks
- Smart contract:
- Fully audited: see SpearbitDAO report here.
- Hack Risks: built on Balancer V2 Vaults which have been battle-tested for 2+ years.
- Bricked Pools: we’ve done extensive research and mitigations for gas, order DDoS, numerical underflows, incorrect TWAMM parameters etc – more info here: 0slippage.
- Loss of Funds: open-source code, audited, verified, non-custodial, users in full control of funds, trade happens over multiple blocks so it can be canceled at any time by the user.
- Malicious Pool Admin: all pool administrators can do is pause the pool or change fees at which point Nouns DAO can cancel and withdraw their funds.
- Lack of Arbitrage: we have built a flash swap arbitrage bot and also teamed up with BloXroute to provide a dedicated arbitrage service.
- Poor Execution: orders are cancellable at any time i.e if the price escapes preferred bounds restart the order at another time. Also, DCA is generally a better strategy than spot purchase for large orders.
- Information Leakage: this is not a big concern for a stable pair like wstETH/rETH which are like assets and have deep liquidity pools.
- MEV/Sandwich Attacks: orders are broken into small pieces and thus the benefit of front/back running orders is minimal – see the Paradigm paper for further details.
Competition
Here are the alternatives and how they stack up against TWAMM. Note this isn’t a comprehensive list, but a short summary.
- Gnosis Auction:
- Pros: well-tested technology
- Cons: reliant on well-funded keepers, minimum buy lots, price upside capped, infrastructure overhead, limited timeframe, poor execution vs DCA over long periods.
- Manual DCA:
- Pros: can execute it today
- Cons: need to write a smart contract or fat finger mistakes, fees for each sub-order, gas costs of sub-orders, limited # of sub-orders
- DEX:
- Pros: complete trade in a single block
- Cons: poor liquidity, slippage, MEV attack vectors
- Aggregators
- Pros: access to liquidity, completes trade quickly
- Cons: not on-chain, MEV attack vectors, slippage
- OTC:
- Pros: limit orders and other novel trade execution algorithms
- Cons: off-chain, opaque, high fees, custodial, KYC, regulations, etc
Trade Simulations
Here are the simulation results for the trade and expected returns. The initial trade is to show Nouns DAO the power of the protocol and ensure everything works as expected. This simulation is an approximation and results might vary based on liquidity, prices, volatility, etc. We will be monitoring the trade to ensure the trade fills won’t deviate drastically from the expected outcome.
NOTE: this is a full contract simulation between a Balancer pool and our contract, using a fixed wstETH:rETH price in the balancer pool, fixed gas units, and fixed USD exchange rates. The simulation is executed with the actual contracts, with certain parameters held constant to evaluate the effect of liquidity and arbitrage frequency on swap performance.
$1M trade with $100k liquidity: 1.327% slippage
LPs make 1.537% ($1537) from fees in a week, if you’re interested in adding liquidity to the pool to earn fees, you can add liquidity here: wstETH <> rETH TWAMM Pool. Here’s how swap performance improves as liquidity and arbitrage frequency increase in the pool.
The real benefit is in the larger trade which does better than any on-chain solution and even Cowswap’s quotes. Additionally, LPs would make 1.545% ($21,626) from fees in a week
$14M trade with $1.4M liquidity: 0.553% slippage
Proposal Operations
This proposal requires two on-chain proposals. The first will be a trial trade for $1M wstETH → rETH. The follow-up proposal will trade $14M wstETH → rETH.
Note: we’re wrapping more stETH than we are selling because the price fluctuates, we want to ensure the proposed amounts of wstETH are available to sell.
- (We are here)
sell 500 wstETH for rETH in 50_400 blocks
~1 week - (Follow up)
sell 7000 wstETH for rETH in 50_400 blocks
~ 1 week