The recent interest of financial giants, including BlackRock and Fidelity, in integrating cryptocurrencies like Bitcoin and Ethereum into their ETF offerings made me wonder if I could create a decentralised and transparent ETF that can encompass assets from different chains.

That's how XTF (DeX Traded Fund) was born. My goal was to simplify and enhance the security of investments in a variety of digital assets, eliminating the hassle of managing each asset individually or dealing with multiple wallets.

Despite the existence of crypto indexes like the Bitpanda Crypto Index, which are established by centralised entities, latest developments have underscored the need for an alternative approach. In response, I aimed to develop a fair protocol where every stakeholder — from those depositing assets into the ETF buckets to the holders of the resulting share tokens — could clearly recognise the benefits.

The logo of XTF, depicting a multi-layered cake, symbolises the integration of various assets into a unified investment and offers investors a 'slice' of this diversity in a single, cohesive asset.


What it does

XTF, which stands for deX Traded Fund, transforms the way traditional Exchange-Traded Funds (ETFs) work by adopting a decentralised approach. Typically, in traditional finance, a single central entity is responsible for managing and securing all the assets in an ETF. They collect these assets to form a large, diversified pool and then split this pool into smaller parts, each representing a share of the ETF.

XTF takes a different approach by decentralizing the entire process. Instead of pooling all assets into one large collective, it organizes them into multiple smaller 'vaults.' Each of these vaults holds a part of the overall asset mix, but in manageable quantities. This design makes it easier for users to participate in these vaults, allowing them to quickly acquire their share of the investment through ETF shares in the form of ERC20 tokens.

Furthermore, XTF offers a flexibility not commonly found in traditional finance: users can choose to return their ETF tokens to redeem the actual assets stored in these vaults. This reverse process adds an extra layer of user control and liquidity. Detailed insights into this process, including the full 'xState' (state machine) representation of the protocol, will be covered in an upcoming whitepaper.


Now, let's explore some of the key features of XTF:

  • DAO-Driven Index Composition: Initially, a Decentralized Autonomous Organization (DAO) decides on the vaults' composition. This is similar to how index in traditional ETFs are built. The process involves selecting specific tokens and determining their quantities to ensure a balanced asset distribution in each vault. Moreover, the DAO sets critical parameters like the total number of vaults, how many token shares are distributed for each vault, how many token shares are necessary to redeem the vault assets, and any relevant fees.

  • User contributions: Users holding assets listed in the index can deposit these into any vault. This helps meet the vault's required asset mix. In exchange, when a vault is full, contributors receive ETF share tokens and NFT Votes, proportional to the amount they put in.

  • ETF Token Issuance: The protocol issues ETF tokens to users only after a vault has gathered all necessary assets, maintaining a balanced distribution across the ETF index. The number of tokens a user gets corresponds to their contribution size. XTF leverages Chainlink Data Feeds to precisely value each contribution, ensuring the valuation is based on up-to-date market data.

The following formula specifies how many ETF tokens are minted for each user, considering multiple assets types:


