Inspiration

We recognized the need for the idea when realizing that, in emergency situations like earthquakes, people can find the news on X oftentimes significantly before any information reaches the mainstream media. So, we decided to replace the mainstream media experience with transparent usage of truthful information found on X posts. To that goal, we built the XTerminal.

What it does

With an interface combining X and the Bloomberg terminal, XTerminal recommends users topics based on their location and allows them to open tabs on topics of interest. For each topic, the terminal displays real-time summaries corresponding to bars of time intervals that the user can choose. This mimics real-time update features on the Bloomberg terminal. In addition, for each topic, the XTerminal provides a digest article describing related current events posted about on X and viewpoints on X regarding them. This feature is a first step in using X to replace the mainstream media.

How we built it

We used Svelte for the frontend and primarily Python on the backend. We implemented adaptors for the X API V2 and xAI API that fit our product needs. For the X API endpoints, we added rate limiting to limit the number of requests made in short periods of time. We added a similar rate limiting mechanism for the xAI API endpoint adapter.

When we query the X API for the topics in question, we clean the response into a format that we can use with the xAI API. Using Grok’s reasoning capabilities, we validate the posts and parse out spam or scams. Then, we use Grok to generate a summary for each time-duration that is necessary at the current time – the user can change the time duration of bars they would like to see on the front-end. In addition, we use Grok to update the digest article for the topic based on the recent news. We then also use that information to build an X sentiment signal on the topic for the point-in-time, allowing us to maintain a chart showing historical sentiment on X regarding the query. Using Grok’s advanced understanding and intelligence, we run a complete news aggregator delivering real-time updates and digests on any topic one could think of.

Challenges we ran into

Streamlining different aggregation resolutions simultaneously to allow a seamless transition between bar duration was a challenge. To solve this challenge, we chose to maintain a stream of tweets related to the topics and then aggregate update bars for each timescale based on that same sequence of posts.

Another challenge was figuring out rate-limiting strategies for our API adapters. After some experimentation, we settled on rate limits that were both useful and allowed a seamless user experience.

Reducing latency was also a challenge, as our application involved backend calls to both the X API and the xAI API. As part of reducing latency, we made choices such as pre-generating bar strategies for each timescale resolution. In addition, we utilized caching and stored the results so that we do not have to call the xAI API needlessly multiple times.

Accomplishments that we're proud of

We are proud that we were able to collect real-time information from X in a manner that delivers updates and critical summaries to users of multiple topics at once in a way never before possible. We really believe this would be a feature that we would be users of, and that it could benefit many people greatly. We are also proud of the design, in which we focused on maintaining efficiency of the backend and a positive user experience. We also made the application in a manner that mirrors X’s dark-mode looks, tying it neatly within the X ecosystem.

What we learned

We learned how to leverage Grok’s capabilities in combination with the X API. We also learned how to use those APIs in a low-latency setting requiring real-time results.

What's next for XTerminal

We hope to win in the hackathon and possibly make this into a real feature for X in the future! We think it's really something we would love to have ourselves, so it would be fun to introduce to X, especially along with Grokipedia. We also think that it would be a great feature with increased limits for premium users, such as traders who would be glad to use it for real-time sentiment updates and digests.

Built With

Share this project:

Updates