> For the complete documentation index, see [llms.txt](https://dca-1.gitbook.io/dca-white-paper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dca-1.gitbook.io/dca-white-paper/dca-whitepaper/technical/smart-contracts.md).

# Smart Contracts

> *"Together, these contracts form a unified on-chain infrastructure that enables autonomous and scalable economic activity."*

## Core Contract Architecture

Each contract in the DCA protocol plays a distinct role within the system, and together they form a unified on-chain infrastructure that enables autonomous and scalable economic activity.

These contracts regulate treasury reserves, token supply expansion, liquidity acquisition, and participant incentives.

| Contract                         | Function                               |
| -------------------------------- | -------------------------------------- |
| **Treasury Contract**            | Financial reserve and backing layer    |
| **Sales Contract**               | Supply expansion and contraction       |
| **Bond Contract**                | Treasury growth and token distribution |
| **Staking Contract**             | Internal coordination and rewards      |
| **Reward Distribution Contract** | Automated reward allocation            |

***

## Treasury Contract

The Treasury Contract serves as the financial reserve layer of the DCA protocol, acting as the foundational backing for the entire token economy.

It stores all assets collected by the ecosystem, including funds generated from bond sales, merchant revenue allocations, and liquidity operations. The treasury tracks two key metrics:

### Total Treasury Assets

Total Treasury Assets represent the total market value of all assets held by the protocol treasury. These assets may include stablecoins, liquidity provider tokens, protocol-owned liquidity, and other approved reserve assets. The value of these assets may fluctuate depending on market conditions.

### Risk-Free Value (RFV)

Treasury Risk-Free Assets represent the conservative backing value of treasury reserves. Rather than valuing assets at full market value, the protocol evaluates them using a minimum guaranteed value.

This conservative valuation ensures that the DCA token maintains a strong reserve backing within the protocol. The protocol maintains a core rule: **each DCA token minted must be supported by a corresponding amount of treasury risk-free value.**

### Treasury-Backed Supply Regulation

The treasury operates as a monetary framework to balance token supply:

* When market price exceeds the backing value range, the protocol may enter an expansion phase, issuing additional tokens through bond sales or controlled minting
* When market price falls below the backing price, the protocol may initiate token buybacks to stabilize the ecosystem

Through this adaptive supply regulation, the DCA protocol maintains balance between demand, issuance, and reserves.

***

## Sales Contract

The Sales Contract regulates token supply expansion and contraction, dynamically aligning circulating supply with market conditions and treasury backing.

* When the market price **exceeds** the backing price, the protocol may mint additional tokens and sell them into the market
* When the market price **falls below** the backing price, the protocol may initiate token buybacks to stabilize the ecosystem

Through this mechanism, the protocol dynamically adjusts token supply in response to market conditions.

***

## Bond Contract

The Bond Contract is a key component of the DCA protocol's treasury growth mechanism. It enables the protocol to acquire assets and liquidity while distributing DCA tokens in a controlled manner.

Through bonding, participants exchange external assets for DCA tokens at a discounted price, while the protocol accumulates reserves within the treasury.

### Bond Mechanism Overview

When a bond is purchased, the process follows a structured sequence:

1. **Asset Deposit** — The participant deposits approved assets into the protocol treasury through the Bond Contract
2. **Bond Pricing Calculation** — The protocol determines the bond price based on predefined parameters, including current market conditions and the Bond Control Variable (BCV)
3. **Token Allocation** — Based on the bond price, the protocol calculates the amount of DCA tokens to be allocated
4. **Bond Creation** — A bond position is created within the protocol, recording the total token allocation and vesting schedule
5. **Vesting Distribution** — The allocated DCA tokens are released gradually over a 5-day vesting period
6. **Claim and Participation** — As tokens vest, the participant may claim them or continue participating in the ecosystem, such as staking

### Bond Types

**Liquidity Bonds** allow participants to provide liquidity to the DCA trading pair (e.g., DCA-USDT) on PancakeSwap, receive LP tokens, and deposit them into the Bond Contract. This creates **Protocol-Owned Liquidity (POL)**, improving market stability and reducing reliance on external liquidity providers.

**Reserve Bonds** allow participants to deposit reserve assets (such as USDT or other approved stablecoins) directly into the protocol treasury, strengthening the protocol's financial reserves.

### Bond Pricing

Bond pricing typically includes a discount relative to the current market price of the DCA token. The discount level varies depending on market demand, treasury asset requirements, and current bond issuance levels. As more bonds are purchased, the protocol may gradually reduce the discount rate to maintain balance.

### Bond Vesting

DCA tokens received through bonds are distributed through a **5-day vesting schedule** rather than immediately released. This prevents sudden selling pressure, stabilizes token circulation, and encourages longer-term participation.


---

# 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://dca-1.gitbook.io/dca-white-paper/dca-whitepaper/technical/smart-contracts.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.
