
Octant V2 Yield Donating Tutorial
Octant V2 Yield Donating Tutorial
Demo
About
The problem it solves In traditional donation models, funds are spent once and require constant new contributions to maintain impact. This approach is not sustainable, especially for long-term public goods or community projects that need recurring financial support. Octant V2 introduces a new mechanism called the **Yield Donating Strategy (YDS)**, which allows users to contribute to funding ecosystems without losing their capital. Instead of donating their principal, users deposit assets into a smart vault that invests in DeFi protocols to generate yield. Only the yield is donated, while the deposited amount remains secure and withdrawable at any time. This model makes funding easier, safer, and more transparent for both individuals and organizations. * **Easier**, because users only need to deposit once to create continuous donations. * **Safer**, because the principal is never at risk of being spent. * **Transparent**, because every donation and yield event is recorded on-chain. By turning yield into a sustainable donation stream, this system reduces the dependency on one-time contributions and enables long-term impact through automated, verifiable funding. --- **Watch the full tutorial video:** 🎥 [Octant V2 Yield Donating Tutorial on YouTube](https://youtu.be/xkVgl2yoq-g) **Read the full technical blog post:** 📝 [How I Built a Self-Perpetuating Donation Engine on Medium](https://medium.com/@bimajdv7/how-i-built-a-self-perpetuating-donation-engine-that-never-touches-your-principal-834a86512ea8) **Explore the full codebase:** 💻 [Octant V2 Tutorial Repository on GitHub](https://github.com/Bimajadivaaa/Octant-V2-Tutorial/tree/main)
How it's made
Challenges we ran into The main challenge I faced was **building and integrating the smart contracts with the Octant V2 framework**. While the concept of a yield-donating vault seems straightforward, implementing it correctly required a deep understanding of how **Funding Vaults**, **Yield Donating Strategies (YDS)**, and **Donation Routers** interact within Octant’s modular architecture. One of the key difficulties was adapting the **ERC-4626 vault standard** to handle yield donations without affecting the user’s principal. Designing the logic for tracking the “high-water mark” and ensuring only the profit was donated demanded careful testing to avoid arithmetic errors and incorrect balance updates. Integrating with Octant V2 also introduced complexity in **aligning contract roles and adapters** with Octant’s framework. I had to make sure the adapter’s asset type matched the vault’s underlying token and that yield calculations worked consistently across deployment scripts and the frontend. To overcome these issues, I used **Foundry** for rapid contract iteration and **unit tests** to simulate deposit, yield growth, and donation cycles. I also referenced Octant’s documentation and existing YDS patterns to confirm that the contract flow was compliant with the expected architecture. Through continuous testing and debugging, I achieved a stable integration that could automatically donate yield while keeping user funds safe and verifiable on-chain.