Metapool
  • Welcome
  • Getting Started
    • Quickstart
    • Overview
    • Architecture
  • Basics
    • Features
    • How to Implement a Hook
    • Custom Hook Providers
    • Premium Services Powered by Metapool Mechanics
    • Flow Diagrams
    • Flow Details
    • Calculating Reputations with Brevis
    • PoC Tokenomics
    • Tech Stack
    • References
Powered by GitBook
On this page
  • Core Components
  • 1. Uniswap V4 Hooks:
  • 2. MetaPool Library:
  • 3. Reputation Logic Contracts:
  • 4. Brevis Zero-Knowledge Computation:
  • 5. Reputation Oracle (ERC-1155):
  • 6. EigenLayer Integration:
  • 7. Chainlink Integration:
  1. Getting Started

Architecture

The Reputation Hook in Metapool is a multi-layered system composed of several integrated components, each handling distinct functionalities to support the overarching reputation mechanism. Below is a breakdown of the core components:

Core Components

1. Uniswap V4 Hooks:

Uniswap V4 Hooks provide a modular interface to integrate logic at various points in liquidity pool operations, such as before/after swaps or during liquidity provision. The Reputation Hook leverages these Hooks to track user activity and adjust fees and incentives based on real-time reputation data, dynamically optimizing the behavior of liquidity providers and traders.

2. MetaPool Library:

The MetaPool Library plays a crucial role in aggregating user activity and liquidity data across interconnected pools, offering a unified view of pool health, trading activity, and liquidity movements. Key functionalities include:

  • Cross-Pool Liquidity Tracking: Aggregates liquidity data across multiple pools to help liquidity providers make smarter decisions.

  • Reputation-based Yield Analytics: Tracks metrics like APY and APR, tailored to a user’s reputation, allowing for reputation-based yield optimization.

  • Tick Movement & Second Derivative Analysis: Captures granular data on pool behavior, such as volatility and user interactions, which is used to create more intelligent fee structures.

  • Custom Hook Integration: Allows developers to implement unique functionalities like dynamic rewards, flash loans, and advanced limit orders, tailored to specific pool needs.

3. Reputation Logic Contracts:

Reputation Logic is managed at the pool level using a separate Reputation Logic Contract for each pool. These contracts are deployed using the EIP-1167 minimal proxy pattern, allowing each pool to operate independently while still interacting with the global reputation system. Functions include:

  • Reputation Calculation: Handles logic for updating user reputation based on activities such as swaps, liquidity provision, and collateral staking. This ensures fair and accurate reputation updates for each participant.

4. Brevis Zero-Knowledge Computation:

Brevis enables off-chain reputation computation in a privacy-preserving manner through zero-knowledge proofs. This ensures that user reputation can be calculated securely without revealing sensitive personal data, adding a significant layer of trust and decentralization to the system. Brevis guarantees that even off-chain reputation updates remain verifiable and secure.

5. Reputation Oracle (ERC-1155):

The Reputation Oracle is an ERC-1155 token contract that manages and stores user reputation through two types of tokens:

  • pRO Tokens: Non-transferable tokens representing a user's reputation score.

  • RO Tokens: Transferable tokens that grant access to premium features like discounted fees. The oracle continually updates these tokens based on real-time user activity, maintaining a transparent and decentralized reputation system.

6. EigenLayer Integration:

EigenLayer enhances security by leveraging Ethereum's Proof of Stake mechanism. It manages the collateralization of pools, monitors inactivity, and initiates slashing events for underperforming pools. This ensures that pools remain active and trustworthy, with built-in mechanisms to penalize negligence and ensure that participants have confidence in the system's stability.

7. Chainlink Integration:

Chainlink Automation plays a vital role in ensuring smooth, uninterrupted updates of critical data like feeds and volatility metrics.

PreviousOverviewNextFeatures

Last updated 7 months ago