Next-Gen Data-Driven Features For DEXes: Algebra and Brevis Launch Dynamic Fees Plugin

[read_meter]

Since our initial collaboration with the Algebra team around developing the discounted swap plugin, we’ve been closely working with them to create something even more exciting! Today, we are thrilled to be able to share that decentralized exchanges (DEXes) using the Algebra Integral now have a special brand-new plugin they can use to dynamically adjust fees based on users’ past trading history! This is all done with the new Dynamic Fees Plugin Based on Trading Volume powered by Brevis.

The New Dynamic Fees Plugin Based on Trading Volume

Algebra Integral introduced a modular architecture that splits the DEX setup into two main components: the core codebase and the plugins. Particularly, a plugin is a smart contract that connects to a pool’s contract and expands its functionality with things such as dynamic fees. Plugins interact with the pools via hooks that allow the pool deployers to implement code to execute specific actions before or after a swap.

This new Trading-Volume-Based Dynamic Fees Plugin is a beforeSwap plugin and allows the hook contracts to trustlessly check a user’s VIP tier according to their past trading volume and apply a fee discount based on that VIP tier. This way DEXes are able to trustlessly implement a VIP loyalty program in order to provide exclusive discounts to their users based on their past trading history. This plugin is implemented based on Brevis’s ability to trustlessly read a user’s historical transactions over a given time period and parse each trade event with customized logic to compute the total trading volume for that specified time period. The ZK proof of the trading volume sum generated by Brevis is then verified in the hook contracts that will then adjust the dynamic fees accordingly.

In the VIP program we are demonstrating here, the Integral’s hook contract can access a trader’s historical swap transactions of token TS0-TS1 and compute the trading volume using Brevis automatically before the next swap. After the volume sum and the ZK proof generated by Brevis are verified on-chain, the hook contract will determine the trader’s VIP tier and allow the trader to enroll for a fee discount for the next trade:

This opens up DEXes to create and run VIP programs that were previously just too cost prohibitive to run, ushering in a new era of user acquisition and retention programs for DEXes.

A New Era of User Acquisition and Retention Programs For DEXes  

Centralized exchanges (CEXes) often have a trading-volume-based fee structure, known more commonly as a “VIP trader loyalty program” as the key to user engagement and retention. These programs serve as potent tools for retaining traders, bolstering liquidity, and ultimately significantly boosting revenue. These programs are fairly straightforward to implement on CEXes, however while trying to implement them on a DEX—things get a little more complicated.

The high costs and technical limitations of recording and processing large volumes of historical trading data hinder DEXes from implementing VIP trader loyalty programs. Unlike CEXes, which leverage centralized databases, DEXes struggle with decentralized architecture constraints, making it impractical to replicate these features. Specifically, recording every user’s trade in smart contracts incurs exorbitant storage costs and performing statistical queries and calculations on such data is very expensive. Moreover, the architecture of existing DEXes lack the customization capabilities to implement additional business logic, such as charging different fees for different users.

This is where our collaboration with Algebra comes into play.

With Algebra’s unique modular AMM approach—core + plugins—it’s possible to enable additional functionality built atop liquidity pools without having to change the initial core code, opening up many new possibilities. With the Brevis ZK coprocessor’s ability to access blockchain data and offload computation tasks off-chain—it allows smart contracts to utilize the computation results in a succinct and trustless way.

With this new Trading-Volume-Based Dynamic Fees Plugin, DEXes using the Algebra Integral gain the ability to create these VIP programs that match the CEX’s user experience by providing full access to the set of the users’ historical on-chain data through the power of Brevis. It makes it possible to integrate logic customized to different groups of users and LPs and helps to solve the limitations mentioned above.

To showcase just how powerful, efficient, and cost-effective Brevis is—here are some real numbers on throughput capacity and what that would cost.  Brevis can handle an impressive 19 million transactions per month, far exceeding a DEX’s current monthly trading volume, and can prove all these transactions at a cost of only $7200. This demonstrates Brevis’s capability to manage a very large volume of trading transaction calculations and proofs in a highly cost-effective way that would enable most DEXes in the space to run VIP programs.

The development of this Trading-Volume-Based Dynamic Fees Plugin marks another step in our ongoing collaboration and partnership. In the long run, Brevis is willing and able to work together with Algebra and any other plugin developers on Algebra to help make their plugins be able to be implemented in a trust-free manner.

Here are a few innovative features we are committed to building together:

  • A volatility-based dynamic fees plugin to automatically adjust the fees in response to the daily price volatility, based on the historical price and volatility data provided by Brevis.
  • A LP dedication-based liquidity farming plugin to trustlessly reward the committed and loyal liquidity providers during significant market fluctuations by analyzing their historical LP behavior data provided by Brevis. For instance, the LPs who consistently maintain positions and contribute fees generated during major market shifts ought to earn the greatest farming rewards.
  • And much more…

Keep watch as Brevis and Algebra continue on our journey to shape the future of DeFi. If you are also interested in building with Brevis we will help you get started! Contact us and get connected with a builder now!

About Algebra

Algebra is a Protocol enabling projects to integrate Concentrated Liquidity tech, alongside other groundbreaking features — Dynamic Fees, Built-in Farming, and more. Already seamlessly integrated into various DEXes across different chains, including Camelot, THENA, QuickSwap, StellaSwap, Lynex, Henjin, Kim, Swapsicle, Synthswap, Hercules, Swapr, SilverSwap, Zyberswap, Horizon, and more, Algebra propels them to higher trading volume & enhanced capital efficiency. 

Learn more on the website: algebra.finance.

Looking to build a DEX or develop plugins for Algebra Integral? Contact the team here.

Telegram | Twitter | Discord | YouTube

About Brevis

Brevis is a smart ZK coprocessor that empowers smart contracts to read the full historical on-chain data from any chain and run customizable computations in a completely trust-free way.

Brevis can trustlessly read the states, transactions, and receipts of any time frame. It efficiently runs computations on data of any size: as the data to be proved increases in size, Brevis significantly reduces the per-unit cost and time for proof generation. Additionally, Brevis seamlessly verifies Zero-Knowledge (ZK) proofs on any blockchain, providing a unified and trustless user experience for dApps. Brevis empowers data-rich use cases, including data-driven DeFi, user-segment optimized live-ops features, zkBridges, zkDID, and smart-contract native risk control, all executed in a trustless manner across multiple chains.

Dive Deeper into Brevis:
🌐Website | 🗨️Telegram | 🐦X | 📘SDK Docs