---
# System prepended metadata

title: experiment results

---

## Abstract
We measure LP profitability by simulating various trading environments.

As trading volume increases, so does LP profitability (Experiment One).
As fees increase, so does LP profitability (Experiment Two).
Sweeping two parameters functions as expected (Experiment Three).
Holding period doesn't impact fees when volume is constant (Experiment Six)

Open questions:
- attribute LP profit to trading and fees
- can we justify "lp and arbing is more profitable than just arbing"?


### Trading environment
We set up a general set of experiment parameters, from which we allow our experiments to diverge.

1. 365 day term
2. variable rate 3.5%
3. curve fee 0.5%
4. flat fee 50bps (0.5%)



### Trading algorithm

The following algorithm generates random trades to hit our volume targets.

```python
for day in [1,365]:
    target_volume = daily_volume_percentage_of_liquidity
    todays_volume = 0
    while todays_volume < target_volume:
        trade_direction = random(long, short)  # 50/50
        maximum_trade = get_max(trade_direction)
        needed_volume = target_volume - todays_volume
        trade_size = min(maximum_trade, existing_positions, needed_volume)
        todays_volume += trade_size
```



## Experiment One:
### What did we learn?
✅ LP profitability scales with volume

### Hypotheses
- [x] higher volume leads to higher LP returns
- [x] even low volume lets LPs outperform the variable rate

### Setup
- daily volume = [1%, 5%, 10%] of TVL

### Data
![image](https://hackmd.io/_uploads/BJLop2F_6.png)
![image](https://hackmd.io/_uploads/SJG8WXyt6.png)



## Experiment Two:
### What did we learn?
✅ LP profitability scales with curve fee

### Hypotheses
- [x] higher curve fee leads to higher LP returns
- [x] even low curve fee lets LPs outperform the variable rate

### Setup
- curve fee = [0.1%, 0.5%, 1%]

### Result
![image](https://hackmd.io/_uploads/BJ6gy6Kda.png)
![image](https://hackmd.io/_uploads/SJ1_t71tT.png)



## Experiment Three:
✅ LP profitability acts as expected when changing more than 1 variable

### Hypotheses
- [x] sweeping across volume and fees at the same time gives the same results

### Setup
- daily volume = [1%, 5%, 10%] of TVL
- curve fee = [0.1%, 0.5%, 1%]

### Rata
![image](https://hackmd.io/_uploads/BJADELhO6.png)



## Experiment Four:
Investigate curvature of profitability vs. volume

### What did we learn?
✅ LP profitability is concave with respect to volume, pointing to a specification problem.
✅ Slope is higher relative to curve fee, pointing to playing a bigger role in LP profitability.

### Setup
- daily volume = [1%, 2%, 3%, 4%, 5%, 6%, 7%, 8%, 9%, 10%] of TVL
- curve fee = [0.1%, 0.5%, 1%]
- flat fee = [0.01%, 0.05%, 0.1%]

### Result
![image](https://hackmd.io/_uploads/rJkLJwnYp.png)
![image](https://hackmd.io/_uploads/B1xnNwntp.png)
![image](https://hackmd.io/_uploads/SJO2Vw2YT.png)


## Experiment Five:
Investigate if holding period affectgs fees.
### What did we learn?
✅ Holding period doesn't affect fees when volume is constant
### Setup
- daily volume = [1%, 2%, 3%, 4%, 5%, 6%, 7%, 8%, 9%, 10%] of TVL
- curve fee = 1%
- flat fee = 0.01%
### Result
![image](https://hackmd.io/_uploads/HkVWR5qiT.png)


## Experiment Six:
Investigate if more predictable trading makes profitability vs. volume linear.

### What did we learn?
✅ Profitability vs. volume is linear when trading is predictable.

### Setup
Eliminate random walk in  rates. After each random trade, move back to the starting point.

- daily volume = [1%, 2%, 3%, 4%, 5%, 6%, 7%, 8%, 9%, 10%] of TVL
- curve fee = [0.1%, 0.5%, 1%]
- flat fee = [0.01%, 0.05%, 0.1%]

### Setup
- daily volume = [1%, 2%, 3%, 4%, 5%, 6%, 7%, 8%, 9%, 10%] of TVL
- curve fee = [0.1%, 0.5%, 1%]
- flat fee = [0.01%, 0.05%, 0.1%]

### Result
![image](https://hackmd.io/_uploads/ByOgAq9iT.png)


## Appendix: How we generate reproducible results

In the [hyperdrive-experiments](https://github.com/delvtech/hyperdrive-experiments) repo:

1. update parameters in run_experiments.py
2. rm -rf runs runs_table.csv && ./clean_docker.sh && ./run_experiment.py
3. copy result string from monitor_experiment.py:
    - `Total 08:57. 3 runs, 178.91 seconds per run.`
4. mv experiments results/exp_NUM
5. run parse_experiments.py (change line 27 to point to results/exp_NUM)