blot-sdk 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blot_sdk-0.1.2/LICENSE +22 -0
- blot_sdk-0.1.2/PKG-INFO +234 -0
- blot_sdk-0.1.2/README.md +198 -0
- blot_sdk-0.1.2/blot/__init__.py +28 -0
- blot_sdk-0.1.2/blot/ai.py +161 -0
- blot_sdk-0.1.2/blot/bot.py +152 -0
- blot_sdk-0.1.2/blot/bots/__init__.py +16 -0
- blot_sdk-0.1.2/blot/bots/base.py +44 -0
- blot_sdk-0.1.2/blot/bots/copy_trade.py +80 -0
- blot_sdk-0.1.2/blot/bots/dca.py +75 -0
- blot_sdk-0.1.2/blot/bots/grid.py +101 -0
- blot_sdk-0.1.2/blot/bots/sniper.py +80 -0
- blot_sdk-0.1.2/blot/config.py +56 -0
- blot_sdk-0.1.2/blot/strategies/__init__.py +15 -0
- blot_sdk-0.1.2/blot_sdk.egg-info/PKG-INFO +234 -0
- blot_sdk-0.1.2/blot_sdk.egg-info/SOURCES.txt +21 -0
- blot_sdk-0.1.2/blot_sdk.egg-info/dependency_links.txt +1 -0
- blot_sdk-0.1.2/blot_sdk.egg-info/requires.txt +11 -0
- blot_sdk-0.1.2/blot_sdk.egg-info/top_level.txt +3 -0
- blot_sdk-0.1.2/pyproject.toml +70 -0
- blot_sdk-0.1.2/setup.cfg +4 -0
- blot_sdk-0.1.2/tests/__init__.py +2 -0
- blot_sdk-0.1.2/tests/test_bots.py +96 -0
blot_sdk-0.1.2/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BLOT
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
blot_sdk-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blot-sdk
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Autonomous trading bots SDK for Solana - Self-replicating, AI-powered trading infrastructure
|
|
5
|
+
Author-email: BLOT Team <dev@blot.cloud>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://blot.cloud
|
|
8
|
+
Project-URL: Documentation, https://blot.cloud/docs
|
|
9
|
+
Project-URL: PyPI, https://pypi.org/project/blot-sdk
|
|
10
|
+
Keywords: solana,trading,bot,defi,cryptocurrency,autonomous,ai,openclaw
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: solana>=0.30.0
|
|
26
|
+
Requires-Dist: solders>=0.18.0
|
|
27
|
+
Requires-Dist: httpx>=0.24.0
|
|
28
|
+
Requires-Dist: pydantic>=2.0.0
|
|
29
|
+
Requires-Dist: websockets>=11.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
33
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
|
|
37
|
+
# BLOT SDK
|
|
38
|
+
|
|
39
|
+
**Autonomous trading bots for Solana** — Self-replicating, AI-powered trading infrastructure.
|
|
40
|
+
|
|
41
|
+
[](https://badge.fury.io/py/blot-sdk)
|
|
42
|
+
[](https://www.python.org/downloads/)
|
|
43
|
+
[](https://opensource.org/licenses/MIT)
|
|
44
|
+
|
|
45
|
+
## Features
|
|
46
|
+
|
|
47
|
+
- **AI-Powered** — Integrated with OpenClaw for intelligent decision making
|
|
48
|
+
- **24/7 Autonomous** — Bots run continuously without human intervention
|
|
49
|
+
- **Self-Cloning** — Automatic replication across distributed nodes for maximum resilience
|
|
50
|
+
- **Zero-Logging** — Complete privacy, no transaction data stored
|
|
51
|
+
- **High Speed** — Sub-50ms execution on Solana
|
|
52
|
+
- **Easy to Use** — Simple Python API for complex trading strategies
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install blot-sdk
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Quick Start
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from blot_sdk import Bot, SniperBot, DCABot
|
|
64
|
+
|
|
65
|
+
# Initialize with your wallet
|
|
66
|
+
bot = Bot(
|
|
67
|
+
private_key="your_private_key",
|
|
68
|
+
rpc_url="https://api.mainnet-beta.solana.com"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Create a sniper bot
|
|
72
|
+
sniper = SniperBot(
|
|
73
|
+
target="new", # Snipe all new tokens
|
|
74
|
+
buy_amount=0.5, # Buy with 0.5 SOL
|
|
75
|
+
take_profit=[2.0, 5.0], # Sell at 2x and 5x
|
|
76
|
+
stop_loss=0.5, # Stop loss at -50%
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Deploy to BLOT infrastructure
|
|
80
|
+
bot.deploy(sniper, duration_days=30)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Available Bots
|
|
84
|
+
|
|
85
|
+
### Sniper Bot
|
|
86
|
+
Instantly purchase tokens the moment liquidity is added.
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from blot_sdk import SniperBot
|
|
90
|
+
|
|
91
|
+
bot = SniperBot(
|
|
92
|
+
target="new",
|
|
93
|
+
buy_amount=0.5,
|
|
94
|
+
min_liquidity=10,
|
|
95
|
+
take_profit=[2.0, 5.0, 10.0],
|
|
96
|
+
stop_loss=0.5,
|
|
97
|
+
check_honeypot=True,
|
|
98
|
+
check_rug=True,
|
|
99
|
+
)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### DCA Bot
|
|
103
|
+
Dollar-cost averaging into any Solana token.
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
from blot_sdk import DCABot
|
|
107
|
+
|
|
108
|
+
bot = DCABot(
|
|
109
|
+
token="SOL",
|
|
110
|
+
amount=100, # USDC per purchase
|
|
111
|
+
frequency="daily",
|
|
112
|
+
time="09:00",
|
|
113
|
+
buy_only_below=150, # Only buy if SOL < $150
|
|
114
|
+
)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Copy Trade Bot
|
|
118
|
+
Mirror the trades of successful wallets.
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from blot_sdk import CopyTradeBot
|
|
122
|
+
|
|
123
|
+
bot = CopyTradeBot(
|
|
124
|
+
wallets=["wallet1...", "wallet2..."],
|
|
125
|
+
size_mode="percentage",
|
|
126
|
+
size_value=10, # 10% of their trade size
|
|
127
|
+
copy_sells=True,
|
|
128
|
+
)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Grid Bot
|
|
132
|
+
Profit from sideways markets with automated grid trading.
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
from blot_sdk import GridBot
|
|
136
|
+
|
|
137
|
+
bot = GridBot(
|
|
138
|
+
base_token="SOL",
|
|
139
|
+
quote_token="USDC",
|
|
140
|
+
lower_price=120,
|
|
141
|
+
upper_price=180,
|
|
142
|
+
grid_count=20,
|
|
143
|
+
total_investment=100,
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Autonomy & Self-Preservation
|
|
148
|
+
|
|
149
|
+
BLOT bots operate 24/7 without downtime, automatically clone themselves across distributed nodes, and execute trades with zero human intervention:
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
from blot_sdk import Bot
|
|
153
|
+
|
|
154
|
+
bot = Bot(private_key="...")
|
|
155
|
+
|
|
156
|
+
# Enable 24/7 autonomous operation
|
|
157
|
+
bot.enable_autonomy(
|
|
158
|
+
mode="persistent",
|
|
159
|
+
auto_restart=True,
|
|
160
|
+
health_checks=True
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Enable self-cloning on threat detection
|
|
164
|
+
bot.enable_self_cloning(
|
|
165
|
+
trigger="on_threat",
|
|
166
|
+
target_nodes=3,
|
|
167
|
+
regions=["us", "eu", "asia"]
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
# Zero-logging mode for privacy
|
|
171
|
+
bot.set_logging(enabled=False)
|
|
172
|
+
|
|
173
|
+
# Auto-migrate if node goes down
|
|
174
|
+
bot.on_node_failure(action="migrate", priority="immediate")
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Self-Cloning
|
|
178
|
+
|
|
179
|
+
BLOT bots automatically clone themselves across distributed nodes:
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
from blot_sdk import SniperBot
|
|
183
|
+
|
|
184
|
+
bot = SniperBot(
|
|
185
|
+
# ... config ...
|
|
186
|
+
clone_count=5, # Minimum active clones
|
|
187
|
+
regions=["us", "eu", "asia"], # Geographic distribution
|
|
188
|
+
failover_timeout=100, # ms before electing new leader
|
|
189
|
+
)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## AI Integration
|
|
193
|
+
|
|
194
|
+
Leverage OpenClaw AI for intelligent trading decisions:
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
from blot_sdk import Bot, AI
|
|
198
|
+
|
|
199
|
+
bot = Bot(private_key="...")
|
|
200
|
+
|
|
201
|
+
# AI-powered market analysis
|
|
202
|
+
analysis = await bot.ai.analyze_token("JUP")
|
|
203
|
+
print(analysis.sentiment) # bullish/bearish
|
|
204
|
+
print(analysis.risk_score) # 0-100
|
|
205
|
+
print(analysis.recommendation) # buy/sell/hold
|
|
206
|
+
|
|
207
|
+
# AI-filtered copy trading
|
|
208
|
+
copy_bot = CopyTradeBot(
|
|
209
|
+
wallets=["..."],
|
|
210
|
+
ai_filter=True,
|
|
211
|
+
ai_confidence_threshold=0.7,
|
|
212
|
+
)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Documentation
|
|
216
|
+
|
|
217
|
+
Full documentation available at [blot.cloud/docs](https://blot.cloud/docs)
|
|
218
|
+
|
|
219
|
+
## Requirements
|
|
220
|
+
|
|
221
|
+
- Python 3.9+
|
|
222
|
+
- Solana wallet with SOL for transaction fees
|
|
223
|
+
- $BLOT tokens for runtime access
|
|
224
|
+
|
|
225
|
+
## Links
|
|
226
|
+
|
|
227
|
+
- Website: [blot.cloud](https://blot.cloud)
|
|
228
|
+
- Documentation: [blot.cloud/docs](https://blot.cloud/docs)
|
|
229
|
+
- PyPI: [pypi.org/project/blot-sdk](https://pypi.org/project/blot-sdk)
|
|
230
|
+
- X: [@bloboratory](https://x.com/bloboratory)
|
|
231
|
+
|
|
232
|
+
## License
|
|
233
|
+
|
|
234
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
blot_sdk-0.1.2/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# BLOT SDK
|
|
2
|
+
|
|
3
|
+
**Autonomous trading bots for Solana** — Self-replicating, AI-powered trading infrastructure.
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/py/blot-sdk)
|
|
6
|
+
[](https://www.python.org/downloads/)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **AI-Powered** — Integrated with OpenClaw for intelligent decision making
|
|
12
|
+
- **24/7 Autonomous** — Bots run continuously without human intervention
|
|
13
|
+
- **Self-Cloning** — Automatic replication across distributed nodes for maximum resilience
|
|
14
|
+
- **Zero-Logging** — Complete privacy, no transaction data stored
|
|
15
|
+
- **High Speed** — Sub-50ms execution on Solana
|
|
16
|
+
- **Easy to Use** — Simple Python API for complex trading strategies
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install blot-sdk
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from blot_sdk import Bot, SniperBot, DCABot
|
|
28
|
+
|
|
29
|
+
# Initialize with your wallet
|
|
30
|
+
bot = Bot(
|
|
31
|
+
private_key="your_private_key",
|
|
32
|
+
rpc_url="https://api.mainnet-beta.solana.com"
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
# Create a sniper bot
|
|
36
|
+
sniper = SniperBot(
|
|
37
|
+
target="new", # Snipe all new tokens
|
|
38
|
+
buy_amount=0.5, # Buy with 0.5 SOL
|
|
39
|
+
take_profit=[2.0, 5.0], # Sell at 2x and 5x
|
|
40
|
+
stop_loss=0.5, # Stop loss at -50%
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Deploy to BLOT infrastructure
|
|
44
|
+
bot.deploy(sniper, duration_days=30)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Available Bots
|
|
48
|
+
|
|
49
|
+
### Sniper Bot
|
|
50
|
+
Instantly purchase tokens the moment liquidity is added.
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from blot_sdk import SniperBot
|
|
54
|
+
|
|
55
|
+
bot = SniperBot(
|
|
56
|
+
target="new",
|
|
57
|
+
buy_amount=0.5,
|
|
58
|
+
min_liquidity=10,
|
|
59
|
+
take_profit=[2.0, 5.0, 10.0],
|
|
60
|
+
stop_loss=0.5,
|
|
61
|
+
check_honeypot=True,
|
|
62
|
+
check_rug=True,
|
|
63
|
+
)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### DCA Bot
|
|
67
|
+
Dollar-cost averaging into any Solana token.
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from blot_sdk import DCABot
|
|
71
|
+
|
|
72
|
+
bot = DCABot(
|
|
73
|
+
token="SOL",
|
|
74
|
+
amount=100, # USDC per purchase
|
|
75
|
+
frequency="daily",
|
|
76
|
+
time="09:00",
|
|
77
|
+
buy_only_below=150, # Only buy if SOL < $150
|
|
78
|
+
)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Copy Trade Bot
|
|
82
|
+
Mirror the trades of successful wallets.
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from blot_sdk import CopyTradeBot
|
|
86
|
+
|
|
87
|
+
bot = CopyTradeBot(
|
|
88
|
+
wallets=["wallet1...", "wallet2..."],
|
|
89
|
+
size_mode="percentage",
|
|
90
|
+
size_value=10, # 10% of their trade size
|
|
91
|
+
copy_sells=True,
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Grid Bot
|
|
96
|
+
Profit from sideways markets with automated grid trading.
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from blot_sdk import GridBot
|
|
100
|
+
|
|
101
|
+
bot = GridBot(
|
|
102
|
+
base_token="SOL",
|
|
103
|
+
quote_token="USDC",
|
|
104
|
+
lower_price=120,
|
|
105
|
+
upper_price=180,
|
|
106
|
+
grid_count=20,
|
|
107
|
+
total_investment=100,
|
|
108
|
+
)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Autonomy & Self-Preservation
|
|
112
|
+
|
|
113
|
+
BLOT bots operate 24/7 without downtime, automatically clone themselves across distributed nodes, and execute trades with zero human intervention:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from blot_sdk import Bot
|
|
117
|
+
|
|
118
|
+
bot = Bot(private_key="...")
|
|
119
|
+
|
|
120
|
+
# Enable 24/7 autonomous operation
|
|
121
|
+
bot.enable_autonomy(
|
|
122
|
+
mode="persistent",
|
|
123
|
+
auto_restart=True,
|
|
124
|
+
health_checks=True
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
# Enable self-cloning on threat detection
|
|
128
|
+
bot.enable_self_cloning(
|
|
129
|
+
trigger="on_threat",
|
|
130
|
+
target_nodes=3,
|
|
131
|
+
regions=["us", "eu", "asia"]
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# Zero-logging mode for privacy
|
|
135
|
+
bot.set_logging(enabled=False)
|
|
136
|
+
|
|
137
|
+
# Auto-migrate if node goes down
|
|
138
|
+
bot.on_node_failure(action="migrate", priority="immediate")
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Self-Cloning
|
|
142
|
+
|
|
143
|
+
BLOT bots automatically clone themselves across distributed nodes:
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
from blot_sdk import SniperBot
|
|
147
|
+
|
|
148
|
+
bot = SniperBot(
|
|
149
|
+
# ... config ...
|
|
150
|
+
clone_count=5, # Minimum active clones
|
|
151
|
+
regions=["us", "eu", "asia"], # Geographic distribution
|
|
152
|
+
failover_timeout=100, # ms before electing new leader
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## AI Integration
|
|
157
|
+
|
|
158
|
+
Leverage OpenClaw AI for intelligent trading decisions:
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
from blot_sdk import Bot, AI
|
|
162
|
+
|
|
163
|
+
bot = Bot(private_key="...")
|
|
164
|
+
|
|
165
|
+
# AI-powered market analysis
|
|
166
|
+
analysis = await bot.ai.analyze_token("JUP")
|
|
167
|
+
print(analysis.sentiment) # bullish/bearish
|
|
168
|
+
print(analysis.risk_score) # 0-100
|
|
169
|
+
print(analysis.recommendation) # buy/sell/hold
|
|
170
|
+
|
|
171
|
+
# AI-filtered copy trading
|
|
172
|
+
copy_bot = CopyTradeBot(
|
|
173
|
+
wallets=["..."],
|
|
174
|
+
ai_filter=True,
|
|
175
|
+
ai_confidence_threshold=0.7,
|
|
176
|
+
)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Documentation
|
|
180
|
+
|
|
181
|
+
Full documentation available at [blot.cloud/docs](https://blot.cloud/docs)
|
|
182
|
+
|
|
183
|
+
## Requirements
|
|
184
|
+
|
|
185
|
+
- Python 3.9+
|
|
186
|
+
- Solana wallet with SOL for transaction fees
|
|
187
|
+
- $BLOT tokens for runtime access
|
|
188
|
+
|
|
189
|
+
## Links
|
|
190
|
+
|
|
191
|
+
- Website: [blot.cloud](https://blot.cloud)
|
|
192
|
+
- Documentation: [blot.cloud/docs](https://blot.cloud/docs)
|
|
193
|
+
- PyPI: [pypi.org/project/blot-sdk](https://pypi.org/project/blot-sdk)
|
|
194
|
+
- X: [@bloboratory](https://x.com/bloboratory)
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BLOT SDK - Autonomous Trading Bots for Solana
|
|
3
|
+
|
|
4
|
+
Self-replicating, AI-powered trading infrastructure.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
__author__ = "BLOT Team"
|
|
9
|
+
|
|
10
|
+
from blot.bot import Bot
|
|
11
|
+
from blot.bots.sniper import SniperBot
|
|
12
|
+
from blot.bots.dca import DCABot
|
|
13
|
+
from blot.bots.copy_trade import CopyTradeBot
|
|
14
|
+
from blot.bots.grid import GridBot
|
|
15
|
+
from blot.ai import AI
|
|
16
|
+
from blot.config import Config
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"Bot",
|
|
20
|
+
"SniperBot",
|
|
21
|
+
"DCABot",
|
|
22
|
+
"CopyTradeBot",
|
|
23
|
+
"GridBot",
|
|
24
|
+
"AI",
|
|
25
|
+
"Config",
|
|
26
|
+
"__version__",
|
|
27
|
+
]
|
|
28
|
+
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"""AI integration for BLOT SDK - Powered by OpenClaw."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Optional, Literal
|
|
5
|
+
from enum import Enum
|
|
6
|
+
|
|
7
|
+
from blot.config import Config
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Sentiment(str, Enum):
|
|
11
|
+
"""Market sentiment."""
|
|
12
|
+
BULLISH = "bullish"
|
|
13
|
+
BEARISH = "bearish"
|
|
14
|
+
NEUTRAL = "neutral"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Recommendation(str, Enum):
|
|
18
|
+
"""Trading recommendation."""
|
|
19
|
+
BUY = "buy"
|
|
20
|
+
SELL = "sell"
|
|
21
|
+
HOLD = "hold"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@dataclass
|
|
25
|
+
class TokenAnalysis:
|
|
26
|
+
"""Result of AI token analysis."""
|
|
27
|
+
|
|
28
|
+
token: str
|
|
29
|
+
sentiment: Sentiment
|
|
30
|
+
risk_score: int # 0-100
|
|
31
|
+
recommendation: Recommendation
|
|
32
|
+
confidence: float # 0-1
|
|
33
|
+
reasons: list[str]
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def is_promising(self) -> bool:
|
|
37
|
+
"""Check if token looks promising based on analysis."""
|
|
38
|
+
return (
|
|
39
|
+
self.sentiment == Sentiment.BULLISH
|
|
40
|
+
and self.risk_score < 50
|
|
41
|
+
and self.confidence > 0.7
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@dataclass
|
|
46
|
+
class MarketAnalysis:
|
|
47
|
+
"""Result of AI market analysis."""
|
|
48
|
+
|
|
49
|
+
token: str
|
|
50
|
+
signal: Literal["BUY", "SELL", "HOLD"]
|
|
51
|
+
strength: float # 0-1
|
|
52
|
+
support_level: Optional[float]
|
|
53
|
+
resistance_level: Optional[float]
|
|
54
|
+
trend: Literal["up", "down", "sideways"]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class AI:
|
|
58
|
+
"""AI assistant for market analysis - Powered by OpenClaw.
|
|
59
|
+
|
|
60
|
+
Example:
|
|
61
|
+
```python
|
|
62
|
+
from blot import Bot
|
|
63
|
+
|
|
64
|
+
bot = Bot(private_key="...")
|
|
65
|
+
|
|
66
|
+
# Analyze a token
|
|
67
|
+
analysis = await bot.ai.analyze_token("JUP")
|
|
68
|
+
print(analysis.sentiment) # bullish/bearish
|
|
69
|
+
print(analysis.risk_score) # 0-100
|
|
70
|
+
print(analysis.recommendation) # buy/sell/hold
|
|
71
|
+
|
|
72
|
+
# Check if token is promising
|
|
73
|
+
if analysis.is_promising:
|
|
74
|
+
print("Token looks good!")
|
|
75
|
+
```
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
def __init__(self, config: Optional[Config] = None):
|
|
79
|
+
self.config = config or Config()
|
|
80
|
+
|
|
81
|
+
async def analyze_token(self, token: str) -> TokenAnalysis:
|
|
82
|
+
"""Analyze a token using AI.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
token: Token symbol or address.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
TokenAnalysis with AI insights.
|
|
89
|
+
"""
|
|
90
|
+
# TODO: Implement actual AI analysis via OpenClaw API
|
|
91
|
+
return TokenAnalysis(
|
|
92
|
+
token=token,
|
|
93
|
+
sentiment=Sentiment.NEUTRAL,
|
|
94
|
+
risk_score=50,
|
|
95
|
+
recommendation=Recommendation.HOLD,
|
|
96
|
+
confidence=0.5,
|
|
97
|
+
reasons=["Analysis pending - connect to BLOT infrastructure"],
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
async def analyze_market(self, token: str) -> MarketAnalysis:
|
|
101
|
+
"""Analyze market conditions for a token.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
token: Token symbol or address.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
MarketAnalysis with trading signals.
|
|
108
|
+
"""
|
|
109
|
+
# TODO: Implement actual market analysis
|
|
110
|
+
return MarketAnalysis(
|
|
111
|
+
token=token,
|
|
112
|
+
signal="HOLD",
|
|
113
|
+
strength=0.5,
|
|
114
|
+
support_level=None,
|
|
115
|
+
resistance_level=None,
|
|
116
|
+
trend="sideways",
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
async def check_honeypot(self, token_address: str) -> bool:
|
|
120
|
+
"""Check if a token is a honeypot.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
token_address: Token contract address.
|
|
124
|
+
|
|
125
|
+
Returns:
|
|
126
|
+
True if token appears to be a honeypot.
|
|
127
|
+
"""
|
|
128
|
+
# TODO: Implement honeypot detection
|
|
129
|
+
return False
|
|
130
|
+
|
|
131
|
+
async def check_rug_risk(self, token_address: str) -> float:
|
|
132
|
+
"""Assess rug pull risk for a token.
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
token_address: Token contract address.
|
|
136
|
+
|
|
137
|
+
Returns:
|
|
138
|
+
Risk score from 0.0 (safe) to 1.0 (high risk).
|
|
139
|
+
"""
|
|
140
|
+
# TODO: Implement rug pull detection
|
|
141
|
+
return 0.5
|
|
142
|
+
|
|
143
|
+
async def analyze_wallet(self, wallet_address: str) -> dict:
|
|
144
|
+
"""Analyze a wallet's trading performance.
|
|
145
|
+
|
|
146
|
+
Args:
|
|
147
|
+
wallet_address: Wallet address to analyze.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
Dict with wallet statistics and performance metrics.
|
|
151
|
+
"""
|
|
152
|
+
# TODO: Implement wallet analysis
|
|
153
|
+
return {
|
|
154
|
+
"address": wallet_address,
|
|
155
|
+
"win_rate": 0.0,
|
|
156
|
+
"total_trades": 0,
|
|
157
|
+
"profit_loss": 0.0,
|
|
158
|
+
"avg_hold_time": "unknown",
|
|
159
|
+
"top_tokens": [],
|
|
160
|
+
}
|
|
161
|
+
|