Inspiration

Recently lots of predictions markets have been in the trend creating a brand new genre of marketplaces where people can trade the likelihood normal events like stocks. Services such as Kalshi and Polymarket mostly operate on a binary system for market entities, we decided why not go to the exact source. Thus we came up with Trelevant: Track whats Relevant

What it does

Trelevant is a live paper marketplace for different "attention assets." For example, it has 8 different tickers ranging from Bryce Young to Sam Altman. There is a marketplace with the multiple tickers and the order-book prices. Clicking on a specific entity allows you to see prices from at most 3 months ago. Users can click place BUY/SELL orders, as the price updates based on the new data.

How we built it

For each ticker there is a specific "attention-score formula" that is driven by google trends api (Serp) data which inherently affects the price of the stocks.

Backend (AWS)

AWS Lambda

  • Ingestion of attention signals based on the Serp API
  • Calculating the next price point (pricing engine)
  • Backfilling price history data (for the past 3 months)
  • Create API endpoints used by the frontend UI to fetch quotes and price history
  • Created market making bots which serve to provide liquidity to ensure quick buying and selling which is crucial for great user experience

DynamoDB (Streaming) Tables

  • Entities (metadata + current pricing quote)
  • Price history (time-series data)
  • Order / trades (paper execution)
  • Portfolio / balances (to calculate individual profit & loss; used in the leaderboard) Amazon EventBridge
  • Used to schedule lambda function calls

Frontend

  • Next.js web app with a dark minimalist design
  • Market grid UI, entity dashboards, buy/sell modals, time-range controls

Challenges we ran into

We initially wanted to use Amazon Timestream which is used for time series data that we're trying to compute, however for the hackathon participant AWS account it was not allowed to be used.

Serp API free trial only covers 250 api calls, we minimized the number of calls by batches our entities into two calls so 4 entities in one api call. This gave us better relative data and allowed for more accurate pricing

Adding backfilled data for the 3 month sources we ran into the problem of different resolutions, the 3 month data had a resolution of 1 hour intervals whereas our live pricing updates every 1 hour.

Accomplishments that we're proud of

None of us had used AWS previously so it was a big challenge for us to navigate the AWS console however, online documentation was a huge help (and some youtube videos) We are really proud of our lambda functions because it runs the entire backend such as pricing engine + buy/sell logic

What we learned

How to use Lambda functions and DynamoDB to store and large amounts of data concurrently Debugging the Serp API for google trends data was a good refresher on API structures and headings

What's next for Trelevant

Trelevant in the future wants to add a feature which allows users to add their own entities to the marketplace. Additionally adding more data sources not just the Google web search api, things such as X, reddit, wikipedia clicks are all ideas for the future.

Built With

Share this project:

Updates