project-serum / serum-dex-ui Goto Github PK
View Code? Open in Web Editor NEWExample implementation of a UI for the Serum DEX
License: Other
Example implementation of a UI for the Serum DEX
License: Other
.\src\components\TradingView\index.tsx
Cannot find file '../../charting_library' in '.\src\components\TradingView'.
Hello in development mode , the charting library is working when i build and deploy to my server ( nginx+ubuntu). I get this errror
TypeError: Cannot read properties of undefined (reading 'UDFCompatibleDatafeed')
Hi all,
After following the steps in readme and have been adding the folders charting_library datafeeds to /src and /public i receive errors on building.
What did i do wrong here ?
Failed to compile.
/Applications/XAMPP/xamppfiles/htdocs/serum-dex-ui/src/components/TradingView/index.tsx
TypeScript error in /Applications/XAMPP/xamppfiles/htdocs/serum-dex-ui/src/components/TradingView/index.tsx(52,11):
Property 'container' is missing in type '{ symbol: string; datafeed: any; interval: Nominal<string, "ResolutionString">; container_id: string | undefined; library_path: string; locale: "en"; disabled_features: string[]; ... 7 more ...; theme: "Dark"; }' but required in type 'ChartingLibraryWidgetOptions'. TS2741
50 |
51 | React.useEffect(() => {
52 | const widgetOptions: ChartingLibraryWidgetOptions = {
| ^
53 | symbol: findTVMarketFromAddress(
54 | market?.address.toBase58() || '',
55 | ) as string,
a6d753f added a SWAP link at the top of the menu, but it points to an externally hosted swap page:
serum-dex-ui/src/components/TopBar.tsx
Line 48 in a6d753f
Hi. The first 3 transactions succeed and the I receive this error when creating the Market ID.
I cannot find anything in the FAQ?
Description
When accessing the Balances page on a heavily-traded Solana account, the following occurs and all of the rows of Balances disappear. Additionally, the "Settle All Funds" button doesn't work.
Error: failed to get info about accounts 7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU, Cpnxh12vMv9xWRxe1TnxZC34KWyftP7JHacjZFTR3dDk, MAPS41MDahZ9QdKXhVa4dWB9RuyfV4XqhyAZ8XcYepb, 8S94Ze8WWHGiFMUx28LwEviwgHpYD64FkTWVxd5kxDhu, 3GECTP7H4Tww3w8jEPJCJtXUtXxiZty31S9szs84CcwQ,
(continued ...)
7ncCLJpP3MNww17LW8bRvx8odQQnubNtfNZBL5BgAEHW, 6ry4WBDvAwAnrYJVv6MCog4J8zx6S3cPgSqnTsDZ73AR, 8sxtSswmQ7Lcd2GjK6am37Z61wJZjA2SzE7Luf7yaKBB, 262cQHT3soHwzuo2oVSy5kAfHcFZ1Jjn8C1GRLcQNKA3, BXXkv6z8ykpG1yuvUDPgh732wzVHB69RnB9YgSYh3itW: Too many inputs provided; max 100
at getMultipleSolanaAccounts (send.tsx:925)
at async FetchLoopInternal.getAllMintInfo [as fn] (tokens.tsx:194)
at async FetchLoopInternal.refresh (fetch-loop.tsx:104)
Proposed Solution
If >= 100 accounts are being looked up, break it up into chunks of 100 or less accounts to query the API. For each chunk of 100 accounts or less, query getMultipleAccounts, then collect the results into a single collection.
When I leave https://dex.projectserum.com/#/ open for longer periods - which is pretty usual for my trading - after a while the page logo blow out in size.
I then have to reload, and re-enter the password etc .. I'm sure it shouldn't be doing that.
Here's a before and after:
Before:
After:
After a page refresh it's back to normal.
I thought it might be an svg issue, but the logo is a png.
if i refresh the https://dex.projectserum.com/#/ page while wallet is connected wallet gets disconnected even if i checked keep wallet unlocked, it also close the sollet.io window which says "Please keep this window open in the background."
`TypeScript error in /home/ec2-user/serum-dex-ui/src/components/TradingView/index.tsx(52,11):
Property 'container' is missing in type '{ symbol: string; datafeed: any; interval: Nominal<string, "ResolutionString">; container_id: string | undefined; library_path: string; locale: "en"; disabled_features: string[]; ... 7 more ...; theme: "Dark"; }' but required in type 'ChartingLibraryWidgetOptions'. TS2741
50 |
51 | React.useEffect(() => {
52 | const widgetOptions: ChartingLibraryWidgetOptions = {
| ^
53 | symbol: findTVMarketFromAddress(
54 | market?.address.toBase58() || '',
55 | ) as string,
error Command failed with exit code 1.
`
I have added the correct directories. Added import { TVChartContainer } from '../../src/components/TradingView';
to TradePage.tsx, deleted the line from tsconfig.json, uncommented the `<script src="%PUBLIC_URL%/datafeeds/udf/dist/polyfills.js"></script>
Received this report from a user:
just got dinged 48 times for .000005 sol within 6 minutes (not making any trades)
Light on details other than that.
Further reports: This is caused by auto-settle being enabled by sollet/phantom/similar.
Hello, can someone help me. I have numerous orders on the Serum dex that I want to change the prices on and when I hit the Cancel button in Open Orders it just sits there Refreshing itself forever. I've been using my Cell phone, placing orders usually works fine, converting works most of the time, I just cant cancel any and it has alot of my money tied up.
Yesterday on the trading page charts were taking about 2 minutes to load, today the charts are not loading at all. I have checked on three machines, all show the same issue.
this can cause pretty bad confusion for users who don't know the state of their order. revisit commitment length for the UI
We prefer to run the UI without adding trading view charts (for licensing reasons amongst others), recent versions don't seem to compile anymore. I am not sure if this intentional (the readme hints that adding charts is optional). When trying to compile we get:
$ REACT_APP_GIT_SHA=`git rev-parse --short HEAD` REACT_APP_GIT_DATE=`git log -1 --date=format:"%Y/%m/%d" --format="%ad"` craco build
Creating an optimized production build...
Failed to compile.
./src/components/TradingView/index.tsx
Cannot find file '../../charting_library' in './src/components/TradingView'.
error Command failed with exit code 1.```
quite a few people misunderstand what Add Market
means in the UI and they end up creating a new market instead of Adding a market to UI market list
Renaming it to Create New Market
will be better indicative of what it does imo
Potentially merge this repo at some point with https://github.com/project-serum/serum-js, using yarn
workspaces + lerna
.
When proving LP/Market on serum I encountered error transaction? Is there any explanation about that?
I did some investigation into the Balances page, which is always broken for me and slams the RPC node until it rate limits you.
Problem: A single load of the "Balances" page from my main wallet, hit the projectserum public rpc node about 400 times in 2 seconds before getting rate limited. These are 95% individual calls to getAccountInfo, should be replaced with getMultipleAccounts asap. It actually hit ~600 requests in the total page load, but the limiting started at ~400 in 2s.
Addressing this could, in my opinion, immensely improve UX. And maybe reduce load on projectserum rpc's by an order of magnitude. The orders page has similar behavior.
Potential solution: Batch all these single getAccountInfo
calls from the Balances page into multiple getMultipleAccounts
calls, instead.
or a new button cancel and settle (batch transaction).. i don't get the point of keeping Unsettled amount on that pair once i cancel the order.
We should document how to run this on a local network, preferably with a simple script to build and deploy everything.
Getting this repo working locally give me the following errors when hitting the | serum-api.bonfida.com
api:
❯ curl 'https://serum-api.bonfida.com/tv/symbol_info?group=NYSE' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: http://localhost:3001/' -H 'Origin: http://localhost:3001' -H 'DNT: 1' -H 'Connection: keep-alive' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: cross-site' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' -H 'TE: trailers'
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Access denied | serum-api.bonfida.com used Cloudflare to restrict access</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/main.css" type="text/css" media="screen,projection" />
<script defer src="https://api.radar.cloudflare.com/beacon.js" type="c81ca16b84e117f5b3c9a3c0-text/javascript"></script>
</head>
<body>
<div id="cf-wrapper">
<div class="cf-alert cf-alert-error cf-cookie-error hidden" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
<div id="cf-error-details" class="p-0">
<header class="mx-auto pt-10 lg:pt-6 lg:px-8 w-240 lg:w-full mb-15 antialiased">
<h1 class="inline-block md:block mr-2 md:mb-2 font-light text-60 md:text-3xl text-black-dark leading-tight">
<span data-translate="error">Error</span>
<span>1020</span>
</h1>
<span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">Ray ID: 6a87fb336cb8f2f9 •</span>
<span class="inline-block md:block heading-ray-id font-mono text-15 lg:text-sm lg:leading-relaxed">2021-11-03 19:24:10 UTC</span>
<h2 class="text-gray-600 leading-1.3 text-3xl lg:text-2xl font-light">Access denied</h2>
</header>
<section class="w-240 lg:w-full mx-auto mb-8 lg:px-8">
<div id="what-happened-section" class="w-1/2 md:w-full">
<h2 class="text-3xl leading-tight font-normal mb-4 text-black-dark antialiased" data-translate="what_happened">What happened?</h2>
<p>This website is using a security service to protect itself from online attacks.</p>
</div>
</section>
<div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
<p class="text-13">
<span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">6a87fb336cb8f2f9</strong></span>
<span class="cf-footer-separator sm:hidden">•</span>
<span class="cf-footer-item sm:block sm:mb-1"><span>Your IP</span>: 110.174.193.47</span>
<span class="cf-footer-separator sm:hidden">•</span>
<span class="cf-footer-item sm:block sm:mb-1"><span>Performance & security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
</div>
</div>
</div>
<script type="c81ca16b84e117f5b3c9a3c0-text/javascript">
window._cf_translation = {};
</script>
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="c81ca16b84e117f5b3c9a3c0-|49" defer=""></script><script defer src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"rayId":"6a87fb336cb8f2f9","version":"2021.10.0","r":1,"token":"a552bc24626241e78283539070a9ffa4","si":100}'></script>
</body>
</html>
Is there backend code anywhere so I can run my own matching API?
On https://dex.projectserum.com/
Top Ribbon-> Learn -> SRM FAQ; points to : https://projectserum.com/srm-faq and page results in
How can see the ALL Trade History of pending orders and transaction record on dex?
NOT "Recent" Trade History
I think it can export or display all the trade history
Is a necessary function of a trading platform
Hi guys,
I bought RAY on Serum by trading USDT the transaction went through as my USDT balance has reduced, however I can’t see RAY balance in the Serum wallet so as to settle the funds and move it to sollet wallet .. it’s been couple of days now ..Any solution would be appreciated
Thanks
It doesn't work against a local network. Minimally the app should use the RPC node directly when the network is localhost.
I'm hosting a mirror of this UI now ( https://serum-mirror.folkvang.io/ ), I will try to keep it up to date as time goes on while also looking at the code changes. Using a version system or tags or a changelist would make that a lot easier :)
When try to convert from SOL to USDT getting the following
Timed out awaiting confirmation on transaction
HELP
I am selling my FTR token when placing order notification pop up saying with heading error placing order and below subheading with system program error can anyone please solve this issue.
1.there is no scroll bar or search button to change the token
2.https://dex.projectserum.com/#/ ---> would be cool to see something like https://dex.projectserum.com/SRM-USDT
3.no recent trade history , i should have this one but it disappeared
https://twitter.com/sebytza05/status/1300928773802659841/photo/1
4.no recent market trades, would be fine to see the last one even if the last trade was hours ago
Getting the API data from bonfida is giving CORS errors on the live open project serum DEX but also local development versions.
https://openserum.ch/dex/#/market/ByRys5tuUWDgL73G8JBAEfkdFf8JWBzPBDHsBVQ5vbQA
When loading Orders and Balances alot of errors pop up on the screen like below. Eventually Orders and balances show on the screen but the errors are unnessary.
Error loading all market
failed to get info about account 74Ciu5yrste8TFTHvQuEVbFZJrbnCMRoohBK33NNiPtv: TypeError: Failed to fetch
I'm trying to trade a newish coin, SUNNY (mint=SUNNYWgPQmFxe9wTZzNK7iPnJ3vYDrkgnxJRJm1s3ag).
I can see it's trading quite a bit of volume, e.g. it appears on the top lists of https://coinmarketcap.com/exchanges/serum-dex/ and https://serumpulse.com/main/home
I can even do trades using symmetry.fi's swap interface (which says it just routes to Serum) so I know there's a market for it!
However, it doesn't show up in the market dropdown (the one that defaults to SOL/USDC). Nor is it searchable (either as SUNNY or as the mint address) in the search to the left of the environment selector.
If I try to "add market" it seems like I can do that, but it will charge me ~2 SOL to create the market (which I don't want to do, the market already exists).
transaction failed because not enough balance
https://explorer.solana.com/tx/6389SRe6v2h2MCvkeJrd4mZDLbdoiooKCcKqTL4KNsZTFupEa1oLDWwyegSsSbBdMi7ki8MJrKdqUXivRNXLNNMF
please first check the balance when click on buy/sell , then a pop up error , not worth to pay fees for nothing..
On https://dex.projectserum.com/
Top Ribbon-> Learn -> Dex List; points to : https://serum-academy.com/en/dex-list/ and page fails to load
I mentioned this in another PR (project-serum/serum-ts#108) but thought I'd ask here too.
From what I see, the Dex UI ends up accessing the _decoded.asks and _decoded.bids and then set up a listener using connection.onAccountChange() on the public key of the ask/bid accounts.
Why access market._decoded.asks
and not market.asksAddress
? The latter seems cleaner. An object like _decoded
seems less stable of an API to build on (_underscore
is usually convention for private interfaces)
Are there any reasons that I am missing?
I'm looking at the api docs and the candles seem to be broken, I get a 404 messages trying to use the example link
candles/BTCUSDC?resolution=3600 yields 404 page not found.
On https://dex.projectserum.com/
Top Ribbon-> Learn -> Adding A Market; points to : https://serum-academy.com/en/add-market/ and page fails to load
Deployment on heroku fails with the below error:
2020-12-04T16:23:44.892498+00:00 heroku[web.1]: State changed from crashed to starting
2020-12-04T16:24:04.171691+00:00 heroku[web.1]: Starting process with command `npm start`
2020-12-04T16:24:07.586564+00:00 app[web.1]:
2020-12-04T16:24:07.586605+00:00 app[web.1]: > [email protected] start /app
2020-12-04T16:24:07.586606+00:00 app[web.1]: > craco start
2020-12-04T16:24:07.586606+00:00 app[web.1]:
2020-12-04T16:24:10.119915+00:00 app[web.1]: /app/node_modules/@craco/craco/lib/plugin-utils.js:29
2020-12-04T16:24:10.119937+00:00 app[web.1]: throw new Error(
2020-12-04T16:24:10.119938+00:00 app[web.1]: ^
2020-12-04T16:24:10.119938+00:00 app[web.1]:
2020-12-04T16:24:10.119939+00:00 app[web.1]: Error: Found an unhandled loader in the production webpack config: /app/node_modules/style-loader/index.js
2020-12-04T16:24:10.119940+00:00 app[web.1]:
2020-12-04T16:24:10.119941+00:00 app[web.1]: This error probably occurred because you updated react-scripts or craco. Please try updating craco-less to the latest version:
2020-12-04T16:24:10.119941+00:00 app[web.1]:
2020-12-04T16:24:10.119941+00:00 app[web.1]: $ yarn upgrade craco-less
2020-12-04T16:24:10.119942+00:00 app[web.1]:
2020-12-04T16:24:10.119942+00:00 app[web.1]: Or:
2020-12-04T16:24:10.119942+00:00 app[web.1]:
2020-12-04T16:24:10.119943+00:00 app[web.1]: $ npm update craco-less
2020-12-04T16:24:10.119943+00:00 app[web.1]:
2020-12-04T16:24:10.119944+00:00 app[web.1]: If that doesn't work, craco-less needs to be fixed to support the latest version.
2020-12-04T16:24:10.119945+00:00 app[web.1]: Please check to see if there's already an issue in the FormAPI/craco-less repo:
2020-12-04T16:24:10.119945+00:00 app[web.1]:
2020-12-04T16:24:10.119945+00:00 app[web.1]: * https://github.com/FormAPI/craco-less/issues?q=is%3Aissue+webpack+unknown+rule
2020-12-04T16:24:10.119946+00:00 app[web.1]:
2020-12-04T16:24:10.119946+00:00 app[web.1]: If not, please open an issue and we'll take a look. (Or you can send a PR!)
2020-12-04T16:24:10.119946+00:00 app[web.1]:
2020-12-04T16:24:10.119947+00:00 app[web.1]: You might also want to look for related issues in the craco and create-react-app repos:
2020-12-04T16:24:10.119947+00:00 app[web.1]:
2020-12-04T16:24:10.119947+00:00 app[web.1]: * https://github.com/sharegate/craco/issues?q=is%3Aissue+webpack+unknown+rule
2020-12-04T16:24:10.119948+00:00 app[web.1]: * https://github.com/facebook/create-react-app/issues?q=is%3Aissue+webpack+unknown+rule
2020-12-04T16:24:10.119948+00:00 app[web.1]:
2020-12-04T16:24:10.119948+00:00 app[web.1]: at throwUnexpectedConfigError (/app/node_modules/@craco/craco/lib/plugin-utils.js:29:11)
2020-12-04T16:24:10.119948+00:00 app[web.1]: at throwError (/app/node_modules/craco-less/lib/craco-less.js:14:5)
2020-12-04T16:24:10.119949+00:00 app[web.1]: at /app/node_modules/craco-less/lib/craco-less.js:119:7
2020-12-04T16:24:10.119950+00:00 app[web.1]: at Array.forEach (<anonymous>)
2020-12-04T16:24:10.119950+00:00 app[web.1]: at Object.overrideWebpackConfig (/app/node_modules/craco-less/lib/craco-less.js:51:11)
2020-12-04T16:24:10.119950+00:00 app[web.1]: at overrideWebpack (/app/node_modules/@craco/craco/lib/features/plugins.js:42:40)
2020-12-04T16:24:10.119951+00:00 app[web.1]: at /app/node_modules/@craco/craco/lib/features/plugins.js:64:29
2020-12-04T16:24:10.119951+00:00 app[web.1]: at Array.forEach (<anonymous>)
2020-12-04T16:24:10.119951+00:00 app[web.1]: at applyWebpackConfigPlugins (/app/node_modules/@craco/craco/lib/features/plugins.js:63:29)
2020-12-04T16:24:10.119952+00:00 app[web.1]: at mergeWebpackConfig (/app/node_modules/@craco/craco/lib/features/webpack/merge-webpack-config.js:67:30)
2020-12-04T16:24:10.159939+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-12-04T16:24:10.160498+00:00 app[web.1]: npm ERR! errno 1
2020-12-04T16:24:10.171269+00:00 app[web.1]: npm ERR! [email protected] start: `craco start`
2020-12-04T16:24:10.171584+00:00 app[web.1]: npm ERR! Exit status 1
2020-12-04T16:24:10.172976+00:00 app[web.1]: npm ERR!
2020-12-04T16:24:10.173259+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2020-12-04T16:24:10.175087+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-12-04T16:24:10.200505+00:00 app[web.1]:
2020-12-04T16:24:10.205072+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-12-04T16:24:10.205233+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2020-12-04T16_24_10_176Z-debug.log
2020-12-04T16:24:10.297369+00:00 heroku[web.1]: Process exited with status 1
2020-12-04T16:24:10.353145+00:00 heroku[web.1]: State changed from starting to crashed
I was able to run the UI but I keep running into CORS issues since I am trying to call the serum API from localhost. Any idea on how to properly fix that (for people that will be running the serum UI and calling the serum dex).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.