and the total number of tokens minted for each vault is equal to:




  • Vaults Lyfecycle: Vaults within XTF go through different stages. Some are 'OPEN' and ready for contributions. Others are processing deposits from external blockchains. Once a vault accumulates the targeted assets, it issues tokens ('MINTED' stage). And some vaults are 'BURNED' after their assets are redeemed by ETF token holders, marking the completion of their cycle.


  • Vault's assets Redemption and Liquidity: ETF token holders in the XTF system can trade their tokens for the actual assets in the vaults, adding significant utility to these tokens. When a vault completes its cycle, it issues ETF tokens in proportion to the contributions received, with a part set aside for fees. These tokens typically become redeemable for the underlying assets after a set lock-in period, incentivising investors to hold onto their tokens for potential long-term benefits.

  • Simplified Cross-Chain multi asset investment via Chainlink CCIP: XTF simplifies investing in diverse assets across multiple blockchains. It does this without the need for managing several wallets or navigating different blockchain systems. XTF's protocol uses cross-chain communication, involving two types of smart contracts: 'ETFContractV2.sol' on the main chain and 'SidechainDeposit.sol' contracts on external chains (sidechains). This feature simplifies the investment process and offers a more convenient way to diversify investment portfolios.

    • Sidechain Deposit: In XTF's system, users on the mainchain deposit funds using a specific method (depositFunds) in the ETFContractV2.sol contract. For sidechain deposits, they use a different method (depositFundsAndNotify) in the SidechainDeposit.sol contract. This process ensures that deposits are authenticated, and vault balances are updated accurately. The deposits from sidechains are sent to the mainchain, where they're processed and aligned with the mainchain assets.

    Deposit funds on sidechain flow (from Sidechain to Mainchain)


    • Sidechain redemption: After a set period (lockTime), users holding enough ETF share tokens can start redeeming their investments. This action releases the assets on the mainchain and marks the completion of that vault's cycle. Additionally, users can initiate a cross-chain redemption, using sendRedeemMessage to release assets across the involved sidechains.

    Redeem assets on sidechain (from Mainchain to Sidechain)


  • DAO Token and Chainlink VRF 'Lottery' Mechanism: In XTF, when a vault reaches full contribution, participants receive a special DAO NFT Vote, utilising Chainlink VRF (Verifiable Random Function). This introduces an element of randomness in awarding DAO tokens, ensuring a fair and transparent process. The likelihood of receiving a DAO NFT token is linked to the size of the user's contribution fulfillRandomWords. This approach is similar to the selection mechanisms used in various blockchain PoS consensus models and more recently adopted for Proof of Transfer (PoT) in the sBTC protocol [2]. The DAO token in XTF, a unique type of NFT, can't be burned by its holder directly. Instead, it's automatically burned when a user redeems assets from a vault using their ETF tokens, which happens after a specified lock period. This process incentivises investors to hold their assets longer, potentially increasing the ETF tokens' liquidity. ETF tokens serve as a representation of contributions within XTF. The specific handling of the DAO NFT vote is designed to avoid complications in large-scale, decentralised voting (see On Fairness in Voting Protocols [2]). By linking the burning of the DAO NFT to the redemption of assets, XTF ensures a balanced system that priorities security, efficient liquidity, and fair participation.

  • Transparent and Equitable System: XTF leverages blockchain technology and smart contracts to ensure every transaction and vault composition is transparently and permanently recorded. This approach greatly enhances the trust and clarity for all participants, making the system transparent and equitable.

How we built it

My journey in developing XTF during the hackathon started with creating smart contracts using Solidity, initially as a single-chain protocol. The main aim was quick development and testing of key features. For this, I used mock interfaces for the DataFeed and Hardhat for early testing, ensuring the protocol’s foundation was strong.

The protocol first handled defining vault compositions and managing deposits, then progressed to minting tokens in proportion to each user's contribution once a vault was fully funded. To enhance reliability and security, I integrated vetted libraries like Thirdweb’s TokenBundle and TokenStore.

As XTF evolved, I introduced multi-chain functionality, adding mock contracts for the LinkToken interface and the CCIP router, and incorporated a VRFCoordinator mock for the NFT Vote lottery feature. A comprehensive suite of tests was crucial for validating the protocol and refining its versions.

For the user interface, I chose NEXT.js, React, and ThirdWebUI, incorporating graphical elements using libraries like Chart.js and ApexCharts.js. The data on the website, mainly sourced directly from the blockchain through . QuickNode providers, includes bundle states, compositions, and asset allocations, with some data for index price comparisons sourced from the Young Platform API.

The final stage was deploying the project on Vercel for judges' review. However, I've kept broader public access limited for now, prioritizing stability and user experience, especially since the performance under multiple user access scenarios is yet to be fully tested.


List of all implemented smart contracts

In the XTF repository I have listed all the contracts I have developed for this hackathon in this file contract.



A full step by step guide on how to use the demo web app is published here

  • Remember that you can mint the test tokens directly on the website (green links next to the balance) and interact with any decentralised ETF vault.
  • Remember that for a bug you should not have different chain views on different tabs.

