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

Hummingbot spot connector bot-api integration changes #3

Open
wants to merge 2 commits into
base: genius_yield-spot-connector
Choose a base branch
from

Conversation

HalukG
Copy link

@HalukG HalukG commented May 31, 2024

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

  • Updated Endpoint URLs: Adjusted REST API URLs to match the internal DEX API schema.
  • Order Placement: Ensured _place_order method aligns with the provided API structure.
  • Order Cancellation: Updated _place_cancel method to use correct endpoint and parameters.
  • Trading Rules: Adjusted _format_trading_rules method to parse and validate trading pair information correctly.

2. genius_yield_auth.py

  • Authentication Method: Updated rest_authenticate to use header-based authentication as per our schema.
  • Signature Generation: Adjusted _generate_signature method to match the internal API’s requirements for request signing.

3. genius_yield_constants.py

  • Updated Constants: Modified URLs and paths to align with our internal DEX API endpoints.
  • Rate Limits: Adjusted rate limits to reflect the internal API’s constraints.

4. genius_yield_api_order_book_data_source.py

  • Order Book Snapshot: Updated _request_order_book_snapshot method to fetch order book data from the correct endpoint.
  • Order Book Message Parsing: Adjusted snapshot_message_from_exchange and diff_message_from_exchange methods to align with the schema’s structure for bids, asks, and update IDs.

5. genius_yield_order_book.py

  • Message Structure: Updated snapshot_message_from_exchange, diff_message_from_exchange, and trade_message_from_exchange methods to correctly parse and structure order book messages based on the provided schema.
  • Removed Unused Fields: Removed references to fields not present in the schema, ensuring data consistency.

6. genius_yield_utils.py

  • Validation Logic: Updated is_exchange_information_valid to ensure trading pairs are enabled based on status and permission sets.
  • Config Map: Ensured GeniusYieldConfigMap includes fields for API key and secret with appropriate prompts.

7. genius_yield_api_user_stream_data_source.py

  • Removed User Streams: Acknowledged the absence of user stream support and adjusted the implementation to log this and avoid unnecessary processing.

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"])
Copy link
Author

Choose a reason for hiding this comment

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

Need to verify wheter we can map symbol to market_id

@@ -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)
Copy link
Author

Choose a reason for hiding this comment

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

Needs to be double checked wheter trading_pair is appropriate here. Might be correct to use asset_ticker instead

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()
Copy link
Author

Choose a reason for hiding this comment

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

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.

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)
Copy link
Author

Choose a reason for hiding this comment

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

Again might be more appropriate to use ticker here

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.

1 participant