TWAMM Research: February 2022

Hey folks, after we officially came out of stealth last month -- see tweet below, we’ve had lots of inbound and interest in working with us. Some notable teams we are exploring collaboration opportunities with include Balancer, KeeperDAO, Uniswap, FEI, Llama, and Rift. Each of these teams adds immense value to our ultimate vision to become the go-to AMM for both time-insensitive traders and passive LPs.

Unlike atomic (one block) trades happening on AMMs today, we expect the trades on TWAMM to be particularly advantageous to long-term investors such as DAOs, funds, etc, and retail who are interested in utilizing DCA to enter/exit positions. Additionally, passive LPs who’ve been craving for a full range AMM since UNI V3 can now park their liquidity in TWAMM pools to earn significant returns without active management.

TWAMM competes with DEX aggregators to provide a better fill for traders who are time-insensitive
TWAMM competes with DEX aggregators to provide a better fill for traders who are time-insensitive

Product Developments

Much of our focus this month has been on quantifying TWAMM’s behavior related to gas usage at a high level. We discuss the effects of the block interval parameterization below along with our initial approach to high-level contract optimizations.

Gas Optimizations & Analysis

  • Order Block Interval (OBI): we demonstrated how much gas is needed to run executeVirtualOrders when different OBIs are used for TWAMM pools, illustrating the inverse relationship between the number of iterations needed and OBI.
  • Concurrent Opposing Active Virtual Orders: we quantify the gas usage of TWAMM arithmetic when there are concurrent aligned and opposing long-term orders and other scenarios.
  • Maximum TWAMM Pool Inactivity Length: we measure gas usage vs. inactivity for concurrent opposing active LT-swaps in pools with order block intervals 1, 10, 30, and 60. Inactivity is swept from 0 to 200 blocks in steps of 10 blocks

You can see a much more detailed post with the various scenario analysis here:

Ease of Use

  • We created a Solidity reserve calculation view function based on our previous offline reserve calculation work that is much easier to use and continues to ensure gas-free quoting -- thanks to Joey Santoro for this suggestion.

Upcoming Work

We had a lot of other work to share this past month but wanted to keep the updates manageable. Look for more updates in mid-March including:

  • A presentation of the dominant gas usage of the widely shared TWAMM contract by Frankie -- GitHub.
  • An analysis of potential Gas Denial of Service (GDoS) scenarios for TWAMM.
  • Progress on our mainnet development of the TWAMM contract including comparative gas usage reductions to the current contract.

Beyond these updates, there will be a more detailed analysis of other important TWAMM topics relating to numerical stability, arithmetic errors, and the tradeoffs inherent in contract gas usage optimizations.

Subscribe to 0x70626a
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.