> For the complete documentation index, see [llms.txt](https://cron-finance.gitbook.io/twamm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cron-finance.gitbook.io/twamm/overview/risks.md).

# 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="/pages/wJmFerHhd65CAoRCoJcn" %}
[Attack Vectors](/twamm/research/attack-vectors.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cron-finance.gitbook.io/twamm/overview/risks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
