Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crazyoptimist/dydx-trading-bot
Algorithmic Trading Bot on dYdX
https://github.com/crazyoptimist/dydx-trading-bot
algorithmic-trading cryptocurrency decentralized-exchange defi dex dydx trading-bot
Last synced: about 2 months ago
JSON representation
Algorithmic Trading Bot on dYdX
- Host: GitHub
- URL: https://github.com/crazyoptimist/dydx-trading-bot
- Owner: crazyoptimist
- Created: 2021-11-26T19:19:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-23T10:28:21.000Z (about 1 year ago)
- Last Synced: 2024-11-02T13:50:18.529Z (2 months ago)
- Topics: algorithmic-trading, cryptocurrency, decentralized-exchange, defi, dex, dydx, trading-bot
- Language: Python
- Homepage:
- Size: 13.7 KB
- Stars: 15
- Watchers: 2
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dYdX Algorithmic Trading Bot
## Disclaimer
This project is educational purpose only, the algorithm might bring losses. Use it at your own risk.
## Prepare env variables
```bash
INFURA_PROJECT_ID=
ETH_ADDRESS=
# get stark key pair and api credentials from the browser console(Application Tab -> Local Storage) when you login the to dashboard
STARK_PRIVATE_KEY=
API_KEY=
API_PASSPHRASE=
API_SECRET=
# pass the eth address to the get_account request, you will get the positionId back
POSITION_ID=
```## Install deps
```bash
make install
```## Run it
```bash
make run
```## Available requests on dYdX
```python
markets_response = client.public.get_markets()
pprint(markets_response.data['markets'][MARKET_ADA_USD])candles_response = client.public.get_candles(
market=MARKET_ADA_USD,
resolution='30MINS'
)
pprint(candles_response.data)account_response = client.private.get_account(
ethereum_address='0x3fe444...'
)
pprint(account_response.data)orders_response = client.private.get_orders(
market=MARKET_ADA_USD,
status=ORDER_STATUS_OPEN
)
pprint(orders_response.data)api_keys_response = client.private.get_api_keys()
pprint(api_keys_response.data)positions_response = client.private.get_positions(
market=MARKET_ADA_USD,
status=POSITION_STATUS_OPEN,
)
pprint(positions_response.data)
```## LICENSE
MITCreated by [crazyoptimist](https://github.com/crazyopimist)