Recovering from Napier V1

Published:

November 8, 2024

Auther:

  • napier

    Napier

  • napier

    Yusuke

Share:

Recovering from Napier V1

TL;DR:

  • On September 16, 2024, we made the significant decision to discontinue all operations related to Napier Finance version 1.
  • Over the course of the following months, the Napier Labs team prioritized the safety of user funds while taking swift action to rebuild Napier v2.
  • User deposits exceeding $10 million within two weeks of launch were successfully withdrawn without issues.
  • The same Napier Labs team that has fully recovered from this incident is now diligently building a more robust, powerful, and modular Napier Platform V2, which we are excited to roll out in the coming months.

Introduction

As we prepare the launch of Napier v2 and welcome 2025, I want to update you on the efforts of the Napier Labs team. 2024 was not the year we had hoped for, but we are more confident than ever that 2025 will be a pivotal year for DeFi (Some people call it DeFi Renaissance), especially for Napier. The Napier team is working on transformative projects to fulfill our mission of building “open and resilient financial systems that empower individuals worldwide.” Before we look to the future, let’s reflect on the series of events that occurred with Napier v1. We want to ensure greater transparency in our communication with the community.

2024

2024 was challenging year for us.

Our team members and stakeholders dedicated themselves to rebuilding efforts. Without their exceptional commitment, we wouldn’t have achieved such a swift transition from v1 to v2, expected to launch early next year. We are now a stronger and more resilient team than we were before September 2024. Not only have we retained nearly everyone who was there at that time, but we’ve also welcomed talented individuals who believe in our vision to build outstanding software at Napier Labs.

Napier in the Beginning

I am one of the three co-founders of the Napier project, which started during the peak of the 2022 bull market. At that time, my co-founders and I aimed to enable on-chain interest discovery in an open, non-custodial, and efficient manner.

Before starting this project, I conducted research structural analysis and physics at university, while doing a DeFi research at various blockchain companies. My research focused on structural analysis models and computational models for reinforced concrete (RC) structures, which exhibit complex behaviors such as crushing, cracking, and adhesion with rebar. These structures are known for their resilience to earthquakes, thanks to the combination of concrete and rebar properties. While this may seem far removed from DeFi, the core principle of building systems that withstand external pressures is not so different. This principle ultimately drew me to the DeFi movement, which began in earnest in late 2019.

My co-founders and I initially set out to differentiate Napier from market leaders like Pendle and Element (now Delv) by creating a new mechanism for decentralized interest discovery and efficient incentive structures to prevent liquidity fragmentation. This concept aimed to open doors to a potentially massive market that was struggling to find its place in the market.

We adopted Curve's system and ecosystem as our foundational structure, seeking to enable external projects like ours to easily establish a permissionless yield derivatives market.

Before September 16

The mathematical framework of our efforts in Napier v1 was sound. However, we encountered some technical issues at the code and implementation levels. Specifically, we faced challenges with “efficiently exchanging Yield Tokens (YT) for ETH” and “calculating the amounts of ETH or TriLST-PT.”

To overcome these, we attempted temporary measures, such as covering liquidity from both personal and the company's funds, but these solutions proved neither sustainable nor efficient, leading us to the decision to discontinue all operations related to Napier v1.

September 16 - Napier v1 Suspension

On September 16, we made the significant decision to suspend all operations related to Napier Finance v1. For us, with a user-first mentality, this was a necessary choice to protect users' funds from unintended losses. As a team, we worked hard to demonstrate this through actions rather than just words, which I will elaborate on later.

I also want to emphasize that our product was not exposed to any security risks then or now. We took smart contract audits and bug bounty programs seriously, and I want to highlight the excellent work done by our auditors, MixBytes and Sherlock. Their thorough reviews eliminated vulnerabilities from our codebase, and no bugs have been discovered or reported to date through our bug bounty program.

We deeply appreciate their contributions and respect their work.

Our Response

The issues in Napier v1 were primarily due to the design complexities of the Napier pool, particularly the challenges in efficiently exchanging YT for ETH and calculating ETH or TriLST-PT amounts. This led to slippage during transactions and problems with price/rate oracles. As a side effect, a rush of users attempting to withdraw liquidity caused a significant imbalance in the pool.

Response to Liquidity Providers in Napier Pool (Llama Quest Chapter 2)

The Napier Pool was designed as a pair of Curve pool LP tokens and WETH. This liquidity provision was provided as a zap transaction triggering four actions in total. Using the PT-stETH example here:

  1. Mint 0.76 PT-stETH and 0.76 YT-stETH with part of 1 WETH (approximately 0.76 WETH) and swap that PT-stETH for TriLST-PT Curve pool LP tokens.
  2. Deposit PT-stETH into the TriLST-PT Curve pool and receive LP tokens in return.
  3. Deposit the remaining WETH (approximately 0.34 WETH) and the newly minted LP tokens into the Napier pool.
  4. Finally, you are left with Napier Pool LP tokens and YT-stETH.

