Conversation
…ions (69b492ebd8b441091fd057e0)
✅ Deploy Preview for pirc-101 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 View agent run: https://app.netlify.com/projects/pirc-101/agent-runs/69b492ebd8b441091fd057e0
🤖 Agent: Claude
💬 Prompt: Now, let it react based on warehouse information, attract prices from platforms and exchanges, and display actual transactions to begin displaying transactions in a real way.
✅ Result: The PiRC-101 dashboard was transformed from a simulation-based display to a live, real-data trading dashboard that fetches actual prices, transactions, and order book data from OKX and MEXC exchanges.
Previously, the dashboard generated random/simulated prices and fake transaction data using
Math.random()on a 3-second interval. There was no connection to real exchange APIs, and the transaction explorer showed fabricated hashes and amounts.Three Netlify Functions were created to serve as API proxies for real exchange data:
netlify/functions/prices.js— Fetches real-time PI/USDT ticker data from both OKX and MEXC public APIs, including 24-hour price changes, highs, lows, and trading volume. It also retrieves 1-minute candlestick (kline) data from MEXC for the live chart. An aggregated average price across both exchanges is computed.netlify/functions/trades.js— Fetches the 15 most recent actual trades from both OKX and MEXC, returning real trade data including price, quantity, buy/sell side, and timestamps. Trades are merged and sorted by time.netlify/functions/orderbook.js— Fetches real order book (depth) data from both exchanges, computing warehouse/inventory metrics: best bid, best ask, spread, spread percentage, total bid/ask volume, and a buy pressure indicator that reflects real market supply/demand dynamics.The frontend (
index.html) was completely rewritten to consume these real APIs:A
netlify.tomlconfiguration file was added to define the functions directory and build settings. All API calls usePromise.allSettledfor resilience — if one exchange is unavailable, the dashboard continues to work with data from the other.