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

gateway: sign and relay orders #333

Open
lispc opened this issue Sep 17, 2021 · 1 comment
Open

gateway: sign and relay orders #333

lispc opened this issue Sep 17, 2021 · 1 comment

Comments

@lispc
Copy link
Member

lispc commented Sep 17, 2021

background

we may need to develop an exchange gateway to maker bots to integrate.

The rollup exchange is more complex than normal CEXs. eg nonce, eddsa signature.

The trading bots may include python/js/java/c++, it is unrealistic to implement to same logic ( encoding & sign ) in every language. So a rust gateway may be helpful.

The gateway is run by a trading team, the gateway can access their l2 seckey. Bots send raw orders to the gateway, gateway service fetchs nonce & order_id & order_pos and signs the order, and then send the signed order to the real FluiDex server.

TODO

  1. copy and modify client.ts into a grpc server process, which expose one grpc endpoint signOrder. signOrder shares most codes with createOrder function. input: order details, output: signature
  2. add a python client, which uses the js grpc signer to get order signature, then sends signed orders to the exchange
@lispc
Copy link
Member Author

lispc commented Sep 17, 2021

APIs of the gateway:

here is an example of APIs ( ccxt / freqtrade) : https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/exchange/exchange.py

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

No branches or pull requests

1 participant