feat(tide-chart): wallet connect + gTrade trading integration#23
feat(tide-chart): wallet connect + gTrade trading integration#23RenzoMXD wants to merge 4 commits intoentrius:mainfrom
Conversation
|
@RenzoMXD unfortunately, you're not available to take part in issue competition since you're not in bronze+ tier |
|
@e35ventura Can you review my PR please? Thanks. |
|
@MkDev11 Don't worry. I am already in Bronze Tier. |
|
I've updated the original issue (#14) to expand the scope to all assets supported by the Synth API (Crypto, Gold, and Equities). A key requirement for the final integration is that the UI should never allow a user to submit a transaction that gTrade wouldn't accept. This means the interface needs to prevent inputs or submissions that would trigger protocol reverts—such as leverage mismatches, insufficient position sizes, or exceeding maximum leverage for specific asset classes. The goal is to catch these at the UI level before the transaction is ever sent. |
|
@ventura-oss Thanks for your reply. I am going to fix right now. |
|
@ventura-oss I have updated the code based on your updated issue. Here's what I've newly fixed. 1. Trade buttons on ALL assetsEvery row in the table should have a Trade button — including BTC, ETH, SOL, and XAU (previously only equities had them). 2. Validation guardTry entering collateral that makes position size < $1,500 — the submit button should stay disabled with an error message. 3. Wallet connectClick Connect Wallet to test MetaMask integration (requires MetaMask in your browser). |
|
Please make sure you can place and monitor trades. Also, please upload an updated demo video that showcases the tool working end-to-end, opening and closing a trade |
|
@e35ventura @ventura-oss Thanks for your feedback. I will fix right now. |
|
@e35ventura Sorry for late. I just updated code. I will push my code in 30 minutes. |
6b02f34 to
959b622
Compare
Screencast.from.2026-03-10.19-03-50.webm |
959b622 to
ff6a967
Compare
|
@e35ventura @ventura-oss I've addressed comments. Please let me know if anything else is needed. Thanks. |
|
@ventura-oss @e35ventura Thanks for your review. Here is my opinion of bugs in 24.
|
|
thank you for bringing this to my attention. |

Summary
Closes #14
Adds MetaMask wallet connection and direct equity trading via gTrade (Gains Network) on Arbitrum to the Tide Chart dashboard — completing the forecast-to-execution loop without leaving the app.
Demo
What Changed
tools/tide-chart/main.pyFrontend CDN
Wallet Connection (JS — WalletManager)
window.ethereum/ EIP-1193 providerwallet_switchEthereumChain) with auto-add fallback (wallet_addEthereumChain)accountsChangedandchainChangedeth_accountsTrading Panel (HTML + CSS + JS)
Trade Execution (JS — GTradeManager)
balanceOf()approve()withMaxUint256ethers.parseUnits)15000)openPrice: 0for market ordersopenTrade()call toGNSMultiCollatDiamondcontract on ArbitrumTable Enhancement
--placeholder for non-tradeable assets: BTC, ETH, SOL, XAUrank-tbody(survives table refreshes)Toast Notification System
All CSS matches existing dark theme: CSS variables, IBM Plex fonts, gold accent, responsive at 768px breakpoint.
tools/tide-chart/tests/test_tool.py10 new tests:
test_dashboard_has_wallet_buttonid="wallet-btn"and "Connect Wallet" text presenttest_dashboard_has_trade_panelid="trade-panel",trade-form-grid,trade-connect-overlaypresenttest_dashboard_has_ethers_cdncdn.jsdelivr.nettest_dashboard_has_trade_buttons_for_equitiesdata-asset="SPY/NVDA/TSLA/AAPL/GOOGL"presenttest_dashboard_no_trade_buttons_for_cryptodata-asset="BTC/ETH/SOL/XAU"NOT presenttest_dashboard_has_toast_containerid="toast-container"presenttest_dashboard_has_gtrade_configGTRADE_CONFIG, contract addresses, chain ID in JStest_dashboard_has_wallet_managerhandleWalletConnect,switchToArbitrum, event handlerstest_dashboard_has_trade_executionsubmitTrade,openTradePanel, ABI constantstest_table_rows_have_trade_columntrade-cell-btnfor equities,trade-cell-nafor cryptotools/tide-chart/README.mdgTrade Contract Details
GNSMultiCollatDiamond—0xFF162c694eAA571f685030649814282eA457f1690xaf88d065e77c8cC2239327C5EDb3A432268e5831Edge Cases Handled (16 total)
wallet_addEthereumChain), chain changed away from Arbitrum (warning + disable trading)Security
Test Plan
Demo Video
Screencast.from.2026-03-09.13-45-03.webm
Not connected wallet:
Screencast.from.2026-03-09.13-52-13.webm