Skip to content

Conversation

Copy link

Copilot AI commented Nov 13, 2025

Implements daily volume calculation for Boson Protocol across multiple chains (Polygon, Ethereum, Base, Arbitrum, Optimism).

Volume Sources

Daily volume aggregates three data sources:

  1. Encumbered funds - Funds locked when exchanges are created (FundsEncumbered events)
  2. New limited offers - Total value of newly created offers with fixed quantity (OfferCreated events v2.0.0-v2.5.0)
  3. Reserved ranges - Voucher ranges reserved for unlimited offers (RangeReserved events + on-chain offer lookup)

Implementation

  • getEncumberedFunds() - Sums amounts from FundsEncumbered events
  • getNewOffers() - Calculates quantityAvailable × price for limited offers (skips unlimited where quantityAvailable = MaxUint256)
  • getReservedRanges() - For unlimited offers only, calculates (endExchangeId - startExchangeId + 1) × price after fetching offer details via contract call
  • getProtocolVolume() - Orchestrates the three functions and returns aggregated volume by token

Handles multiple OfferCreated event versions (2.0.0 through 2.5.0) as the event schema evolved over time.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI mentioned this pull request Nov 13, 2025
Copilot AI changed the title [WIP] Add daily volume contribution for Boson fees Add Boson Protocol volume tracking Nov 13, 2025
Copilot AI requested a review from levalleux-ludo November 13, 2025 11:27
@levalleux-ludo levalleux-ludo marked this pull request as ready for review November 14, 2025 09:56
@levalleux-ludo levalleux-ludo merged commit 943936e into boson-fees-volume Nov 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants