> 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/use-cases/open-market-operations.md).

# Open Market Operations

Protocols might want to buy undervalued assets or diversify overvalued assets into stablecoins. Today, the options available to them in order of best execution are OTC, Aggregators, DEXs, and custom scripts. Each option has corresponding pros & cons listed in the [*Competition*](https://docs.cronfi.com/twamm/overview/competition) section.

### What is the problem?

The problems for open market operations are similar to the ones DAOs face, see the DAO page for more details:

{% embed url="<https://docs.cronfi.com/twamm/use-cases/daos#what-is-the-problem>" %}

Some well-funded DAOs have the engineering resources to put together tools to address the poor execution on-chain. However, this diverts valuable developer time, incurs audit costs, and is generally not as efficient or flexible as TWAMMs.&#x20;

{% hint style="warning" %}
Imagine re-building a DEX every time you needed to swap tokens instead of plugging into Uniswap.
{% endhint %}

### Why TWAMMs are superior?

Beyond the development costs, these one-off tools have 3rd party dependencies and rely on `keepers` paying the gas to execute the trades. Additionally, they are subject to MEV attack vectors based on the size of sub-orders.

A side-by-side accounting comparing the surplus buffer signal request in DSSKiln vs. TWAMM appears below. This analysis doesn’t even account for the fill improvement that would result from the finer grain DCA of 2160 vs. 100 orders.

{% embed url="<https://forum.makerdao.com/t/signal-request-deploy-a-trial-permissionless-open-market-operation-resurrect-the-burn/15381/25>" %}

*TLDR*; TWAMM would cost \~**50% less!**

```xml
DAI <> ETH
Swap Amount:  $3M
Time Period:  90 days
Num Orders:   100
Sub Orders:   $30k => $3M / 100
Avg Swap Gas: $50 // uniswap v3 30-day average
Avg Slippage: $50 // uniswap v3 quote
Uniswap Fee:  0.3% // can be lower/higher depending on route/pool

----------------------
Swap fees:  - $9k
Gas fees:   - $5k
Slippage:   - $5k

Total Fees: - $19k
----------------------
Eth Return:   $2.981M
Net Cost:     -0.633%
```

```xml
TWAMM DAI <> ETH interval 1 hour, $1M ETH/DAI liquidity
Swap Amount:  $3M
Time Period:  90 days
Num Orders:   2160 // 1 per hour for 90 days
Sub Orders:   ~$1400 ~> $3M / 2160 
Avg Swap Gas: $0 // sub orders are not written to the chain
Avg Slippage: $0 // negligible slippage for $1400 trade in a $1M pool
Swap/W-draw:  $100 // gas for opening & closing position
TWAMM Fee:    0.3%
----------------------
Swap fees:  - $9k
Gas fees:   - $100
Slippage:   - $0

Total Fees: - $9.1k
----------------------
Eth Return:   $2.991M
Net Cost:     ~0.3%
```

### Examples

Here are just a few DAOs that have built one-off tools for TWAP-style market operations.

{% embed url="<https://github.com/banteg/yfi-buyer>" %}

{% embed url="<https://github.com/nounsDAO/token-buyer/>" %}

{% embed url="<https://github.com/makerdao/dss-kiln>" %}

{% embed url="<https://github.com/charlesndalton/milkman>" %}


---

# 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/use-cases/open-market-operations.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.
