Organization: - Created docs/ with setup/, guides/, history/ subdirectories - Created workflows/ with trading/, analytics/, telegram/, archive/ subdirectories - Created scripts/ with docker/, setup/, testing/ subdirectories - Created tests/ for TypeScript test files - Created archive/ for unused reference files Moved files: - 17 documentation files → docs/ - 16 workflow JSON files → workflows/ - 10 shell scripts → scripts/ - 4 test files → tests/ - 5 unused files → archive/ Updated: - README.md with new file structure and documentation paths Deleted: - data/ (empty directory) - screenshots/ (empty directory) Critical files remain in root: - telegram_command_bot.py (active bot - used by Dockerfile) - watch-restart.sh (systemd service dependency) - All Dockerfiles and docker-compose files - All environment files Validation: Containers running (trading-bot-v4, telegram-trade-bot, postgres) API responding (positions endpoint tested) Telegram bot functional (/status command tested) All critical files present in root No code changes - purely organizational. System continues running without interruption. Recovery: git revert HEAD or git reset --hard cleanup-before
139 lines
3.4 KiB
JSON
139 lines
3.4 KiB
JSON
{
|
|
"name": "Telegram Trade Trigger (Import to Money Machine)",
|
|
"nodes": [
|
|
{
|
|
"parameters": {
|
|
"httpMethod": "POST",
|
|
"path": "manual-telegram-trade",
|
|
"options": {}
|
|
},
|
|
"id": "webhook-telegram-manual",
|
|
"name": "Telegram Command Webhook",
|
|
"type": "n8n-nodes-base.webhook",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
-840,
|
|
460
|
|
],
|
|
"webhookId": "manual-telegram-trade-webhook"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"fields": {
|
|
"values": [
|
|
{
|
|
"name": "rawMessage",
|
|
"stringValue": "={{ $json.body.message || $json.body.text || $json.body }}"
|
|
},
|
|
{
|
|
"name": "symbol",
|
|
"stringValue": "={{ ($json.body.message || $json.body.text || $json.body).toString().match(/\\b(SOL|BTC|ETH)\\b/i) ? ($json.body.message || $json.body.text || $json.body).toString().match(/\\b(SOL|BTC|ETH)\\b/i)[0].toUpperCase() + '-PERP' : 'SOL-PERP' }}"
|
|
},
|
|
{
|
|
"name": "direction",
|
|
"stringValue": "={{ ($json.body.message || $json.body.text || $json.body).toString().match(/\\b(sell|short)\\b/i) ? 'short' : 'long' }}"
|
|
},
|
|
{
|
|
"name": "timeframe",
|
|
"stringValue": "5"
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "parse-telegram-manual",
|
|
"name": "Parse Manual Command",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.2,
|
|
"position": [
|
|
-660,
|
|
460
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"chatId": "579304651",
|
|
"text": "🤖 Manual trade command:\n\n📊 {{ $json.symbol }}\n📈 {{ $json.direction.toUpperCase() }}\n⏰ {{ $now.toFormat('HH:mm') }}\n\n⏳ Processing...",
|
|
"additionalFields": {
|
|
"appendAttribution": false
|
|
}
|
|
},
|
|
"id": "ack-manual-command",
|
|
"name": "Send Acknowledgment",
|
|
"type": "n8n-nodes-base.telegram",
|
|
"typeVersion": 1.1,
|
|
"position": [
|
|
-480,
|
|
460
|
|
],
|
|
"credentials": {
|
|
"telegramApi": {
|
|
"id": "Csk5cg4HtaSqP5jJ",
|
|
"name": "Telegram account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {
|
|
"mode": "raw",
|
|
"jsonOutput": "={{ $json }}",
|
|
"options": {}
|
|
},
|
|
"id": "ready-for-check-risk",
|
|
"name": "➡️ Connect to Check Risk",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.3,
|
|
"position": [
|
|
-300,
|
|
460
|
|
],
|
|
"notes": "Connect this output to the 'Check Risk' node in Money Machine"
|
|
}
|
|
],
|
|
"pinData": {},
|
|
"connections": {
|
|
"Telegram Command Webhook": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Parse Manual Command",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Parse Manual Command": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Send Acknowledgment",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Send Acknowledgment": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "➡️ Connect to Check Risk",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"active": false,
|
|
"settings": {
|
|
"executionOrder": "v1"
|
|
},
|
|
"versionId": "telegram-webhook-v1",
|
|
"meta": {
|
|
"instanceId": "e766d4f0b5def8ee8cb8561cd9d2b9ba7733e1907990b6987bca40175f82c379"
|
|
},
|
|
"tags": []
|
|
}
|