Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signed orders API #139

Merged
merged 12 commits into from
Dec 29, 2023
Merged

Signed orders API #139

merged 12 commits into from
Dec 29, 2023

Conversation

atvanguard
Copy link

@atvanguard atvanguard commented Dec 12, 2023

Why this should be merged

  • Introduces Signed orders
  • New precompile jurorv2 that adds functionality to match signed orders with any other order type

Accompanying contracts PR - https://github.com/hubble-exchange/hubble-protocol/pull/214

@atvanguard atvanguard changed the title order validations in precompile and API Signed orders API Dec 21, 2023
@atvanguard atvanguard marked this pull request as draft December 21, 2023 21:28
@atvanguard atvanguard marked this pull request as ready for review December 26, 2023 21:48
@atvanguard atvanguard requested a review from lumos42 December 26, 2023 21:48
Copy link

@lumos42 lumos42 left a comment

Choose a reason for hiding this comment

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

there are some commented log lines which can be removed

plugin/evm/orderbook/config_service.go Outdated Show resolved Hide resolved

const (
Limit OrderType = iota
IOC
Limit = hu.Limit
Copy link

Choose a reason for hiding this comment

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

is this to keep it compatible with existing data in memory db?

Copy link
Author

Choose a reason for hiding this comment

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

Moved the data structures to hu. but a lot of code was referencing Limit directly from this package.


// Trading API methods

// func (o *SignedOrder) UnmarshalJSON(data []byte) error {
Copy link

Choose a reason for hiding this comment

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

why are these commented?

Copy link
Author

Choose a reason for hiding this comment

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

Used this earlier, but now I changed encoding from json to abo encoded

plugin/evm/orderbook/trading_apis.go Outdated Show resolved Hide resolved
@atvanguard atvanguard merged commit 6fdce7c into signed-orders Dec 29, 2023
3 checks passed
@atvanguard atvanguard deleted the create-order branch December 29, 2023 14:44
atvanguard added a commit that referenced this pull request Jan 9, 2024
* tradingApi.PostOrder

* start modifying precompile

* all validations!

* stash

* fix unit tests

* trading_postOrder API works 🎉

* misc

* Matching works!

* chainid and verifying contract

* stash

* fix test

* resolve shubhams comments
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