v0.4.0
[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.
- The indexer is now capable of efficiently indexing contracts of the
Changes in Codebase
-
Version Upgrades:
- Updated
envio
package from1.1.4-fuel
to2.2.4-fuel
, enhancing indexing capabilities and compatibility with the Fuel ecosystem.
- Updated
-
GraphQL Schema Enhancements:
- Introduced new fields like
base_amount
andquote_amount
in multiple event types (OpenOrderEvent
,CancelOrderEvent
,TradeOrderEvent
,DepositEvent
, andWithdrawEvent
) for more precise balance tracking and event handling.
- Introduced new fields like
-
Refactored Handlers for Efficient Data Processing:
-
OrderBook Event Handling:
- Updated handlers for
OpenOrderEvent
,CancelOrderEvent
,TradeOrderEvent
,DepositEvent
, andWithdrawEvent
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.
- Updated handlers for
-
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.
- Improved the handling of active buy and sell orders by tracking their status (
-
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
.
- Handlers now process order and balance changes synchronously to ensure real-time updates without requiring additional asset lookup through removed
-
-
Loader Improvements:
- Optimized event loaders for
CancelOrder
,Deposit
,OpenOrder
,TradeOrder
, andWithdraw
to streamline balance loading and reduce unnecessary data lookups.
- Optimized event loaders for
-
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.
- Removed the unused
Bug Fixes
- Balance Calculation Fixes:
- Corrected balance calculation logic to ensure proper crediting and debiting of
base_amount
andquote_amount
across various event handlers, improving accuracy in tracking users' balances.
- Corrected balance calculation logic to ensure proper crediting and debiting of
Full Changelog: v0.1.0...v0.4.0