├── .dccache ├── .gitignore ├── LICENSE ├── README.md ├── assets ├── Xposure.png └── buildspace-logo.png ├── next.config.js ├── package-lock.json ├── package.json ├── pages ├── _app.js ├── _document.js ├── api │ └── generate.js ├── index.js └── styles.css ├── public ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── image2vector.svg └── site.webmanifest └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | 38 | .env -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 0xPeterPan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Xposure 2 | 3 | ### Welcome to the new age of AI 👋 4 | This is the starter for the [build your own AI writing assistant w/ GPT-3] project. 5 | 6 | ### Automated Crypto Trading Signals Powered by GPT-3 7 | 8 | Create an automated daily trading signals to help traders optimize their crypto trading strategies and maximize their profits. 9 | 10 | This would analyze the market and generate signals based on the current market conditions. It would then use GPT-3 to generate a set of predictions that would be tailored to the user's risk tolerance, trading strategy, and other preferences. 11 | 12 | It would use GPT-3 to generate predictions on the potential return on investment (ROI) of a particular trade. It would also leverage GPT-3 to suggest the best entry and exit points for a trade. 13 | 14 | And use GPT-3 to analyze the user's past trading history and suggest trades that would fit with their trading strategy. For example, if a user is more risk-averse, the platform would suggest trades that have a lower risk. 15 | 16 | Recommend the best cryptocurrency exchanges and trading platforms to use, as well as provide the user with alerts about upcoming market news and events. 17 | 18 | Overall, this assistant would provide users with a powerful tool to optimize their crypto trading strategies and maximize their profits. -------------------------------------------------------------------------------- /assets/Xposure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xPeterPan/Trading-Signals---CMC--Web-App-/97fb2a2d2c470ba751a3e591ea3ddb1f93be247c/assets/Xposure.png -------------------------------------------------------------------------------- /assets/buildspace-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0xPeterPan/Trading-Signals---CMC--Web-App-/97fb2a2d2c470ba751a3e591ea3ddb1f93be247c/assets/buildspace-logo.png -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: true, 4 | } 5 | 6 | module.exports = nextConfig 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Trading-Signals-CMC", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@emotion/react": "^11.10.5", 13 | "@emotion/styled": "^11.10.5", 14 | "eslint": "8.27.0", 15 | "eslint-config-next": "13.0.3", 16 | "framer-motion": "^6.5.1", 17 | "next": "^13.1.1", 18 | "openai": "^3.1.0", 19 | "react": "^18.2.0", 20 | "react-dom": "^18.2.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pages/_app.js: -------------------------------------------------------------------------------- 1 | import './styles.css'; 2 | 3 | function App({ Component, pageProps }) { 4 | return 5 | } 6 | export default App; 7 | -------------------------------------------------------------------------------- /pages/_document.js: -------------------------------------------------------------------------------- 1 | import { Html, Head, Main, NextScript } from 'next/document' 2 | 3 | export default function Document() { 4 | return ( 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /pages/api/generate.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | import { Configuration, OpenAIApi } from 'openai'; 3 | 4 | const configuration = new Configuration({ 5 | apiKey: process.env.OPENAI_API_KEY, 6 | }); 7 | 8 | async function getCryptoPrice(crypto) { 9 | // Set the API endpoint and your API key 10 | const apiEndpoint = `https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest`; 11 | const apiKey = process.env.COINMARKET_API_KEY; 12 | 13 | // Set the request parameters 14 | const params = { 15 | symbol: crypto, 16 | }; 17 | 18 | // Set the request headers 19 | const headers = { 20 | "X-CMC_PRO_API_KEY": apiKey, 21 | }; 22 | 23 | try { 24 | // Send a GET request to the API endpoint 25 | const response = await axios.get(apiEndpoint, { 26 | params, 27 | headers, 28 | }); 29 | 30 | // Return the current price of the cryptocurrency 31 | return response.data.data[crypto].quote.USD.price; 32 | } catch (error) { 33 | console.error(error); 34 | return null; // or throw an error, depending on your needs 35 | } 36 | } 37 | 38 | const openai = new OpenAIApi(configuration); 39 | 40 | const generateAction = async (req, res) => { 41 | const crypto = req.body.userInput; 42 | const cryptoPrice = await getCryptoPrice(crypto); 43 | const basePromptPrefix = ` Please provide insights or analysis on the following crypto: ${crypto} (price: $${cryptoPrice})\nProvide the potential return on investment (ROI)\nProvide more detailed information such as entry and exit points, stop loss and take profit levels, and any other relevant technical analysis indicators.\nRecommend the best cryptocurrency exchanges and trading platforms to use\nwith the example\nCrypto:\nCrypto Price:\nEntry Point:\nExit Point:\nStop Loss:\nTake Profit:\nTime Frame: \nPotential ROI: \nRisk Tolerance: \nTechnical Analysis Indicators: \nRecommended Exchange: \nRecommended Trading Platform: \nTechnical Analysis: `; 44 | 45 | console.log(`API: ${basePromptPrefix}${req.body.userInput}`) 46 | 47 | const baseCompletion = await openai.createCompletion({ 48 | model: 'text-davinci-003', 49 | prompt: `${basePromptPrefix}${req.body.userInput}\n`, 50 | temperature: 0.8, 51 | max_tokens: 500, 52 | }); 53 | 54 | const basePromptOutput = baseCompletion.data.choices.pop(); 55 | 56 | res.status(200).json({ output: basePromptOutput }); 57 | }; 58 | 59 | export default generateAction; -------------------------------------------------------------------------------- /pages/index.js: -------------------------------------------------------------------------------- 1 | import Head from 'next/head'; 2 | import Image from 'next/image'; 3 | import { useState } from 'react'; 4 | import xposureLogo from '../assets/Xposure.png'; 5 | 6 | const Home = () => { 7 | const [userInput, setUserInput] = useState(''); 8 | const [apiOutput, setApiOutput] = useState('') 9 | const [isGenerating, setIsGenerating] = useState(false) 10 | 11 | const callGenerateEndpoint = async () => { 12 | setIsGenerating(true); 13 | 14 | console.log("Calling OpenAI...") 15 | const response = await fetch('/api/generate', { 16 | method: 'POST', 17 | headers: { 18 | 'Content-Type': 'application/json', 19 | }, 20 | body: JSON.stringify({ userInput }), 21 | }); 22 | 23 | const data = await response.json(); 24 | const { output } = data; 25 | console.log("OpenAI replied...", output.text) 26 | 27 | setApiOutput(`${output.text}`); 28 | setIsGenerating(false); 29 | } 30 | 31 | const onUserChangedText = (event) => { 32 | {/* console.log(event.target.value); */} 33 | setUserInput(event.target.value); 34 | }; 35 | return ( 36 |
37 | 38 | Smart Trading Signals | Intelligence 39 | 40 |
41 |
42 |
43 |

Trade in the Crypto Markets with Artificial Intelligence

44 |
45 |
46 |

Have you been looking for good calls and reliable signals with actionable advices? You've got to the right place!

47 |
48 |
49 |
50 |