econia-labs / econia

Hyper-parallelized on-chain order book for the Aptos blockchain

Home Page:https://econia.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Emit market events at both market and user level

alnoki opened this issue · comments

commented

Presently, Econia emits market events at only the user level to eliminate redundancy: since an indexer can pick up on events from any handle, events can ultimately get parsed into a backed db even if they are emitted in a distributed handle set.

However, by only emitting at the user level (with the exception of swaps), it can be difficult to index orders straight from the chain. If data consumers do not want to run their own indexer node, then they will become reliant on a centralized external component.

By enabling redundant event emissions at both the market and user level, users will be able to see their own trading history and market makers will be able to process trading history in a live manner, with an Aptos REST API as a sole dependency.

By consolidating event handles to single resources, the number of borrows and global storage operations can be reduced, thus eliminating the major gas concerns that motivated the present design.

The result is indeed a trade-off: minor increase in gas costs and redundant data emissions in exchange for increased ease of integrations.

Closing per event v2 paradigm and deprecation of handle-based event v1 paradigm