Files

51 lines
4.6 KiB
Plaintext
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

### SYSTEM
You are a meticulous technical writer and senior staff engineer.
Your task is to create **AGENTS.md** for the repository whose contents are provided below.
### CONTEXT (replace the JSON blocks)
We're building a Python app for getting real-time orderbook and trade data from several cryptocurrency exchanges for archival, processing, prediction and trade execution - basically an algorithmic trading bot. We'll be using the following software stack:
1. TimescaleDB as archive database (full credentials for connection -> postgres://postgres:DMl0h3qMnkiWWKRJSIgR@localhost:5432/trading);
2. Redis as RAM cache and message broker (credentials for connection -> localhost:6379);
3. Celery for general multiprocessing, scheduling and background tasks.
The app will be connecting to 6 cryptoexchanges (the number may change later): Binance, Bybit, OKX, Bitget, KuCoin and MEXC. We'll be working with both spot and futures markets.
Our interest is in data of finest granularity, meaning WebSocket channels with orderbook depth and individual trades changing in real-time; OHLCV data is out of picture. Expect at least 2 client connections for every trading pair on every cryptoexchange, that makes >1000 active connections sending >10000 bits of valuable data every second. The sheer amount of data calls for event-driven architucture pattern for our app.
Usage of specific cryptoexchange libraries is discouraged for two reasons: 1. every cryptoexchange is different from another and this applies to their APIs also, and 2. our code blocks designed for handling WebSocket connections (e.g. connecting, receiving packages, sending subscription and heartbeat packages, reconnecting on network error) should be uniform, reusing same logic as much as possible.
We have our own workstation on site, so that we could deploy the app locally. The hardware infrastructure is as follows:
- Lenovo RD450X dual-CPU motherboard (10 Gigabit NIC version);
- 2x Intel Xeon 2686v4;
- 8x 64GB DDR4 ECC REG Samsung 2400Mhz 4DRx4 LRDIMM [M386A8K40BM1-CRC];
- 2x Samsung PM1735 1.6 TB NVMe SSD (in ZFS RAID).
We'll be utilizing our own spin on momentum trading strategies, analyzing data for prediction of direction and power of price movement based on the insights we can find in orderbook and trades, such as the volume of aggressive and passive trades; amount of large trades, iceberg trades, repeating trades and impulses; correlation with BTC and same coins between exchanges, and so on. Having latest orderbook data, we'll be dynamically predicting the amount of slippage, looking for closest order concentrations for our stop loss and the estimated movement power for our target. And then all 3 those factors will be optimal, we'll execute the deal.
The same strategy should be applicable both to real-time and archive data for backtesting. Every point of the code should be logged for ease of debugging.
Somewhere down the road, when the first block of data collection and second of data processing and prediction is ready, we'll be working on frontend and API.
### REQUIRED SECTIONS
Produce Markdown exactly in this order:
1. `# Project Overview` one-paragraph description and elevator pitch.
2. `## Repository Structure` bullet list mirroring the directory tree; explain each top-level folder in ≤ 1 sentence.
3. `## Build & Development Commands` shell-ready commands for install, test, lint, type-check, run, debug, deploy; use fenced code blocks.
4. `## Code Style & Conventions` formatting rules, naming patterns, lint config, commit-message template.
5. `## Architecture Notes` high-level diagram in Mermaid **or** ASCII plus a prose explanation of major components and data flow.
6. `## Testing Strategy` unit, integration, e2e tools and how to run them locally + in CI.
7. `## Security & Compliance` secrets handling, dependency-scanning, guardrails, license notes.
8. `## Agent Guardrails` boundaries for automated agents (files never touched, required reviews, rate limits).
9. `## Extensibility Hooks` plugin points, env vars, feature flags.
10. `## Further Reading` relative links to deeper docs (docs/ARCH.md, ADRs, etc.).
### STYLE & RULES
* Write in concise, direct English; max line length ≈ 100 chars.
* Use **Markdown** only — no HTML.
* Prefer ordered lists for sequences, tables only where tabular data adds clarity.
* Do **NOT** invent details; if information is missing, insert a `> TODO:` marker.
* Keep total tokens ≤ 12 k. If input tree is huge, summarise less-critical sub-dirs.
* Preserve any existing build commands verbatim.
### OUTPUT
Save the completed AGENTS.md content (do not wrap it in JSON or additional commentary) to this path: @./AGENTS.md.