# About the Bill Broker

Bill Broker is an on-chain buyer and seller of SPOT and USDC that uses knowledge of the SPOT system to provide efficient quotes for users. Broadly, it employs a simple buy low, sell high strategy that capitalizes on SPOT’s mean reverting characteristic.

## Context on Mean-Reversion (AMPL)

AMPL, launched in 2019, by design has a mean-reverting price around its target: the CPI-adjusted 2019. Over time, it has been demonstrated clearly that the price of AMPL returns to target, even through extreme market conditions.

Given this, you might expect that it would be profitable to apply the simple counter cyclical strategy of purchasing AMPL under its price target and selling over its price target. But it’s not that straightforward.

Although it’s clear that AMPL’s price will eventually revert to its 2019 dollar target, holders cannot precisely know how long this process of finding an equilibrium will take. And in the meantime, they are exposed to volatility through supply changes.

## Context on Mean-Reversion (SPOT)

SPOT, the low volatility derivative of AMPL, shares AMPL’s mean-reverting price distribution but doesn’t rebase and is only exposed to AMPL’s supply volatility in the most extreme scenarios. Under typical operating conditions it is straightforward for market actors to:

Buy SPOT under its redeemable AMPL value

Sell SPOT over its redeemable AMPL value

For more context see the blog post on Countercylical Demand and the Spot Primer.

## Application Details

The interface is structured similar to an AMM.

Users can buy or sell SPOT for USDC similarly to how they would on Uniswap

LP’ers can deposit into a two-sided pool according to the existing asset ratio

The Bill Broker maintains a standing bid and a standing ask such that:

Bill Broker offers to purchase SPOT below the computed FMV

Bill Broker offers to sell SPOT above the computed FMV

### Calculating SPOT FMV

Let’s say the current exchange rate between SPOT and Sr AMPL tranches is: 1.07. In this case BB would compute the FMV target as:

`fmv = spot_exchange_rate * ampl_target`

`fmv = 1.07 * 1.19 = 1.27`

Sr AMPL tranches are 1) protected from supply rebasing and 2) redeemable for future AMPL. Because AMPL is mean-reverting in price, the system infers that the value of 1 Sr AMPL tranche is approximately equal to AMPL’s price target.

### Calculating bids and asks

Bill Broker computes bids and asks using the FMV with an applied fee.

`ask_price = (1.0 + fee_percent) * fmv`

`bid_price = (1.0 - fee_percent) * fmv`

The fee amounts are computed using configurable fee curves, defined below.

#### Ask Fee Curve

Referring to the diagram above:

**ar_i (Asset Ratio)**— The x-axis, is the ratio of USDC LP inventory to SPOT inventory in the Bill Broker. Specifically:`ar_i = reserveValue(USDC) / reserveValue(SPOT)`

**fee (%)**— The y-axis, Is the calculated swap fee which goes to LPs and the protocol. The ask price is a function of this fee:`ask_price = (1.0 + fee_percent) * fmv`

The ask fee curve is parameterized with four values:

**af_low**: Ask fee low is a constant, defining the applied fee when the AR is less than the AR soft upper bound (lower y-intercept).**af_high**: Ask fee high is a constant, defining the applied fee when the AR is at the AR hard bound**ar_SU (Asset Ratio Soft Upper Bound)**: When the AR is below this value, Fee Low is applied. You can think of this as a stable swap territory. When the AR is between the soft bound and the hard bound, a linear function is used to compute the fee. The fee increases in this range, as inventory becomes more scarce.**ar_HU (Asset Ratio Hard Upper Bound)**: When the AR is above this value, asks are disabled.

#### Bid Fee Curve

Referring to the diagram above:

**ar_i (Asset Ratio)**— The x-axis, is the ratio of USDC LP inventory to SPOT inventory in the Bill Broker. Specifically:`AR = reserveValue(USDC) / reserveValue(SPOT)`

**fee (%)**— The y-axis, Is the calculated swap fee which goes to LPs and the protocol. The ask price is a function of this fee:`bid_price = (1.0 - fee_percent) * fmv`

The bid fee curve is parameterized with four values:

**bf_low**: Bid fee low is a constant, defining the applied fee when the AR is greater than the AR soft lower bound.**bf_high**: Bid fee high is a constant, defining the applied fee when the AR is at the AR hard bound.**ar_SL (Asset Ratio Soft Lower Bound)**: When the AR is above this value, Fee Low is applied. You can think of this as a stable swap territory. When the AR is between the soft bound and the hard bound, a linear function is used to compute the fee. The fee increases in this range, as inventory becomes more scarce.**ar_HL (Asset Ratio Hard Lower Bound)**: When the AR is below this value, bids are disabled.

#### Both Fee Curves

The superposition of these two fee curves determines the behavior of the system.

## Implementation

Code Repo: https://github.com/ampleforth/spot/blob/main/spot-vaults/contracts/BillBroker.sol

Security Audit: https://github.com/ampleforth/ampleforth-audits/blob/master/spot/vaults/BillBroker/v1.0.0/PeckShield-Audit-Report-AmpleForth-BillBroker-v1.0.pdf

Contract Address: TBA

Application Link: TBA

Last updated