Open 4TT1L4 opened 1 month ago
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
This report compares our internal BOT API schema with the Hummingbot required API endpoints.
/v0/markets
/v0/markets
Comparison:
[
{
"base_asset": "string",
"market_id": "string",
"target_asset": "string"
}
]
[
{
"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.
/v0/order-books/{market-id}
/v0/order-books/{market-id}
Comparison:
market-id
(string)market-id
(string){
"bids": [
{
"price": "float",
"quantity": "float"
}
],
"asks": [
{
"price": "float",
"quantity": "float"
}
],
"timestamp": "ISO8601"
}
{
"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.
/v0/settings
/v0/settings
Comparison:
{
"status": "string"
}
{
"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.
/v0/balances/{address}}
/v0/balances/{address}
Comparison:
address
(string)address
(string){
"currency": "string",
"balance": "float"
}
{
"lovelace": "string",
"token": "string"
}
Conclusion: Compatible with mapping. The lovelace
and token
fields in Bot API can be mapped to currency
and balance
.
/v0/order-books/{market-id}
/v0/order-books/{market-id}
Comparison:
market-id
(string)market-id
(string){
"order_id": "string",
"price": "float",
"quantity": "float",
"status": "string"
}
{
"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
.
/v0/orders
(POST)
/v0/orders
(POST)Comparison:
{
"symbol": "string",
"side": "string",
"type": "string",
"quantity": "float",
"price": "float"
}
{
"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.
/v0/orders
(DELETE)
/v0/orders
(DELETE)Comparison:
Request Parameters: None
{
"order_id": "string"
}
{
"order_references": ["GYTxOutRef"]
}
Response Fields:
{
"status": "string"
}
{
"transaction": "GYTx",
"transaction_fee": "GYNatural",
"transaction_id": "GYTxId"
}
Conclusion: Compatible with additional data. Bot API's order_references
can be mapped to order_id
.
offer_amount
to quantity
and map market_pair_id
appropriately.lovelace
and token
to currency
and balance
.offer_token
and price_token
to symbol
, offer_amount
to quantity
, price_amount
to price
, and handle start
and end
.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
TODO:
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: