Comment on page
- Hacks: we built TWAMMs on Balancer V2 Vaults which have been battle-tested for 2+ years, see more here: https://docs.balancer.fi/concepts/pools/protocol.html#security
- Bricked Pools: there are edge-case scenarios when the pool becomes inoperable.
- The gas required to execute virtual orders exceeds what's available in a single Ethereum block. We've built mitigations like
executeVirtualOrdersToBlockfor unwinding positions over multiple blocks.
- Math underflow/overflow: we've done extensive numerical analysis and leverage Balancer Vault architecture to ensure this possibility is impossible.
- Loss of Funds: Cron is completely non-custodial & users are in full control of their funds.
- Pool paused by admin: users can withdraw their funds and incomplete trades are refunded.
- Decimal rounding errors: we've simulated scenarios with extreme conditions (liquidity, trade sizes, time to completion, pool pair decimal difference, etc) to ensure users' fund loss is extremely minimal.
- Code Visibility: we have verified the contract code on Etherscan so users are aware of the code being executed inside TWAMM
Arbitrage is a necessary facet of TWAMMs because
virtual ordersare written on-chain by the next party interacting with the AMM, which are primarily arbitrageurs. Without regular arbitrage, TWAMMs asset prices would skew drastically and traders would get a poor order fill.
Here's what we've done to avoid
- Dedicated arbitrageurs: we've partnered up with Rook, bloXroute, and others to ensure there's consistent arbitrage happening on popular TWAMM pools
- Flash swap: this is a special swap available on Balancer that allows anybody to arbitrage by simply identifying pool price mispricings in the Vault without needing any assets: https://docs.balancer.fi/reference/swaps/flash-swaps.html
- Extreme gas optimizations: if the dedicated arbitrageur service is unavailable, anybody else in the mempool is free to arbitrage the TWAMM. The average swap cost on TWAMM for a fairly active pool is approximately
150,000which is at parity with Uniswap V3 swaps which cost
- Cancel at any time: if the price escapes your preferred price envelope, it can be canceled and restarted.
- Withdraw at any time: users can withdraw proceeds at any time and multiple times during the order at the cost of paying for gas
Benefits of Dollar-Cost Averaging
- can lower the average amount you spend on investments.
- automatic and can take concerns about when to invest out of your hands.
- removes the pitfalls of market timing, such as buying only when prices have already risen.
- esure that you're already in the market and ready to buy when events send prices higher.
- takes emotion out of investing.