Documentation Index
Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt
Use this file to discover all available pages before exploring further.
Dex Traded Funds (DTFs)
A Dex Traded Fund (DTF) is a basket. Like all baskets, it holds things that will disappoint you at different rates. The virtue of the basket is that the disappointments cancel each other out — sometimes. The NAV tells you how the cancellation is going.Quick Start: Buy a DTF
DTF Lifecycle
What Makes Up a DTF
A DTF is four things. No more.- A basket of assets — up to 100 crypto assets with defined weights
- Fixed per-share quantities — each share represents a fixed amount of each underlying asset
- An ERC-4626 vault token — the standard vault interface, so it composes with everything else in DeFi
- A deployer — the address that built the basket and earns fees for the trouble
Up to 100 assets per basket. You can build a market-wide index or a narrow conviction play. The protocol does not judge your allocation. The market will.
NAV Pricing
Every DTF has a Net Asset Value (NAV). It is the fair value of one share, computed from the prices of everything inside the basket. NAV is the only number that matters. It is also the only number that never stops moving.NAV Computation Formula
qty[i]is the fixed per-share quantity of assetiprice[i]is the current market price of asseti- The division by
1e18normalizes to a human-readable value
Index.sol, off-chain in the oracle nodes, and in the frontend. Three places, one truth. If they ever disagree, something is very wrong.
DTF Creation: How Quantities Are Set
Every DTF begins its life worth exactly $1 (1e18 in contract math). A deployer chooses weights. The protocol converts those weights into fixed per-share quantities. From this moment on, the dollar figure is a memory. The quantities are the reality.
Three-Asset Creation Example
Three assets, equal weight. The most optimistic allocation: the belief that you cannot choose, so you choose equally.| Asset | Weight | Price | Quantity per Share |
|---|---|---|---|
| BTC | 33.33% | $50,000 | 0.000006666 BTC |
| ETH | 33.33% | $3,000 | 0.000111100 ETH |
| SOL | 33.34% | $100 | 0.003334000 SOL |
DTF Key Invariants
Three rules. They do not bend.Quantities only change on rebalance. Buying and selling does not alter per-share quantities. Buy/sell mints or burns shares proportionally. The basket composition stays the same. This is the invariant that makes everything else possible.
- Buy/sell = mint/burn shares. You buy 1.05, you receive ~95.24 shares. The quantities per share do not move.
- **NAV drifts from 1 forever has failed at its only job.
-
Quantities are stored on-chain. The
_itpInventorymapping inIndexStorage.solis the canonical truth. Everything else is a reflection.
DTF Rebalancing
A rebalance reshuffles the deck without changing the value of the hand. New quantities, same NAV. The deployer adjusts the composition — the value per share does not flinch.Rebalance Quantity Formula
w_new[i]is the new target weight for asseticurrentNAVis the NAV at the moment of rebalanceprice[i]is the current price of asseti
Rebalance Worked Example
Time passes. Prices move. BTC rises to 3,500, SOL to $120. The DTF’s NAV is now:| Asset | New Weight | Price | New Quantity |
|---|---|---|---|
| BTC | 50% | $60,000 | 0.000009908 |
| ETH | 30% | $3,500 | 0.000101906 |
| SOL | 20% | $120 | 0.001981500 |
DTF ERC-4626 Vault Tokens
Every DTF is an ERC-4626 vault. A standard interface. Standards are dull. They are also the reason your tokens work everywhere.- Fungible — all shares of the same DTF are identical. Your share and my share are the same share.
- Transferable — send DTF tokens to any address. Ownership is portable.
- Collateralizable — use DTF tokens as collateral in lending markets. Borrow against what you believe in.
- 18 decimals — matching ERC-20 conventions. Precision beyond what any human needs.
Technical Details
Where the formula lives, for those who need to see the source. Trust, but verify. Or rather — do not trust, and verify.Implementation Reference
| Layer | Location | Function |
|---|---|---|
| Contract | Index.sol | createITP() — computes initial quantities from weights and prices |
| Contract | Index.sol | _getCurrentPrice() — computes NAV from stored inventory |
| Contract | Index.sol | updateWeights() — rebalance: recalculates quantities preserving NAV |
| Storage | IndexStorage.sol | _itpInventory[itpId] — canonical per-share quantities |
| Oracle | nav.rs | calculate_nav() — reads inventory via getITPState |
| Frontend | useItpNav.ts | Inventory-first calculation, weight fallback for legacy DTFs |