bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 9쪽 중 3쪽
for those swaps.
### 3. Redeem
```solidity
redeem(
uint256 shares,
address receiver,
address[] assets,
uint256[] minAmountsOut
)
```
The caller's DTF shares are burned and the basket tokens are sent to `receiver`. For a single-token exit, set the integration router as `receiver`, swap all components, enforce the user's final minimum output, and transfer the result to the user in the same transaction.
Similar to minting, once a day, TVL fee accrual can result in the `amounts` changing in the downward direction. Use `minAmountsOut` for protection.
## Router and quote requirements
* Re-read `toAssets` for each quote and use the correct rounding direction.
* Treat the returned asset ordering as part of the quote.
* Bound component approvals and revoke or reset reusable approvals where appropriate.
* Enforce swap-level slippage and a deadline separately from Folio protections.
* Simulate the complete transaction immediately before submission.
* Return residual input and component-token dust.
* Requote after a basket, fee, allowance, balance, or block-state change.
* Test stale baskets, insufficient shares out, insufficient component output, expired routes, and deprecated Folios.
## Contract references
* [Index DTF minting and redemption](/core-components/index-dtfs/minting-and-redeeming)
* [Index DTF pricing and `toAssets`](/core-components/index-dtfs/pricing)
* [Protocol deployment addresses](/core-components/index-dtfs/smart-contracts)
* [Reserve Index Protocol source](https://github.com/reserve-protocol/reserve-index-dtf)
# Roles
The [readme](https://github.com/reserve-protocol/reserve-index-dtf/blob/main/README.md) document in the Reserve Index Protocol GitHub [repository](https://github.com/reserve-protocol/reserve-index-dtf) provides an overview of the protocol's smart contract architecture and implementation details.
The material below provides a technical tour of the protocol's contracts, bridging the high-level system design with onchain implementations.
The [Protocol Operations](/core-components/index-dtfs/overview) chapter explains how these contracts work together to provide the core functionality of the protocol.
## System architecture
The table below groups the protocol's contracts into functional layers and highlights the role each set of contracts plays within the system.
| Layer | Core contracts | Purpose |
| -------------------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **DAO infrastructure** | `FolioDAOFeeRegistry`, `FolioVersionRegistry` | Collect protocol-wide fees and whitelist Folio implementations / deployers |
| **Index (“Folio”) layer** | `Folio` (ERC-20), `FolioProxy` | Represents the basket and embeds the rebalance-auction engine; proxy pattern allows controlled upgrades |
| **Governance layer** | <p><code>FolioGovernor</code></p><p><code>ReserveOptimisticGovernor</code></p> | Dual-path governance (standard & optimistic) that executes proposals and manages rebalances. The selector registry whitelists which actions can use the optimistic fast path |
| **Staking / voting layer** | `StakingVault` | Escrows vote-locked governance tokens and streams rewards while providing voting weight for both standard and optimistic proposals |
## Governance roles
Index DTFs employ a modular governance structure composed of scope-constrained onchain roles. Governance can be flexibly customized by assigning different actors or contracts (e.g., DAOs, multi-sigs, EOAs) to each role.
Each role is deliberately sandboxed to the smallest set of function calls and parameter ranges needed for its mandate, and every high-impact action must pass through a timelock or hard-coded ceiling. These guardrails guarantee that no single key can abuse the system—another role (or broader governance) always has time and authority to intervene.
{% stepper %}
{% step %}
### Admin
The Admin is the primary admin of the DTF. There should really only ever be 1 Admin.
#### Expected actor
A DAO that operates via the supplied `FolioGovernor.sol` / `TimelockController.sol` or `ReserveOptimisticGovernor.sol` / `TimelockControllerOptimistic.sol` contracts.
DAO power should be sourced from the `StakingVault.sol` contract. The main reason for this is that the `StakingVault` has the ability to collect multiple different reward tokens and distribute them to stakers pro-rata over time in an MEV-resistant manner. Any ERC20 can be configured as the deposit token for the `StakingVault` at deployment.
#### Abilities
* Add / remove assets to / from the basket
* Set fees & fee recipients
* Set auction length
* Set the auction delay (delay between when an auction is approved and when it can be permissionlessly launched)
* Assign all roles
* Manage the Optimistic Selector Registry (add or remove allowed optimistic actions)
#### Limitations
All actions are gated by a timelock (default 48 h). Cannot bypass hard-coded parameter ceilings (e.g., max 10% annual TVL fee) and cannot seize collateral directly. Changes to governance infrastructure (the Governor, Timelock, Selector Registry, and Staking Vault) must always go through the standard governance path.
{% endstep %}
{% step %}
### Rebalance Manager
The Rebalance Manager is responsible for configuring auctions for execution.
#### Expected actor
The same DAO that acts as the Admin should also take on the role of Rebalance Manager, and the default deployment configuration in Register is exactly this.
However, having the Rebalance Manager as a separate role gives the Admin the optionality to permission a smaller set of trusted actors to approve auctions. This would allow the DTF to move faster on basket changes, but comes with the added risk of the DTF being considered a security (due to the nature of the asset selection being managed by a small group of permissioned actors) and mint access being geo-blocked on Register.
#### Abilities
* Configure an auction for execution.
Each auction definition has the following parameters at approval:
* `Sell Token`: the token to be sold by the DTF
* `Buy Token`: the token to be bought by the DTF
* `Expected Volatility`: the amount of price movement that is expected in the `Sell Token`:`Buy Token` pairing. The Rebalance Manager can select between 3 options: Low, Medium, and High.
* `Time To Live (TTL)`: How long (in seconds) an auction can exist in an APPROVED state until it can no longer be opened. This value must be longer than the DTF-configured `Auction Delay` if the auction is intended to be permissionlessly available.
#### Limitations
May only define auctions within pre-set volatility and TTL ranges. Cannot alter fees, basket weights, or governance itself.
{% endstep %}
{% step %}
### Auction Launcher
The Auction Launcher is responsible for launching an approved auction and providing more accurate pricing information for it.
A DTF is NOT required to have any Auction Launchers, as auctions can be launched permissionlessly (as long as the DTF and auctions are configured correctly).
#### Expected actor
Because this role takes on a more ministerial job, it can be held by a trusted multisig or EOA.
While any Auction Launcher should be trusted, they can only modify the pricing information within the bounds set by the Rebalance Manager, thus limiting the amount of damage from mistakes or a rogue actor.
#### Abilities
* Launch auctions
* Kill auctions
* When opening an auction, optionally alter parameters of the auction within the approved ranges
#### Limitations
Can tweak start/end prices but only inside the bands approved by the Approver. Cannot extend an auction’s TTL or change the sell/buy tokens.
{% endstep %}
{% step %}
### Optimistic Proposer
The Optimistic Proposer is responsible for creating fast-path optimistic proposals for routine, pre-approved operations.
#### Expected actor
A trusted multisig or EOA that handles day-to-day operational proposals such as launching rebalance auctions or updating a DTF's display name.
#### Abilities
* Create optimistic proposals that skip affirmative voting and execute automatically after the veto period unless vetoed
* Only actions whitelisted in the Optimistic Selector Registry can be proposed optimistically
#### Limitations
Subject to a *proposal throttle* limiting the number of optimistic proposals per account within a 24-hour window. Can only propose whitelisted (proposer, target, selector) combinations. Cannot propose changes to governance infrastructure (Governor, Timelock, Selector Registry, or Staking Vault). The role can be revoked at any time by a Guardian without a governance vote.
{% endstep %}
{% step %}
### Brand Manager
The Brand Manager is responsible for updating the Register UI with the correct social media links and token media (logo, banner).
#### Expected actor
A trusted multisig or EOA that is responsible for the branding and marketing of the DTF.
#### Abilities
* Update the DTF website, Twitter, Farcaster, and Telegram links that get displayed on Register
* Update the DTF logo and banner that get displayed on Register
#### Limitations
Limited to UI metadata (links, logos). Has zero permissions over assets, fees, or auctions.
{% endstep %}
{% step %}
### Guardian
The Guardian is responsible for vetoing malicious governance proposals and providing emergency safeguards against compromised optimistic proposers.
#### Expected actor
A trusted multisig or EOA that is ready and willing to act quickly to prevent malicious governance proposals from being executed or to revoke compromised optimistic proposers.
#### Abilities
* Veto governance proposals (both standard and optimistic)
* Revoke the Optimistic Proposer role from any address at any time without a governance vote
#### Limitations
Single-purpose veto (cancel) on queued governance proposals; cannot propose or execute anything itself. Power sunsets automatically if a quorum of stakers votes to revoke the role.
{% endstep %}
{% endstepper %}
# Fees
### Fees & revenue <a href="#fees--revenue" id="fees--revenue"></a>
Index DTFs generate revenue through two primary fee mechanisms:
1. **TVL Fee**: A fee based on the Total Value Locked in the protocol
2. **Mint Fee**: A fee applied when users mint new DTF tokens
Both fees are collected and distributed in the form of the DTF token itself to one or multiple recipients, as determined by governance. A platform fee is applied to both the TVL and Mint fees before they are distributed to recipients.
# TVL fee
### TVL fee explained <a href="#tvl-fee-explained" id="tvl-fee-explained"></a>
The TVL fee is expressed as a percentage of the DTF's Total Value Locked and is applied continuously through a compound interest calculation.
#### Technical implementation <a href="#technical-implementation" id="technical-implementation"></a>
The TVL fee is implemented using a compound interest formula:
```
fee = (1 / (1 - feePerSecond))^secondsPassed - 1
```
Where:
* `feePerSecond` is set by the DTF Owner (governance)
* `secondsPassed` represents the time since the last fee calculation
This mechanism ensures that:
* The fee is calculated and accounted for on every user interaction
* Any view functions account for the TVL fee since the last contract update
* The fee accumulates continuously rather than at discrete intervals
#### Practical implications <a href="#practical-implications" id="practical-implications"></a>
For users and integrators, this means:
* The TVL fee effectively acts as a continuous management fee
* The longer assets remain in the DTF, the more fees accrue
* The displayed value of Index DTF tokens will gradually decrease relative to the underlying assets, reflecting the accrued fees
# Mint fee
### Mint fee explained <a href="#mint-fee-explained" id="mint-fee-explained"></a>
The mint fee is a straightforward percentage fee applied whenever a user mints new DTF tokens.
#### Simplified calculation <a href="#simplified-calculation" id="simplified-calculation"></a>
The calculation is a simple percentage of the mint amount:
```
fee_amount = mint_amount * mint_fee_percentage
user_receives = mint_amount - fee_amount
```
This is the user-facing economic model. Contract integrations must also match the Folio's upward integer rounding. See the [native mint integration guide](/core-components/index-dtfs/minting-and-redeeming/native-mint-and-redeem-integration#2-calculate-net-shares-and-minsharesout) for the calculation.
#### Example <a href="#example" id="example"></a>
* User mints 100 $COIN50
* Mint fee = 1%
* User receives 99 $COIN50
* 1 $COIN50 is set aside for fee recipients
# Platform fee
### Platform fee <a href="#platform-fee" id="platform-fee"></a>
A platform fee is applied to both the TVL and Mint fees before they are distributed to recipients.
This platform fee is defaulted to 33%, but can be set per-DTF.
#### Technical implementation <a href="#technical-implementation" id="technical-implementation"></a>
The platform fee is supplied to DTFs via a Platform Fee Registry contract, which is controlled by the platform owner multisig. This registry also provides DTFs with the current platform fee recipient address.
### Fee parameters and constraints <a href="#fee-parameters-and-constraints" id="fee-parameters-and-constraints"></a>
The following parameters apply to all Index DTFs:
| Parameter | Value |
| ----------------------------- | ----- |
| Net platform TVL fee minimum | 0.15% |
| Net platform mint fee minimum | 0.15% |
| Max admin-defined TVL fee | 10% |
| Max admin-defined mint fee | 5% |
# Fee distribution
### Fee distribution <a href="#fee-distribution" id="fee-distribution"></a>
After platform fees are deducted, the remaining fees are distributed among the fee recipients according to their Admin-defined weights.
### Practical implications for users <a href="#practical-implications-for-users" id="practical-implications-for-users"></a>
#### For governance stakers <a href="#for-governance-stakers" id="for-governance-stakers"></a>
* Fee distribution to governance token holders follows an exponential distribution model over time to mitigate MEV (Miner Extractable Value) attacks
* Governance token holders can claim their pro-rata share of fees based on their staked tokens
#### For traders and holders <a href="#for-traders-and-holders" id="for-traders-and-holders"></a>
* When holding DTF tokens, be aware that the TVL fee continuously accrues, effectively acting as a management fee
* When minting new DTF tokens, account for the one-time mint fee in your calculations
#### For integrators <a href="#for-integrators" id="for-integrators"></a>
* Implement accurate fee calculations in your interfaces to provide users with precise token valuations
* Account for the continuous nature of the TVL fee when displaying token values
* Ensure your integration accounts for both fees when estimating transaction outcomes
### Governance implications <a href="#governance-implications" id="governance-implications"></a>
Fee parameters can be adjusted through governance, allowing the protocol to adapt to changing market conditions. This includes:
* TVL fee rate adjustments
* Mint fee rate adjustments
* Fee recipient configurations
# Rebalancing
### Rebalancing DTF baskets
Any alteration of a DTF’s basket is done via a Dutch auction. Each auction is configured with parameters to define which tokens are to be traded, the pricing curve of the auction, and the target end ratios of the tokens in the basket.
### Auction pricing <a href="#auction-pricing" id="auction-pricing"></a>
When configuring an auction for approval by governance, the **Expected Volatility (EV)** presets can be used to set the pricing curve and target token ratios. Choosing **Low EV** will configure a smaller pricing curve with more compact target ratio ranges, while choosing **High EV** will configure a much wider pricing curve with wider target ratio ranges.
When launching an auction via the Reserve app as the **Auction Launcher**, the **EV** presets can again be used to set the final pricing curve and target ratios.
When launching an auction via the Reserve app as any other actor, the **EV** presets are not available, as permissionless auction launches are not able to modify the pricing curve.
### Auction timing <a href="#auction-timing" id="auction-timing"></a>
The **time-to-live (TTL)** parameter gets set when a rebalance auction is approved. This parameter defines how long a rebalance auction can exist in the Approved state before it is considered invalid and can no longer be launched.
The **TTL** matters significantly, especially with respect to the Admin-defined **Auction Delay** parameter. The **Auction Delay** defines how much time an auction can exist in the Approved state before it can be launched by anyone. Before the delay ends, the only actor that can launch the auction is the **Auction Launcher.**
Setting the **TTL** longer than the **Auction Delay** creates a period when the auction can be launched permissionlessly, adding to the DTF’s decentralization. If **TTL** is set at or below **Auction Delay**, then the **Auction Launcher** will be the only actor that is ever able to launch the auction. This gives more control to the **Auction Launcher** and entrusts them with more responsibility, so any **Auction Approver** should be sure about the TTL that they set.
### Basket-wide rebalancing auctions <a href="#basket-wide-rebalancing-auctions" id="basket-wide-rebalancing-auctions"></a>

Index DTFs are rebalanced by approving a target basket, and then opening auctions that allow market participants to bid on *any* surplus:deficit token pair until the tokens in the basket reach their respective target ratios.

### CoW Swap participation <a href="#cow-swap-participation" id="cow-swap-participation"></a>
Since release 4.0.0, Index DTFs are able to utilize the new **Trusted Fillers** integration. The first Trusted Filler that has been integrated for Reserve Index DTFs is **CoW Swap**. Adopting **CoW Swap** as a Trusted Filler means that whenever the DTF has a rebalance auction, potential bids can be sent to the **CoW Swap** solver network, allowing solvers to bid directly in the auctions. This has 2 major benefits:
1. It ensures the DTF will always have competitive bidders participating in its rebalance auctions.
2. It connects rebalance auctions with the deep liquidity and best-price guarantees of the **CoW Swap** DEX.
# Technical details
## Rebalance lifecycle <a href="#rebalance-lifecycle" id="rebalance-lifecycle"></a>
In order to rebalance a DTF, the `REBALANCE_MANAGER` must first start a rebalance. This will set the new basket, per-token limit ranges, and price ranges. The `REBALANCE_MANAGER` will also set the restricted window during which only the `AUCTION_LAUNCHER` can open auctions, and the total time-to-live for the rebalance.
Once a rebalance auction is opened by the `AUCTION_LAUNCHER`, every surplus token in the auction will be sold down to its target basket ratio, and every deficit token will be bought up to its target basket ratio. An auction can include every surplus and deficit token in the basket, or a subset of them. Bidders can bid on any surplus:deficit pair in the auction until they reach their respective target ratios.
1. **Rebala프로젝트로 돌아가기