Hummingbot spot connector bot-api integration changes - #3
Open
HalukG wants to merge 2 commits into
Open
Conversation
HalukG
commented
May 31, 2024
| async def _parse_trade_message(self, raw_message: Dict[str, Any], message_queue: asyncio.Queue): | ||
| if "result" not in raw_message: | ||
| trading_pair = await self._connector.trading_pair_associated_to_exchange_symbol(symbol=raw_message["s"]) | ||
| trading_pair = await self._connector.trading_pair_associated_to_exchange_symbol(symbol=raw_message["market_id"]) |
Author
There was a problem hiding this comment.
Need to verify wheter we can map symbol to market_id
HalukG
commented
May 31, 2024
| @@ -167,24 +174,20 @@ async def _place_order(self, | |||
| type_str = GeniusYieldExchange.genius_yield_order_type(order_type) | |||
| side_str = CONSTANTS.SIDE_BUY if trade_type is TradeType.BUY else CONSTANTS.SIDE_SELL | |||
| symbol = await self.exchange_symbol_associated_to_pair(trading_pair=trading_pair) | |||
Author
There was a problem hiding this comment.
Needs to be double checked wheter trading_pair is appropriate here. Might be correct to use asset_ticker instead
HalukG
commented
May 31, 2024
Comment on lines
-186
to
+190
| o_id = str(order_result["orderId"]) | ||
| transact_time = order_result["transactTime"] * 1e-3 | ||
| o_id = str(order_result["transaction_id"]) | ||
| transact_time = self._time_synchronizer.time() |
Author
There was a problem hiding this comment.
Need to check wheter we can use tx id as means of an orders id. Contact api does not have a seperate order id field it seems.
HalukG
commented
May 31, 2024
Comment on lines
-276
to
+237
| trading_pair = await self.exchange_symbol_associated_to_pair(trading_pair=tracked_order.trading_pair) | ||
| symbol = await self.exchange_symbol_associated_to_pair(trading_pair=tracked_order.trading_pair) |
Author
There was a problem hiding this comment.
Again might be more appropriate to use ticker here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integration Checklist for Hummingbot Connector with Bot API
Overview
This checklist details the changes made and further actions required to integrate the Hummingbot connector with our internal Bot API.
Bot-api schema referenced here: https://github.com/geniusyield/dex-contracts-api/blob/main/web/swagger/api.yaml
Changes Made
1.
genius_yield_exchange.py_place_ordermethod aligns with the provided API structure._place_cancelmethod to use correct endpoint and parameters._format_trading_rulesmethod to parse and validate trading pair information correctly.2.
genius_yield_auth.pyrest_authenticateto use header-based authentication as per our schema._generate_signaturemethod to match the internal API’s requirements for request signing.3.
genius_yield_constants.py4.
genius_yield_api_order_book_data_source.py_request_order_book_snapshotmethod to fetch order book data from the correct endpoint.snapshot_message_from_exchangeanddiff_message_from_exchangemethods to align with the schema’s structure for bids, asks, and update IDs.5.
genius_yield_order_book.pysnapshot_message_from_exchange,diff_message_from_exchange, andtrade_message_from_exchangemethods to correctly parse and structure order book messages based on the provided schema.6.
genius_yield_utils.pyis_exchange_information_validto ensure trading pairs are enabled based on status and permission sets.GeniusYieldConfigMapincludes fields for API key and secret with appropriate prompts.7.
genius_yield_api_user_stream_data_source.py