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 & Third party integrations #45

Open
4TT1L4 opened this issue May 8, 2024 · 2 comments
Open

Hummingbot & Third party integrations #45

4TT1L4 opened this issue May 8, 2024 · 2 comments
Labels
Priority - High Issue has high priority and has to be worked, if no blocker issues are being worked on. T-Shirt size - Medium High-Level effort estimation. Category "medium effort". Task A feature request or general task involving code changes.

Comments

@4TT1L4
Copy link
Contributor

4TT1L4 commented May 8, 2024

TODO:

  • Look into potential third party and hummingbot integrations.

We don't necessary need to use Hummingbot, but we should have a look what tools might be available and which ones are easy to integrate.

DOCS:

@4TT1L4 4TT1L4 changed the title Hummingbot Hummingbot & Third party integrations May 8, 2024
@4TT1L4 4TT1L4 added Priority - High Issue has high priority and has to be worked, if no blocker issues are being worked on. T-Shirt size - Medium High-Level effort estimation. Category "medium effort". Task A feature request or general task involving code changes. labels May 8, 2024
@HalukG
Copy link

HalukG commented May 15, 2024

Requirements for hummingbot spot connector:

# Hummingbot Spot Connector Integration Report

## Required Endpoints

### Public REST Endpoints

- **GET ACTIVE MARKETS**: Endpoint to get the list of active trading pairs (tokens info).
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/markets`

- **GET ORDERBOOK SNAPSHOT**: Endpoint to get the order book snapshot.
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/order-books/{market-id}`

- **PING ENDPOINT**: Endpoint returning a low amount of information, serving as a ping endpoint.
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/settings`

### Private REST Endpoints

- **GET ACCOUNT BALANCE**: Endpoint to get the current account balance.
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/balances/{address}`

- **GET OPEN ORDERS**: Endpoint to get active orders.
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/order-books/{market-id}`

- **CREATE ORDERS**: Endpoint to create new orders.
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/orders` (POST)

