Skip to content

Commit

Permalink
Refactor events/logic for indexing support (#321)
Browse files Browse the repository at this point in the history
* Add backwards-compatible taker ID support (draft)

* Implement FillEvent support, update docs/changelog

* Add common market order ID for fills/post, docs

* Update changelog for PR linking

* Remove unnecessary parentheses

* Add draft MarketEvents struct

* Add MarketEventHandles struct, draft MatchEvent

* Move user handles to be under user account

* Fix fill event taker order ID algo, broken tests

* Add draft LimitOrderEvent support

* Clarify deprecation/upgrade policy

* Rename PlaceLimitOrderEvent, pack_x_event helpers

* Add PlaceMarketEvent support

* Add SwapEvent support

* Add TradeSummary struct, refactor swap events

* Rename TakerFillSummaryEvent

* Rename struct creation helpers

* Update fee schema to be per fill, not per trade

* Eliminate redundant market-level emissions

* Add ChangeOrderSizeEvent support

* Add CancelPostedOrderEvent support

* Clean up market module struct commentary

* Add cancel reason enum support

* Update cancel schema/reasons for non-post orders

* Remove automatic adjustment of market order size

* Update cancel order events for swappers

* Add limit order cancel event support

* Use `Table` instead of `Tablist` for event handles

* Update get open order to return option

* Update new implementations to use `order_id`

* Add handle info getter view function support

* Remove extraneous parameters/acquisitions

* Consolidate event handles for market account

* Consolidate market-level event handles

* Update `NO_TAKER_ADDRESS` emission support

* Optimize limit order event emission

* Optimize assorted event emission calls

* Consolidate order cancel event emission

* Optimize loopwise fee computation/assessment

* Manually inline runtime market ID calculations

* Update doc/func comments for user module

* Update doc/func comments for market module

* Remove needles acquires diffs, tweak comments

* Remove MakerEvent type enum, update module doc

* Add constant getter tests

* Comment out inline directives for coverage testing

* Adjust runtime helper func inline status

* Add user tests, test helper funcs

* Address coverage gaps in market module tests

* Address cross-module invocation coverage gaps

* Address coverage gap for swapper event handles

* Uncomment inline keyword now that coverage is 100%

* Update module doc func indices, dependency charts

* Fix typos, build docs

* Fix doc linking, dep chart

* Re-build docs for typo fixes
  • Loading branch information
alnoki authored Jul 19, 2023
1 parent 8295a21 commit ddd1900
Show file tree
Hide file tree
Showing 8 changed files with 6,973 additions and 2,484 deletions.
20 changes: 16 additions & 4 deletions doc/doc-site/docs/move/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,29 @@ Econia Move source code adheres to [Semantic Versioning] and [Keep a Changelog]

### Added

- Assorted view functions ([#287], [#301], [#334]).
- Assorted view functions ([#287], [#301], [#321], [#334]).
- Assorted user- and market-level events with common order ID ([#321]).

### Changed

- Fee assessment updated to be processed per fill, rather than per trade ([#321]).
- Market order size is no longer automatically adjusted based on available market account holdings ([#321]).
- Default self match behavior for swaps (signing swapper self match against signing market account) changed from `ABORT` to `CANCEL_TAKER` ([#321]).
- Started using `order_id` instead of `market_order_id` for new implementations ([#321]).
- Replaced `market::NO_MARKET_ACCOUNT` with `market::NO_TAKER_ADDRESS` to account for signing swappers ([#321]).

### Deprecated

- [`market::Orders`](https://github.com/econia-labs/econia/blob/v4.0.2-audited/src/move/econia/sources/market.move#L3337) ([#301])
- [`market::index_orders_sdk()`](https://github.com/econia-labs/econia/blob/v4.0.2-audited/src/move/econia/sources/market.move#L3362) ([#287])
- [`move-to-ts`](https://github.com/hippospace/move-to-ts) attributes ([#292])
- [`market::OrderBook.taker_events`](https://github.com/econia-labs/econia/blob/v4.0.2-audited/src/move/econia/sources/market.move#L587) ([#321]).
- [`market::Orders`](https://github.com/econia-labs/econia/blob/v4.0.2-audited/src/move/econia/sources/market.move#L3337) ([#301]).
- [`market::TakerEvent`](https://github.com/econia-labs/econia/blob/v4.0.2-audited/src/move/econia/sources/market.move#L600) ([#321]).
- [`market::index_orders_sdk()`](https://github.com/econia-labs/econia/blob/v4.0.2-audited/src/move/econia/sources/market.move#L3362) ([#287]).
- [`move-to-ts`](https://github.com/hippospace/move-to-ts) attributes ([#292]).

[#287]: https://github.com/econia-labs/econia/pull/287
[#292]: https://github.com/econia-labs/econia/pull/292
[#301]: https://github.com/econia-labs/econia/pull/301
[#321]: https://github.com/econia-labs/econia/pull/321
[#334]: https://github.com/econia-labs/econia/pull/334
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html
Expand Down
958 changes: 494 additions & 464 deletions src/move/econia/doc/img/market_forward_dep.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,046 changes: 532 additions & 514 deletions src/move/econia/doc/img/user_forward_dep.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

1 comment on commit ddd1900

@vercel
Copy link

@vercel vercel bot commented on ddd1900 Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.