# DXdao Bonding Curve

After the initial distribution of REP tokens, DXdao launched another token called DXD to raise additional funds for the DAO. On April 25, 2020, REP holders voted to implement a `bonding curve` to mint DXD in exchange for ETH, which would be held in DXdao's treasury and controlled by REP holders.  DXD represents the liquid financial value of DXdao.

The bonding curve was based on the [Fairmint bonding curve contracts](https://medium.com/fairmint/fairmint-releases-its-bonding-curve-contract-in-open-source-1d142b9baaa8) and was designed to be a [continuous fundraiser (cOrg)](https://github.com/C-ORG/whitepaper?tab=readme-ov-file#continuousorganizations)

DXdao issued 100,000 DXD tokens to itself in a pre-mint, with a vesting schedule of 1/36th per month over three years, meaning approximately 2,775 DXD are vested monthly.

The bonding curve for issuing DXD was `linear,` following the [cOrg model,](https://github.com/C-ORG/whitepaper?tab=readme-ov-file#continuousorganizations) with a goal of raising $300,000 USD in exchange for 12,000 DXD, which is about 11% of the total supply. Discussions about the shape of the bonding curve, especially regarding pausing it, were significant points of debate within the community. DXDao has amassed a treasury worth approximately $50 million, having accumulated 25,000 ETH over time.&#x20;

<figure><img src="https://3553550185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmfykzqcxD3JDEQ5bBuj1%2Fuploads%2FCVMyTlzqse4pulSJmP5V%2Fimage.png?alt=media&#x26;token=de235f4c-20e2-44d7-af26-03e1bd148231" alt=""><figcaption></figcaption></figure>

Changes to the bonding curve had been a long-standing topic in the community, with a proposal to pause the curve failing in September 2020. However, a similar proposal was eventually passed by DXdao’s REP holders in December 2020 after extensive deliberation.&#x20;

## Understanding the token bonding curve model of dxDAO

#### **Pricing algorithm (under review)**

$$
P=\frac{A\cdot(1-e^{(-B\cdot R)})}{C\cdot R}
$$

Where:

* $$P$$: the current price of DXD
* $$A$$: the initial price of DXD when the curve was created
* $$B$$: the "`bonding curve slope`," which is a constant that determines the steepness of the curve
* $$R$$: the reserve ratio, which is the ratio of the value of $$ETH$$ in the curve to the total value of $$ETH$$ and $$DXD$$ in the curve
* $$C$$: the "connector balance," which is the amount of $$ETH$$ in the curve when $$R$$ = 0

The reserve ratio is calculated as follows:

$$
R = \frac{V\_{eth}}{{V\_{eth}+{V\_{DXD}}}}
$$

Where:

* $$V\_{eth}$$ = the value of $$ETH$$ in the curve, calculated as the current balance of $$ETH$$ in the curve multiplied by the current $$ETH$$ price
* $$V\_{DXD}$$ = the value of DXD in the curve, calculated as the current supply of DXD multiplied by the current DXD price

The bonding curve slope and connector balance are both set when the curve is created, and are fixed thereafter. The initial price of DXD is also set at the time of curve creation, but can be adjusted by the DXdao's governance process.

Overall, the pricing algorithm for the `DXdao` bonding curve is designed to maintain a constant `reserve ratio` of $$ETH$$ and $$DXD$$ in the curve, and to adjust the price of $$DXD$$ as the ratio changes based on buying and selling activity

&#x20;$$ETH$$ was used as the native currency in **`dxDAO`** but can be replaced by stablecoins like $$DAI$$ or $$USDC$$

## Fundraising Curve Parameters

The cOrg bonding curve parameters provided suggested values for DXdao's fundraising campaign. Certain parameters, such as the `pre-mint amount` in DXD tokens and the collateral token address, were immutable without an upgrade.&#x20;

Other parameters could be adjusted via the <mark style="background-color:blue;">`updateConfig()`</mark> function, including the `whitelist address, beneficiary, control admin, fee collector, fee basis points, auto burn, revenue commitment basis points, minimum investment, and open-until-at-least duration`.&#x20;

The whitelist, recommended to be `null`, restricted operations to specific addresses. The `beneficiary`, suggested to be the `DXdao Avatar`, received the funds raised, and the control admin, also suggested to be the DXdao Avatar, could call the <mark style="background-color:blue;">`updateConfig()`</mark> function.&#x20;

The fee collector role, proposed to be disabled for DXdao, handled fees on purchases. \
The auto burn feature allowed DXD tokens minted to the DXdao to be automatically burned, increasing the value of remaining DXDs and strengthening the sell curve. Revenue commitment basis points, suggested at 10%, determined the portion of revenue allocated to the reserve via the <mark style="background-color:blue;">`pay()`</mark> function.

The minimum investment could be set low, such as 0.001 $$ETH$$ to facilitate accessibility. The `open-until-at-least duration`, which specified how long `DXdao` would commit 1`0%` of revenue as "`dividends,`" could be increased but not decreased, and was enforced through the `pay()` function.

## Curve Customization option

To effectively manage the issuance and functionality of DXD tokens, DXdao has outlined several curve customization options. These options encompass parameters that are either fixed or adjustable, depending on the needs and governance of the DAO. Below is a detailed breakdown of these properties, categorizing them into those that are immutable without an upgrade and those that can be modified by the admin to ensure the system remains flexible and responsive to changing circumstances.

{% tabs %}
{% tab title="Immutable" %}

### Properties are set once, and then not changeable without an upgrade

* **`_initReserve`**: The pre-mint amount, in DXD tokens.
* **`_currencyAddress`**: The collateral token address. It can be set to the null address to use Ether, which is recommended.
* **`_initGoal`**: The Kickstarter goal, in DXD tokens.
* **`_buySlopeNum`** and **`_buySlopeDen`**: Parameters used to calculate the bonding curve slope, determining the token price based on the number of tokens in circulation. These are set to raise $300,000 USD (in ETH, at current prices) in exchange for 12,000 DXD.
* **`_investmentReserveBasisPoints`**: The percentage of buys kept in reserve.
* **`_name`**: The token name.
* **`_symbol`**: The token symbol
  {% endtab %}

{% tab title="Upgradable" %}

### The following properties are changeable via the admin:

* **`_whitelistAddress`**: The address that allows only certain addresses to perform operations.
* **`_beneficiary`**: The address that receives the funds raised.
* **`_control`**: The admin address that can call the **`updateConfig()`** function.
* **`_feeCollector`**: The address that collects fees on buys.
* **`_feeBasisPoints`**: The basis points of the fee collected on each buy.
* **`_autoBurn`**: A boolean indicating whether newly minted tokens can be automatically burned to increase the reserve.
* **`_revenueCommitmentBasisPoints`**: The percentage of revenue through the `pay()` function allocated to the reserve.
* **`_minInvestment`**: The minimum amount that users must spend when calling the `buy()` function.
* **`_openUntilAtLeast`**: A timestamp indicating how long the DXdao will commit part of its revenues to the curve. This can be increased but never decreased.
  {% endtab %}
  {% endtabs %}

## Analysis of the Bodning Curve&#x20;

> The bonding curve was based on the Fairmint bonding curve contracts and was designed to be a continuous fundraiser. Changes to the bonding curve had long been discussed in the community. A signal proposal to pause the curve failed in September,2020 but a similar proposal ultimately was passed by DXdao’s REP holders in December,2020 after a lengthy debate.

{% tabs %}
{% tab title="Why it didn't work?" %}

<figure><img src="https://3553550185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmfykzqcxD3JDEQ5bBuj1%2Fuploads%2Fg3hnL4iu5ECHndsJIVgS%2FUntitled%20(3).png?alt=media&#x26;token=45892c31-9993-4571-8ff3-dc637bb3e246" alt=""><figcaption><p>Forum post reply to discussion on pausing the Bonding Curve</p></figcaption></figure>

DXdao encountered significant challenges in maintaining price equivalence between their bonding curve (P-AMM) and secondary markets. The price discrepancy created a significant arbitrage opportunity, which was continuously exploited, draining the treasury reserves. This situation led to the decision to pause the bonding curve. The arbitrage allowed individuals to mint large amounts of DXD at a low cost and with minimal slippage, resulting in the dilution of the active supply of DXD.

The other issue was the linear design of the bonding curve,while easy to undertand, it comes with certain challenges.

* Large purchases can inflate prices due to the direct price-to-supply link, creating opportunities for manipulation.&#x20;
* They lack the flexibility to adapt to changing market conditions. They do not account for varying levels of demand or supply elasticity, which can lead to suboptimal pricing and market inefficiencies
* Low liquidity early on can lead to dramatic price swings, discouraging smaller investors.&#x20;
* As the price steadily rises with supply, later adoption becomes expensive, potentially hindering ecosystem growth.&#x20;
* Additionally, linear curves lack stability, susceptible to sharp price movements due to market fluctuations.

The pausing was ultimately achieved by setting the `_minInvestment` parameter to a large number.
{% endtab %}

{% tab title="What Mechanisms Could Have Addressed the Issue?" %}

<figure><img src="https://3553550185-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmfykzqcxD3JDEQ5bBuj1%2Fuploads%2F6ih8wonI0XhtavLB4RZy%2FUntitled%20(4).png?alt=media&#x26;token=25c54990-268e-4f0e-b539-5efd5f3522bd" alt=""><figcaption><p>Proposal put forth for halting the bonding curve</p></figcaption></figure>

Two proposals were discussed in the forum:&#x20;

* halting the bonding curve and&#x20;
* designing a new exponential bonding curve.&#x20;

The linear bonding curve did not ultimately align with DXdao's system goals. Initially, the curve was an effective fundraising mechanism, raising over 25,000 $$ETH$$. However, significant challenges arose due to price discrepancies between the bonding curve and secondary markets. This created arbitrage opportunities that could have been managed better.

One suggested approach was to deploy an `arbitrage agent` to control the price more effectively. Instead of completely halting the bonding curve, access could have been restricted, allowing only the `arbitrage agent` to trade on the bonding curve. This strategy would have equalized the prices between the P-AMM and secondary markets while significantly increasing the DAO treasury.

Additionally, implementing range-bound stability mechanisms could have mitigated price volatility, resulting in smoother price movements.

Redesigning the bonding curve with exponential parameters, without the necessary guardrails, would have run into similar issues. Such a curve would also disproportionately benefit early investors at the expense of later ones.
{% endtab %}
{% endtabs %}

## **Incentive Structure:**

#### Incentive Structure

The incentive structure for investors in DXdao is designed to reward early participation and long-term engagement. As the token supply increases, the value of the reserve also rises, benefiting early investors who purchased tokens at lower prices. These investors see gains as more participants enter the market and drive up the token price. Additionally, investors can capitalize on price fluctuations by buying tokens when prices are low and selling them at higher prices.

Key benefits for investors include:

* **Voting Power: Governance 2.0**: Investors gain voting power within the DXdao, allowing them to influence key decisions and participate in the governance process.
* **Revenue Sharing**: Investors can earn a share of the revenue generated by DXdao's activities, providing an ongoing return on their investment.
* **Token Value Appreciation**: As the DXdao grows and succeeds, the value of DXD tokens is likely to increase, offering capital appreciation for token holders.
* **Access to DXdao Products and Services**: Token holders gain access to a range of products and services offered by DXdao, enhancing their utility and overall investment value.