- **CANCEL ORDER BY exchange_order_id**: Endpoint to cancel an order by its exchange-generated order ID.
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/orders` (DELETE)

### Authentication

- **AUTHENTICATION**: Class that provides the logic for the web assistant to correctly configure authenticated requests to the exchange (private endpoints). It should be a subclass of `AuthBase`.
 - **Implementation Status**: Implemented
 - **Example**: `GeniusYieldAuth`

### Rate Limits

- **Rate Limits**: Documentation of the rate limits applied for each endpoint and global limits for each IP/connection.
 - **Implementation Status**: Implemented

## Optional Endpoints

### Public REST Endpoints

- **\[TR\] MINIMUM NOTIONAL SIZE**: Endpoint to get trading rules, including minimum notional size.
 - **Implementation Status**: Not implemented

- **\[TR\] MINIMUM ORDER SIZE**: Endpoint to get trading rules, including minimum order size.
 - **Implementation Status**: Not implemented

- **\[TR\] MINIMUM PRICE**: Endpoint to get trading rules, including minimum price.
 - **Implementation Status**: Not implemented

- **\[TR\] ORDER INCREMENT**: Endpoint to get trading rules, including order increment.
 - **Implementation Status**: Not implemented

- **SERVER TIME**: Endpoint to get the server time.
 - **Implementation Status**: Implemented
 - **Endpoint**: `/v0/settings`

### Private REST Endpoints

- **GET ORDER STATUS BY client order id**: Endpoint to get the order status by the client-provided order ID.
 - **Implementation Status**: Not implemented

- **GET ORDER STATUS BY exchange_order_id**: Endpoint to get the order status by the exchange-generated order ID.
 - **Implementation Status**: Not implemented

- **GET TRADES HISTORY BY ORDER ID**: Endpoint to get the trades history for a specific order.
 - **Implementation Status**: Not implemented

- **GET TRADES HISTORY BY TIMESTAMPS**: Endpoint to get the trades history for a given time range.
 - **Implementation Status**: Not implemented

- **CREATE ORDERS with client_order_id**: Endpoint to create new orders with a client-provided order ID.
 - **Implementation Status**: Not implemented

- **CANCEL ORDER BY client order id**: Endpoint to cancel an order by the client-provided order ID.
 - **Implementation Status**: Not implemented

@HalukG
Copy link

HalukG commented May 21, 2024

Hummingbot Spot Connector Integration Report

This report compares our internal BOT API schema with the Hummingbot required API endpoints.

Required Endpoints

Public REST Endpoints

  1. GET ACTIVE MARKETS
    Hummingbot Endpoint: /v0/markets
  • Bot API: /v0/markets
  • Description: Returns the list of markets information supported by GeniusYield DEX.

Comparison:

  • Request Parameters: None
  • Response Fields:
    • Hummingbot Requirement:
    [
      {
        "base_asset": "string",
        "market_id": "string",
        "target_asset": "string"
      }
    ] 
    
    • Bot API:
    [
      {
        "base_asset": "GYAssetClass",
        "market_id": "OrderAssetPair",
        "target_asset": "GYAssetClass"
      }
    ]
    

Conclusion: Compatible. Bot API provides the required fields base_asset, market_id, and target_asset with the correct types.

  1. GET ORDERBOOK SNAPSHOT
    Hummingbot Endpoint: /v0/order-books/{market-id}
  • Bot API: /v0/order-books/{market-id}
  • Description: Get order book for a specific market.

Comparison:

  • Request Parameters: None
    • Hummingbot Requirement: market-id (string)
    • Bot API: market-id (string)
  • Response Fields:
    • Hummingbot Requirement:
    {
      "bids": [
        {
          "price": "float",
          "quantity": "float"
        }
      ],
      "asks": [
        {
          "price": "float",
          "quantity": "float"
        }
      ],
      "timestamp": "ISO8601"
    }
    
    • Bot API:
    {
      "bids": [
        {
          "offer_amount": "float",
          "price": "float"
        }
      ],
      "asks": [
        {
          "offer_amount": "float",
          "price": "float"
        }
      ],
      "market_pair_id": "OrderAssetPair",
      "timestamp": "ISO8601"
    }
    

Conclusion: Compatible with minor adjustment. The fields offer_amount in Bot API correspond to quantity in the Hummingbot requirement. The market_pair_id field in Bot API can be ignored or mapped appropriately.

  1. PING ENDPOINT
    Hummingbot Endpoint: /v0/settings
  • Bot API: /v0/settings
  • Description: Get server settings such as network, version, and revision.

Comparison:

  • Request Parameters: None
  • Response Fields:
    • Hummingbot Requirement:
    {
      "status": "string"
    }
    
    • Bot API:
    {
      "network": "string",
      "version": "string",
      "revision": "string",
      "backend": "string"
    }
    

Conclusion: Compatible with additional data. Bot API provides more fields than required. The extra fields can be included without any issues.

Private REST Endpoints

  1. GET ACCOUNT BALANCE
    Hummingbot Endpoint: /v0/balances/{address}}
  • Bot API: /v0/balances/{address}
  • Description: Get token balances of an address.

Comparison:

  • Request Parameters:
    • Hummingbot Requirement: address (string)
    • Bot API: address (string)
  • Response Fields:
    • Hummingbot Requirement:
    {
      "currency": "string",
      "balance": "float"
    }
    
    • Bot API:
    {
      "lovelace": "string",
      "token": "string"
    }
    

Conclusion: Compatible with mapping. The lovelace and token fields in Bot API can be mapped to currency and balance.

  1. GET OPEN ORDERS
    Hummingbot Endpoint: /v0/order-books/{market-id}
  • Bot API: /v0/order-books/{market-id}
  • Description: Get open orders for a specific market.

Comparison:

  • Request Parameters:
    • Hummingbot Requirement: market-id (string)
    • Bot API: market-id (string)
  • Response Fields:
    • Hummingbot Requirement:
    {
      "order_id": "string",
      "price": "float",
      "quantity": "float",
      "status": "string"
    }
    
    • Bot API:
        {
      "output_reference": "GYTxOutRef",
      "price": "float",
      "offer_amount": "float",
      "owner_address": "GYAddressBech32",
      "nft_token": "GYAssetClass"
    }
    

Conclusion: Compatible with mapping. The output_reference can be used as order_id, and offer_amount can be used as quantity.

  1. CREATE ORDERS
    Hummingbot Endpoint: /v0/orders (POST)
  • Bot API: /v0/orders (POST)
  • Description: Create an order.

Comparison:

  • Request Parameters:
    • Hummingbot Requirement:
    {
      "symbol": "string",
      "side": "string",
      "type": "string",
      "quantity": "float",
      "price": "float"
    }
    
    • Bot API:
    {
      "offer_token": "GYAssetClass",
      "offer_amount": "GYNatural",
      "price_token": "GYAssetClass",
      "price_amount": "GYNatural",
      "start": "ISO8601",
      "end": "ISO8601"
    }
    

Conclusion: Conclusion: Compatible with mapping and additional data. Map offer_token and price_token to symbol, offer_amount to quantity, price_amount to price, and handle start and end as needed.

  1. CANCEL ORDER BY EXCHANGE ORDER ID
    Hummingbot Endpoint: /v0/orders (DELETE)
  • Bot API: /v0/orders (DELETE)
  • Description: Cancel order(s).

Comparison:

  • Request Parameters: None

    • Hummingbot Requirement:
    {
      "order_id": "string"
    }
    
    • Bot API:
    {
      "order_references": ["GYTxOutRef"]
    }
    
  • Response Fields:

    • Hummingbot Requirement:
    {
      "status": "string"
    }
    
    • Bot API:
    {
      "transaction": "GYTx",
      "transaction_fee": "GYNatural",
      "transaction_id": "GYTxId"
    }	
    

Conclusion: Compatible with additional data. Bot API's order_references can be mapped to order_id.

Summary

  • Fully Compatible: GET ACTIVE MARKETS, PING ENDPOINT, GET ACCOUNT BALANCE, GET OPEN ORDERS, CREATE ORDERS, CANCEL ORDER BY exchange_order_id
  • Minor Adjustments Needed:
    • GET ORDERBOOK SNAPSHOT: We need to rename offer_amount to quantity and map market_pair_id appropriately.
    • GET ACCOUNT BALANCE: We need to map lovelace and token to currency and balance.
    • CREATE ORDERS: We need to map offer_token and price_token to symbol, offer_amount to quantity, price_amount to price, and handle start and end.
    • CANCEL ORDER BY exchange_order_id: We need to map order_references to order_id.

Based on this comparison, current Bot API schema can be used to build the Hummingbot Spot connector with minor adjustments for field mappings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority - High Issue has high priority and has to be worked, if no blocker issues are being worked on. T-Shirt size - Medium High-Level effort estimation. Category "medium effort". Task A feature request or general task involving code changes.
Projects
None yet
Development

No branches or pull requests

2 participants