Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vasemkin committed Jan 30, 2024
1 parent 68e359d commit ad65c12
Showing 1 changed file with 39 additions and 37 deletions.
76 changes: 39 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,63 @@
# Jupjup
# JupJup

<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
## Description

**This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)**
This trading bot is designed to operate on the Solana blockchain, utilizing two distinct strategies: Ping-Pong and DDCA (Dumb Dollar Cost Averaging). It's built to automate trades based on these strategies, aiming to capitalize on market movements and trends.

## Start the app
### Strategies

To start the development server run `nx serve ddca`. Open your browser and navigate to http://localhost:4200/. Happy coding!
1. **Ping-Pong**: This strategy involves setting predefined buy and sell prices. The bot buys an asset when its price drops to a certain level and sells when the price rises to a predetermined higher level.

## Generate code
2. **DDCA (Dumb Dollar Cost Averaging)**: In this unique strategy, the bot regularly buys and sells a set amount of tokens (in USD equivalent) regardless of the price, aiming to catch significant market spikes or dips.

If you happen to use Nx plugins, you can leverage code generators that might come with it.
## Requirements

Run `nx list` to get a list of available plugins and whether they have generators. Then run `nx list <plugin-name>` to see what generators are available.
- Node.js
- pnpm
- A Solana wallet

Learn more about [Nx generators on the docs](https://nx.dev/plugin-features/use-code-generators).
## Installation

## Running tasks
1. Clone the repository:

To execute tasks with Nx use the following syntax:
```bash
git clone https://github.com/vasemkin/jupjup
```

```
nx <target> <project> <...options>
```
2. Navigate to the project directory:

You can also run multiple targets:

```
nx run-many -t <target1> <target2>
```
```bash
cd jupjup
```

..or add `-p` to filter specific projects
3. Install dependencies:
```bash
pnpm install
```

```
nx run-many -t <target1> <target2> -p <proj1> <proj2>
```
## Configuration

Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/core-features/run-tasks).
Create a `.env` file in the project root and configure the following parameters:

## Want better Editor Integration?
- `NX_SOLANA_PK`: Your wallet private key.
- `NX_SOLANA_RPC_ENDPOINT`: Solana RPC endpoint URL.
- `NX_TRADING_MODE`: Trading strat: DDCA or PING_PONG.
- `NX_USD_BUDGET`: Trading budget for DDCA and ping pong entry.

Have a look at the [Nx Console extensions](https://nx.dev/nx-console). It provides autocomplete support, a UI for exploring and running tasks & generators, and more! Available for VSCode, IntelliJ and comes with a LSP for Vim users.
## Usage

## Ready to deploy?
Start the bot using:

Just run `nx build demoapp` to build the application. The build artifacts will be stored in the `dist/` directory, ready to be deployed.
```bash
pnpm start
```

## Set up CI!
The bot will automatically execute trades based on the configured strategies.

Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
## Disclaimer

- [Set up remote caching](https://nx.dev/core-features/share-your-cache)
- [Set up task distribution across multiple machines](https://nx.dev/nx-cloud/features/distribute-task-execution)
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
Trading cryptocurrencies carries a high level of risk, and may not be suitable for all investors. The strategies implemented in this bot are experimental. Please use at your own risk.

## Connect with us!
## Contributing

- [Join the community](https://nx.dev/community)
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Follow us on Twitter](https://twitter.com/nxdevtools)
Contributions, issues, and feature requests are welcome. Feel free to check issues page if you want to contribute.

0 comments on commit ad65c12

Please sign in to comment.