Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[foundry]: https://getfoundry.sh/
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg

This reposity contains the [Doppler](docs/Doppler.md) Protocol along with the [Airlock](/docs/Airlock.md) contracts. You can learn more about the technical aspects in the [documentation](https://docs.doppler.lol).
This repository contains the [Doppler](docs/Doppler.md) Protocol along with the [Airlock](/docs/Airlock.md) contracts. You can learn more about the technical aspects in the [documentation](https://docs.doppler.lol).

## Deployments

Expand Down
6 changes: 3 additions & 3 deletions docs/Doppler.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Doppler Protocol make use of 4 Uniswap v4 hook functions in its contract:

## Curve Accumulation

The Doppler Protocol rebalance its bonding curve according to token sales along a pre-defined schedule based on the number of tokens to sell, `numTokensToSell`, over the duration, `endingTime - startingTime`. This rebalance occurs immediately preceeding the first swap in every epoch, in the `beforeSwap` hook. If the hook doesn't have any swaps in a given epoch then the rebalance applies retroactively to all missed epochs.
The Doppler Protocol rebalance its bonding curve according to token sales along a pre-defined schedule based on the number of tokens to sell, `numTokensToSell`, over the duration, `endingTime - startingTime`. This rebalance occurs immediately preceding the first swap in every epoch, in the `beforeSwap` hook. If the hook doesn't have any swaps in a given epoch then the rebalance applies retroactively to all missed epochs.

### Max Dutch Auction

Expand Down Expand Up @@ -52,12 +52,12 @@ Within the bonding curve, the Protocol places 3 different types of liquidity pos

The lower slug is generally placed ranging from the global tickLower to the current tick. The Protocol places the total amount of proceeds from asset sales, `totalProceeds`, into the slug, allowing the users to sell their tokens back into the curve. The lower slug must have enough liquidity to support all tokens being sold back into the curve.

Ocassionally, the Protocol may not have sufficient `totalProceeds` to support all tokens being sold back into the curve with the usual slug placement. In this case, it computes the average clearing price of the tokens, computed as `totalProceeds / totalTokensSold` and place the slug at the tick corresponding to that price with a minimally sized range, i.e. range size of `tickSpacing`.
Occasionally, the Protocol may not have sufficient `totalProceeds` to support all tokens being sold back into the curve with the usual slug placement. In this case, it computes the average clearing price of the tokens, computed as `totalProceeds / totalTokensSold` and place the slug at the tick corresponding to that price with a minimally sized range, i.e. range size of `tickSpacing`.

### Upper Slug

The upper slug is generally placed between the current tick and a delta, computed as `epochLength / duration * gamma`. The Protocol supplies the delta between the expected amount of tokens sold, computed as `percentage(elapsed time / duration) * numTokensToSell`, and the actual `totalTokensSold`. In the case that `totalTokensSold` is greater than the expected amount of tokens sold, it skips the slug and instead simply set the ticks in storage both as the current tick.

### Price Discovery Slugs

The price discovery slugs are generally placed between the upper slug upper tick and the top the bonding curve, `tickUpper`. The hook creator determines at the time of deployment how many price discovery slugs should be placed. The Protocol places the slugs equidistant between the upper slug's upper tick and the `tickUpper`, contiguously. the Protocol supplies tokens in each slug according to the percentage time difference between epochs multiplied by the `numTokensToSell`. Since the Protocol is supplying amounts according to remaining epochs, if it runs out of future epochs to supply for, it stops placing slugs. In the last epoch there will be no price disovery slugs.
The price discovery slugs are generally placed between the upper slug upper tick and the top the bonding curve, `tickUpper`. The hook creator determines at the time of deployment how many price discovery slugs should be placed. The Protocol places the slugs equidistant between the upper slug's upper tick and the `tickUpper`, contiguously. the Protocol supplies tokens in each slug according to the percentage time difference between epochs multiplied by the `numTokensToSell`. Since the Protocol is supplying amounts according to remaining epochs, if it runs out of future epochs to supply for, it stops placing slugs. In the last epoch there will be no price discovery slugs.
2 changes: 1 addition & 1 deletion src/DERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ contract DERC20 is ERC20, ERC20Votes, ERC20Permit, Ownable {
* @param symbol_ Symbol of the token
* @param initialSupply Initial supply of the token
* @param recipient Address receiving the initial supply
* @param owner_ Address receivin the ownership of the token
* @param owner_ Address receiving the ownership of the token
* @param yearlyMintRate_ Maximum inflation rate of token in a year
* @param vestingDuration_ Duration of the vesting period (in seconds)
* @param recipients_ Array of addresses receiving vested tokens
Expand Down
2 changes: 1 addition & 1 deletion src/Doppler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct SlugData {
/// @param totalTokensSold Total tokens sold by the hook
/// @param totalProceeds Total amount earned from selling tokens (in numeraire token)
/// @param totalTokensSoldLastEpoch Total tokens sold at the end of the last epoch
/// @param feesAccrued Fees accrued to the pool since last collection (these values won't be updated durin migration)
/// @param feesAccrued Fees accrued to the pool since last collection (these values won't be updated during migration)
struct State {
uint40 lastEpoch;
int256 tickAccumulator;
Expand Down