We’re creating the following architecture for v0 -

Screenshot 2025-08-29 at 1.31.26 AM.png

Websocket stream

We need to subscribe to binance from the following ws stream -

https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests

You are only allowed to get the trade stream. The latest trade represents the current price of the asset. Do not use the klines api. You are supposed to create the klines on your side.

The candle should be made based on the current price on the exchange.

Screenshot 2025-08-29 at 12.15.24 AM.png

<aside> 💡

Ideally try to get atleast 3 assets from binance. Bonus - Try to get the price of US equities (https://polygon.io/)

</aside>

Spread

We need to create a spread of 1% on the platform.

Initial balance

Each user will be given an initial balance of 5000 usd

Decimal points

Do not store any floating points on the backend. Only integers should be stored.

If you want to store the price of SOL, it shouldn’t be stored as 211.11, it should be stored as 211110000 and decimals as 6

Leverage.

Allow users to leverage 5x, 10x, 20x, 100x

4 main functionalities

  1. Buy without leverage