-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFolder Structure
More file actions
83 lines (72 loc) · 2.18 KB
/
Folder Structure
File metadata and controls
83 lines (72 loc) · 2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
solana_trading_bot/
├── config/
│ └── settings.json
├── bots/
│ ├── clmm_orca.py
│ ├── dlmm_meteora.py
│ └── openbook_ray.py
├── core/
│ ├── price_feed.py
│ ├── wallet.py
│ └── dca_stoploss.py
├── main.py
└── requirements.txt
requirements.txt
solana
pythclient
requests
numpy
config/settings.json
{
"token": "SOL",
"stop_loss_price": 145.0,
"dca_levels": [140.0, 135.0, 130.0],
"dca_amount": 0.25,
"dry_run": true
}
core/price_feed.py
import json
from core.price_feed import get_current_price
with open("config/settings.json") as f:
settings = json.load(f)
executed_levels = []
def dca_and_stoploss_logic():
price = get_current_price(settings["token"])
print(f"[INFO] Current Price: {price}")
if price <= settings["stop_loss_price"]:
print("[ALERT] Stop-loss triggered!")
for level in settings["dca_levels"]:
if price <= level and level not in executed_levels:
print(f"[DCA] Buying at ${level} for {settings['dca_amount']} {settings['token']}")
if not settings["dry_run"]:
# Insert trade execution here
pass
executed_levels.append(level)
bots/clmm_orca.py
def run_orca_clmm_strategy():
print("[ORCA] Running CLMM placeholder...")
# Real SDK/API logic here
bots/dlmm_meteora.py
def run_meteora_dlmm_strategy():
print("[METEORA] Running DLMM placeholder...")
# Real SDK/API logic here
bots/openbook_ray.py
def run_openbook_strategy():
print("[OPENBOOK] Running Orderbook placeholder...")
# Real order placement logic here
main.py
from bots.clmm_orca import run_orca_clmm_strategy
from bots.dlmm_meteora import run_meteora_dlmm_strategy
from bots.openbook_ray import run_openbook_strategy
from core.dca_stoploss import dca_and_stoploss_logic
import time
def main_loop():
while True:
print("\n=== Solana Bot Cycle ===")
dca_and_stoploss_logic()
run_orca_clmm_strategy()
run_meteora_dlmm_strategy()
run_openbook_strategy()
time.sleep(30) # 30 seconds between cycles
if __name__ == "__main__":
main_loop()