In a free-form chat interface, a user may give a trade intent message with insufficient information to carry out an actual trade.
e.g.
Buy me some $MOTHER"
When it comes to executing a trade, the following information are needed and they should be precise
Exchange and trading pair
Amount
Price and order type (limit or market)
To make things more complicated, some of these information can be inferred. e.g.
If the user is only connected to one exchange, we can safely assume he wants to just that exchange;
If the user wants to buy or sell a {token symbol} rather than a trading pair, and the biggest {token symbol} pairs on the selected exchange is {token symbol}-USD or {token symbol}-USDT, we can safely assume he wants to trade on the USD or USD stablecoin pair;
If the user wants to trade without specifying an order type, we can safely assume he wants immediate execution and thus a market-like order (in crypto we usually do this with a limit order that crosses the order book, to control slippage, however);
The user may not have enough balance on his exchange to carry out a proposed trade.
This means the system prompt and logic flow needs to be aware of the current Hummingbot settings (e.g. which exchange it is connected to); the user's current portfolio, and finally, keep following up with the user until it has enough information to form a trade command.
Finally, if the user starts to chat about other non-trading things, or wants to bail out from completing a trading order - the system prompt should allow for bailing out from the trading order mode and going back to the general chat interface.
What
Craft a custom system prompt that satisfies the requirements above;
Draft an API spec on how the chat agent interacts with trading backend (e.g. via MQTT) and the rest of the chat system;
Craft a test script with a number of different test cases to demonstrate the system prompt works.
Why
In a free-form chat interface, a user may give a trade intent message with insufficient information to carry out an actual trade.
e.g.
When it comes to executing a trade, the following information are needed and they should be precise
To make things more complicated, some of these information can be inferred. e.g.
This means the system prompt and logic flow needs to be aware of the current Hummingbot settings (e.g. which exchange it is connected to); the user's current portfolio, and finally, keep following up with the user until it has enough information to form a trade command.
Finally, if the user starts to chat about other non-trading things, or wants to bail out from completing a trading order - the system prompt should allow for bailing out from the trading order mode and going back to the general chat interface.
What