← Back to home

SAGE Protocol

Dynamic fee hook integrating S&P SSA ratings - safer stablecoin pairs earn lower fees on Uniswap v4

Problem Statement

This project bridges traditional financial risk assessment with decentralized finance by creating a sophisticated Uniswap v4 hook that dynamically adjusts trading fees based on real-time stablecoin stability data from S&P Global's Stablecoin Stability Assessment (SSA).Traditional Uniswap pools charge fixed trading fees regardless of the underlying assets' risk profiles. This hook transforms that model by integrating institutional-grade risk data directly into the fee structure, creating a transparent, incentive-aligned system that rewards users for trading the safest stablecoin pairs. The hook offers up to 30% fee discounts exclusively for pools pairing stablecoins with the highest SSA ratings (1-2, where 1 is best), while maintaining standard baseline fees for all other pairs.This positive reinforcement approach incentivizes users to migrate toward the most secure, institutionally-backed stablecoins through clear economic benefits, without penalizing liquidity providers or traders who choose lower-rated stablecoin pools—they simply pay market-standard fees rather than facing premium charges.

Solution

The hook intercepts Uniswap v4's beforeSwap lifecycle function, queries current SSA scores from Chainlink oracles (automatically refreshed via CRE triggers), calculates the appropriate fee discount based on the risk-weighted algorithm, and returns the modified fee to the PoolManager—all happening atomically within the swap transaction. Meanwhile, Amp continuously indexes all hook activity, transforming on-chain events into queryable datasets that power transparency dashboards and compliance reporting.Smart Contract Development:Foundry for comprehensive smart contract development, testing, and deployment workflows. Uniswap Foundation Hacker Toolkit for seamless integration with the PoolManager and pool lifecycle. Base Mainnet as the deployment target, leveraging its low transaction costs and Ethereum compatibilityOracle & Data Infrastructure:Chainlink CRE (Compute-Enabled Runtime) SDK to create a sophisticated trigger-based data feed workflow that automatically monitors S&P Global's publication cycle and updates the on-chain SSA scores whenever new stability reports are published by the data provider. This ensures the hook always operates on the most current risk assessments without manual intervention. S&P Global Stablecoin Stability Assessment (SSA) as the authoritative data source providing institutional-grade risk ratings on a 1-5 scale.Blockchain Data Management:The Graph's Amp for building and managing enterprise-ready blockchain datasets from the hook's on-chain activity. Amp transforms raw smart contract events into structured, verifiable datasets with built-in compliance and auditability features. The platform provides real-time indexing of swap events, fee calculations, and SSA score updates through SQL. Amp's cross-chain capabilities allow for future expansion beyond Base.

Hackathon

ETHGlobal Buenos Aires

2025

Prizes

  • 🏆

    Uniswap v4 Stable - Asset Hooks3rd place

    Uniswap Foundation

Contributors