Due to a lack of clarity in our announcements, the community rushed to withdraw liquidity (WETH). As a result, the asset composition in the pool was heavily skewed towards PT assets, deviating significantly from the market's fair rates (for instance, at one point, the fixed yield for PT-frxETH rose to three digits). Consequently, community members found it challenging to withdraw from the Napier pool without incurring losses.

To address this, we implemented a function on the Napier Finance Interface to enable liquidity withdrawals in PT assets. However, this led to another issue: many users did not hold the YT necessary to redeem PT before maturity. This problem arose when users provided liquidity from one yield source and later attempted to withdraw liquidity from a different yield source.

Addressing this was a challenging task, as we understood the importance of opportunity costs for users' funds, and we did not want their capital to remain unrecoverable until maturity. Therefore, we worked to identify the specific YT each user needed and match them for exchange. The volume of YT transactions executed through these processes reached approximately $3 million, according to our records.

Thanks to these efforts, nearly all users were able to withdraw their funds successfully. We will refrain from naming individuals for privacy reasons, but we remember everyone who helped with this, and the entire Napier Labs team is very grateful.

Response to PT Holders/YT Holders/Liquidity Providers in Llama Quest Chapter 3

During the period of Llama Quest Chapter 3, which marked the launch of Point Casinos, only YieldNest's ynETH was listed in the initial offerings. The subsequent listings were canceled simultaneously with the suspension of Napier v1, so they were never listed.

In Napier v1, the Curve MetaPool was composed of pairs of any PT asset (e.g., PT-ynETH) and LP tokens from the Napier Pool (TriCrypto pool for PT-stETH/PT-sfrxETH/PT-rETH). Swapping PT or LP tokens for underlying assets required actions across three different pools: swapping in the MetaPool (or redeeming LP tokens), swapping in the TriLST-PT Curve pool, and swapping in the Napier pool.

Additionally, YT swaps required the additional step of redeeming both PT and YT together. As mentioned earlier, YT swaps faced another challenge: the Curve MetaPool does not support flash swaps, and breaking down the AMM calculation logic to implement flash swaps is very complex, making it extremely difficult to execute YT to ETH swaps. Predicting price impacts and obtaining information for YT swaps was almost impossible (or significantly inaccurate). Consequently, these swap actions required combinations of swaps across three different pools, which could lead to unpredictable and substantial price impacts if one of the pools had low liquidity.

Such actions should be avoided to minimize user losses, and they were too complex to execute. Therefore, we decided to buy back all PT-ETH/YT-ynETH/LP-ynETH for users at the price they purchased them (some users preferred to hold onto them until maturity to realize more profit).

Conclusion

First and foremost, we acknowledge that despite building a complex product, our documentation, UI explanations, and communication with the community were lacking.

To show our sincerity and respect to the community regarding the issues that arose, we did not just respond with words but took action by addressing approximately 300 community inquiries individually. Here’s a summary of that response:

  • Over 300 tickets were opened for consultations.
  • User deposits exceeding $10 million within two weeks of launch were successfully withdrawn without issues.
  • Full compensation was offered to anyone who experienced losses.

We had the opportunity to engage with almost all users of Napier Finance version 1. While this situation was not ideal for us, it allowed us meaningful conversations with each Napier v1 user. We received both constructive and positive feedback, which has become a driving force as we prepare for the upcoming launch of Napier v2, and we are very grateful for it.

A special role and Discord channel for Napier v1 users have been established. In this channel, we plan to share alpha information about Napier and invite participants for private testnet access to Napier v2. If you haven’t received an invitation yet, please join our Discord channel and send us a message.

Napier v2

With Napier Finance v2, we aim to incorporate the lessons learned and improvements identified during the development of v1, drawing on over three years of experience that our team has invested in this field. I also want to emphasize that Napier v2 is not just a modified version of Napier v1; it is a completely new protocol built from the ground up. Over the past year, we have focused on research and development to bring this vision to life. I believe the details of this will be shared with you soon.

If you’d like to learn more about what we’re building, feel free to reach out to me. I’ll be at Devcon next week, so we can grab a coffee and discuss potential collaborations or the future of open financial systems. Just drop me a DM!

What’s Next?

We’re excited to see how every part of the Napier v2 process will unfold, developed together with the community, builders, and users. While some may argue that yield trading isn’t a viable business or that it’s just a talk about point, we believe that Napier v2 will break through the limitations of current market structures and is one of the few viable paths to tapping into the multi-trillion dollar IRD market.

We have already begun collaborating with multiple audit firms and individuals in phased technical reviews for the Napier v2 codebase (currently with yAudit and Vectorized). Many of the most talented builders in the industry are actively working to validate, review, and enhance the Napier v2 codebase. I really appreciate for that.

Stay tuned for what we are building at Napier Labs. Spoiler alert: various initiatives are on the roadmap, ranging from smart contracts to user-facing interactions. Scaling the ecosystem is our overarching design goal.