# Risks

### Smart Contract Risks

* **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>&#x20;
  * Code is audited by SpearbitDAO, see the report here: <https://github.com/spearbit/portfolio>
* **Malicious Admin:** admins can pause pools and set fees, both features that will have active monitoring, see more info here: <https://docs.cronfi.com/twamm/fundamentals/admin-privileges>.
* **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 `executeVirtualOrdersToBlock` for 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

### Lack of Arbitrage

Arbitrage is a necessary facet of TWAMMs because `virtual orders` are 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.&#x20;

Here's what we've done to avoid&#x20;

* 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,000` which is at parity with Uniswap V3 swaps which cost `200,000`.

### Trade Execution

* Cancel at any time: if the price escapes your preferred price envelope, it can be canceled and restarted.&#x20;
* Withdraw at any time: users can withdraw proceeds at any time and multiple times during the order at the cost of paying for gas
* DCA vs Market: <https://www.investopedia.com/terms/d/dollarcostaveraging.asp>

> #### Benefits of Dollar-Cost Averaging <a href="#mntl-sc-block_1-0-28" id="mntl-sc-block_1-0-28"></a>
>
> * 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.

### Others

{% content-ref url="../research/attack-vectors" %}
[attack-vectors](https://cron-finance.gitbook.io/twamm/research/attack-vectors)
{% endcontent-ref %}
