Skip to content

v0.4.0

Compare
Choose a tag to compare
@PaulZhemanov PaulZhemanov released this 16 Sep 13:33
· 127 commits to main since this release

[v0.4.0] - 2024-08-27

This release enables Envio to process contracts deployed using the latest versions of fuels-rs (v0.66.4) and forc (v0.63.5), with fuels-ts (v0.94.6) being used by the indexer.

  • Optimized Indexing for OrderBook Contracts:
    • The indexer is now capable of efficiently indexing contracts of the OrderBook type, reducing the amount of computation required to track user balances and trade volumes.

Changes in Codebase

  • Version Upgrades:

    • Updated envio package from 1.1.4-fuel to 2.2.4-fuel, enhancing indexing capabilities and compatibility with the Fuel ecosystem.
  • GraphQL Schema Enhancements:

    • Introduced new fields like base_amount and quote_amount in multiple event types (OpenOrderEvent, CancelOrderEvent, TradeOrderEvent, DepositEvent, and WithdrawEvent) for more precise balance tracking and event handling.
  • Refactored Handlers for Efficient Data Processing:

    • OrderBook Event Handling:

      • Updated handlers for OpenOrderEvent, CancelOrderEvent, TradeOrderEvent, DepositEvent, and WithdrawEvent to handle event processing based on user and asset balances.
      • Optimized logic for managing balance updates by removing dependency on marketConfig.ts and directly calculating balances.
    • Active Orders:

      • Improved the handling of active buy and sell orders by tracking their status (Active, Closed, Canceled) and updating corresponding user balances after each order action.
    • Order and Balance Updates:

      • Handlers now process order and balance changes synchronously to ensure real-time updates without requiring additional asset lookup through removed marketConfig.ts.
  • Loader Improvements:

    • Optimized event loaders for CancelOrder, Deposit, OpenOrder, TradeOrder, and Withdraw to streamline balance loading and reduce unnecessary data lookups.
  • Removed Unused Configuration:

    • Removed the unused marketConfig.ts file, which contained predefined constants for base and quote assets, as this is now dynamically handled within the event handlers.

Bug Fixes

  • Balance Calculation Fixes:
    • Corrected balance calculation logic to ensure proper crediting and debiting of base_amount and quote_amount across various event handlers, improving accuracy in tracking users' balances.

Full Changelog: v0.1.0...v0.4.0