I have also implemented a guided walkthrough on the website to help users get started. This can be accessed by clicking the 'Tour' button located on the right side of the Viewer bar.

guide (I have used it also for the first version of the video that was exactly 5 minutes long! here)

  • If you want to run scripts or test please refer to of the repo

  • npm run test: to run all hardhat tests to check the XTF protocol

  • npm run cheksize: to check the size of the contracts npm run init: to run a local testchain, build the contracts and deploy them to the local chain (see deploy.ts script)

Challenges we ran into

Developing XTF presented several challenges. One major obstacle was the absence of mock contracts for certain Chainlink components, requiring me to deepen my understanding of these elements and create custom mocks from scratch.

Another significant challenge was adhering to the MAXIMUM_BYTECODE_SIZE limit set by the 'Spurious Dragon' hard fork. This limitation demanded continuous optimization and refactoring of our smart contracts. To manage the contract size effectively, I crafted a script that checked the size after each change, guiding my adjustments. Eventually, I divided the contract into three parts — a base contract, a types contract, and a third segment — to meet size constraints.

From a backend development perspective, crafting a user interface that supported seamless network switching across multiple chains was a complex task. The standard wallet connection model, which typically limits users to a single chain, posed a significant challenge in creating a unified and flexible user experience.

Lastly, producing a comprehensive video to explain the XTF protocol and demonstrate the web app within a five-minute timeframe proved to be a demanding task.


Accomplishments that we're proud of

One of our project's major accomplishment was transforming the XTF protocol from a conceptual design to a fully operational set of smart contracts. This journey from initial sketches on paper to working code was both challenging and rewarding. It involved not only developing and testing a proof of concept using Hardhat but also swiftly building and launching a comprehensive website into a live environment, all within a matter of weeks.

Establishing a strong foundation for the protocol was crucial. It provided the flexibility needed for continuous improvements, allowing me to effortlessly integrate new features and make adjustments as required during the shift from testing to production. Adapting and refining the system to meet the demands of real-world applications proved to be one of the most exhilarating parts of this hackathon.


(Yes I have spilled coffee on my notes multiple times)

What we learned

One key takeaway from this project was the rapid learning and implementation of a complex protocol, especially in using three Chainlink services: Data Feed, CCIP, and VRF, with a particular emphasis on CCIP. Delving into CCIP was a journey into a sophisticated and effective solution for interoperability challenges in blockchain networks.

My experience as the inventor of the Overledger protocol [3], now known as Quant Overledger, an early example of cross-chain communication, gave me a foundation to understand and navigate the complexities of such technologies. Engaging with CCIP was a valuable learning part of my work I'm especially proud of. This project not only leveraged my existing knowledge in cross-chain systems but also expanded it, particularly in understanding and applying Chainlink's solutions in the space.

What's next

Moving forward, the primary focus for XTF is a comprehensive refactoring of the smart contracts, including integrating Proxy Contracts for simplify code management and audits.

In addition to making ongoing improvements to XTF, I want to add some new features and addressing any issues in both the smart contract and website interface, as outlined here TO-DO Github. XTF's roadmap includes enabling users to deposit non-fungible assets like ERC721 and ERC1155 into vaults, which will enhance liquidity utilizing Chainlink's NFT Floor Price Feeds. I am also implementing the option for users to withdraw assets from pre-minted vaults, offering more flexibility to the depositors. A thorough security audit of the protocol is planned to ensure its robustness and security after these features are implemented.

User feedback, gathered from share token holders and depositors, is essential in shaping the DAO functionality within XTF. I am currently exploring the implementation of a DAO-driven index rebalancing feature. Actively understanding and incorporating stakeholders' feedback is crucial to ensure that XTF aligns with the diverse needs and interests of all users.

Finally expanding my knowledge in Chainlink's Functions and in Chainlink Proof of Reserves, is another exciting direction. This could open up possibilities for integrating off-chain assets into decentralised ETFs, broadening the scope of XTF's offerings. Perhaps XTF will be at the forefront of offering ETFs with traditional assets and crypto exposure, stepping ahead of major players like Blackrock and Fidelity.


Built With

Share this project: