SparkDEX To Enable BeforeSwap PMM Hook on SparkDEX V4 powered by Flare FTSOv2

Context

The following proposal introduces the BeforeSwap PMM Hook to SparkDEX’s Algebra v4 pools using Flare’s FTSOv2 oracle. This hook compares the pool’s quoted price against the real-time reference market price before each swap. When the two are closely aligned, pools behave exactly like today’s Algebra v4 AMM and the standard swap fee applies. When volatility pushes the pool price out of line with the oracle, the hook dynamically adjusts the effective fee: A flow that would exploit a stale price pays the difference as a higher LP fee (or the swap reverts), while a flow that helps rebalance the pool can receive a base-fee discount. The additional fee income is earned by liquidity providers. The result: reduced impermanent loss, higher net LP returns, and an outstanding Flare-native use case.

Background: The Problem

Every AMM prices from its own reserves, not from the wider market. When prices move faster than the pool can be arbitraged, the pool quotes stale prices. Arbitrage bots either buy assets from LPs too cheaply, or sell assets to LPs too expensively, and keep the difference. This is the core engine of Impermanent Loss and Loss-versus-Rebalancing (LVR): LPs unwillingly bleed value to faster traders during fast moves. A high advertised APR routinely masks negative net yield once IL and toxic flow are netted out.

The Proposed Change

  1. Deploy a BeforeSwap PMM Hook on SparkDEX’s Algebra v4 pools.

  2. Compute the deviation between the pool price and the oracle reference price.

  3. If deviation is within threshold: the hook leaves the standard fee untouched and the pool hence behaves like a normal Algebra v4 AMM.

  4. If deviation exceeds threshold: the hook overwrites the effective fee. A flow that would exploit the stale price pays the difference as a higher LP fee, or the swap reverts; while a flow that helps move the pool back toward the reference price can receive a base-fee discount.

  5. The additional fees become external income earned by LPs, they are not retained in pool reserves.

Important: There will be no changes made to SparkDEX’s Revenue Model. The Breakdown of the protocol generated fees remains as follows: 75% of the V3, V4 and Perps generated fees go to the SparkDEX DAO Treasury, 100% of which are used to buy back and burn $SPRK from the open market.

The remaining 25% of V4 DEX generated fees go to the SparkDEX Foundation, allocated to development, operations, audits, integrations, and ecosystem growth.

Flare’s FTSOv2 Power

The proposed mechanism depends on reliable, low-latency, decentralized pricing available on-chain at swap time. FTSOv2 provides block-latency price updates secured by the Flare network itself. This design is only possible on Flare, as it is not a generic oracle integration but a new fee logic layered onto the Algebra v4 AMM, enabled by Flare’s native data infrastructure, and it meaningfully increases on-chain oracle utility.

Benefits for Liquidity Providers

• Reduced impermanent loss: the fee logic blunts systematic stale-price extraction during fast moves.

• Higher value capture: value that would leak to arbitrageurs is returned to LPs as fees.

• Better capital efficiency: liquidity works harder when less value escapes the system.

• Healthier, stickier liquidity: sustainable net returns attract long-term LPs.**

Discussion And Voting Details
**
A period of 3 days will be allotted for a community governance discussion, before voting begins on Friday, August 7 at 14:00 UTC. Voting will span for 4 days, concluding on Tuesday, August 11 at 14:00 UTC.

The following voting options will be available for xSPRK holders:

  1. FOR: Approve the deployment of the BeforeSwap PMM Hook on Algebra v4 pools on SparkDEX
  2. AGAINST: Disagree with the deployment of the BeforeSwap PMM Hook on Algebra v4 pools on SparkDEX
  3. ABSTAIN: No preference

Closing

SparkDEX encourages community members to share perspective with one another, inquire directly with the team to answer any questions, and conduct adequate research prior to voting.

Once official voting goes live, all xSPRK holders are invited to cast their votes. Your voting power is proportional to your xSPRK balance as reflected on the SparkDEX staking platform.

To acquire xSPRK, users must first earn or acquire SPRK through staking rewards or swaps. Once users have SPRK in their wallet, they can stake SPRK to receive xSPRK on a 1:1 basis using SparkDEX’s SPRK Staking page.