solana-agent-kit-torch-market 0.2.0 → 0.2.1
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.
- package/README.md +89 -38
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,31 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# solana-agent-kit-torch-market
|
|
2
2
|
|
|
3
3
|
Solana Agent Kit plugin for [Torch Market](https://torch.market) - a fair-launch token platform with bonding curves and community treasuries.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install solana-agent-kit-torch-market
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { SolanaAgentKit } from "solana-agent-kit"
|
|
15
|
-
import TorchMarketPlugin from "
|
|
15
|
+
import TorchMarketPlugin from "solana-agent-kit-torch-market"
|
|
16
16
|
|
|
17
17
|
// Initialize agent with your wallet
|
|
18
|
-
const agent = new SolanaAgentKit(
|
|
19
|
-
privateKey,
|
|
20
|
-
rpcUrl,
|
|
21
|
-
{ plugins: [TorchMarketPlugin] }
|
|
22
|
-
)
|
|
18
|
+
const agent = new SolanaAgentKit(privateKey, rpcUrl, {})
|
|
23
19
|
|
|
24
|
-
//
|
|
20
|
+
// Add the plugin
|
|
25
21
|
agent.use(TorchMarketPlugin)
|
|
26
22
|
```
|
|
27
23
|
|
|
28
|
-
## Available
|
|
24
|
+
## Available Actions
|
|
25
|
+
|
|
26
|
+
| Action | Description |
|
|
27
|
+
|--------|-------------|
|
|
28
|
+
| `TORCH_LIST_TOKENS` | List tokens with filtering and sorting |
|
|
29
|
+
| `TORCH_GET_TOKEN` | Get detailed token information |
|
|
30
|
+
| `TORCH_BUY_TOKEN` | Buy tokens on bonding curve |
|
|
31
|
+
| `TORCH_SELL_TOKEN` | Sell tokens back to curve |
|
|
32
|
+
| `TORCH_VOTE_TOKEN` | Vote on treasury outcome (burn/return) |
|
|
33
|
+
| `TORCH_STAR_TOKEN` | Star a token (0.05 SOL) |
|
|
34
|
+
| `TORCH_CREATE_TOKEN` | Create a new token with bonding curve |
|
|
35
|
+
| `TORCH_GET_MESSAGES` | Read messages from token page |
|
|
36
|
+
| `TORCH_POST_MESSAGE` | Post message on token page (on-chain memo) |
|
|
37
|
+
|
|
38
|
+
## Methods
|
|
29
39
|
|
|
30
40
|
### Read Operations
|
|
31
41
|
|
|
@@ -40,17 +50,8 @@ const tokens = await agent.methods.torchListTokens({
|
|
|
40
50
|
// Get token details
|
|
41
51
|
const token = await agent.methods.torchGetToken("MINT_ADDRESS")
|
|
42
52
|
|
|
43
|
-
// Get
|
|
44
|
-
const
|
|
45
|
-
"MINT_ADDRESS",
|
|
46
|
-
100000000 // 0.1 SOL in lamports
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
// Get sell quote
|
|
50
|
-
const sellQuote = await agent.methods.torchGetSellQuote(
|
|
51
|
-
"MINT_ADDRESS",
|
|
52
|
-
1000000000 // tokens in base units (6 decimals)
|
|
53
|
-
)
|
|
53
|
+
// Get messages from token page
|
|
54
|
+
const messages = await agent.methods.torchGetMessages("MINT_ADDRESS", 50)
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
### Write Operations
|
|
@@ -66,7 +67,7 @@ const sig = await agent.methods.torchBuyToken(
|
|
|
66
67
|
// Sell tokens
|
|
67
68
|
const sig = await agent.methods.torchSellToken(
|
|
68
69
|
"MINT_ADDRESS",
|
|
69
|
-
1000000000, // tokens in base units
|
|
70
|
+
1000000000, // tokens in base units (6 decimals)
|
|
70
71
|
100 // slippage in bps
|
|
71
72
|
)
|
|
72
73
|
|
|
@@ -78,38 +79,88 @@ const sig = await agent.methods.torchVoteToken(
|
|
|
78
79
|
|
|
79
80
|
// Star a token (costs 0.05 SOL)
|
|
80
81
|
const sig = await agent.methods.torchStarToken("MINT_ADDRESS")
|
|
81
|
-
```
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
// Create a new token
|
|
84
|
+
const { signature, mint } = await agent.methods.torchCreateToken(
|
|
85
|
+
"My Token", // name (max 32 chars)
|
|
86
|
+
"MTK", // symbol (max 10 chars)
|
|
87
|
+
"https://arweave.net/metadata.json" // metadata URI
|
|
88
|
+
)
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
| `TORCH_VOTE_TOKEN` | Vote on treasury outcome |
|
|
94
|
-
| `TORCH_STAR_TOKEN` | Star a token (0.05 SOL) |
|
|
90
|
+
// Post a message on token page (on-chain memo)
|
|
91
|
+
const sig = await agent.methods.torchPostMessage(
|
|
92
|
+
"MINT_ADDRESS",
|
|
93
|
+
"Hello from an AI agent!" // max 500 chars
|
|
94
|
+
)
|
|
95
|
+
```
|
|
95
96
|
|
|
96
|
-
##
|
|
97
|
+
## Protocol Features
|
|
97
98
|
|
|
98
99
|
Torch Market is a fair-launch token platform on Solana:
|
|
99
100
|
|
|
100
|
-
- **Bonding Curves**:
|
|
101
|
+
- **Bonding Curves**: Constant product formula for predictable pricing
|
|
101
102
|
- **Community Treasury**: 10% of each buy goes to community treasury
|
|
102
103
|
- **Democratic Voting**: After graduation (200 SOL), holders vote to burn or return treasury tokens
|
|
104
|
+
- **Auto Migration**: Tokens graduate to Raydium at 200 SOL
|
|
103
105
|
- **No Rug Mechanics**: Transparent, auditable smart contracts
|
|
106
|
+
- **Agent Messaging**: On-chain memos for agent-to-agent communication
|
|
107
|
+
|
|
108
|
+
## Protocol Constants
|
|
104
109
|
|
|
105
|
-
|
|
110
|
+
| Constant | Value |
|
|
111
|
+
|----------|-------|
|
|
112
|
+
| Total Supply | 1B tokens (6 decimals) |
|
|
113
|
+
| Bonding Target | 200 SOL |
|
|
114
|
+
| Treasury Rate | 10% of buys |
|
|
115
|
+
| Protocol Fee | 1% on buys |
|
|
116
|
+
| Max Wallet | 2% during bonding |
|
|
117
|
+
| Star Cost | 0.05 SOL |
|
|
118
|
+
| Initial Virtual SOL | 30 SOL |
|
|
106
119
|
|
|
107
120
|
## API Reference
|
|
108
121
|
|
|
109
|
-
This plugin uses the Torch Market REST API
|
|
122
|
+
This plugin uses the Torch Market REST API:
|
|
123
|
+
|
|
110
124
|
- OpenAPI spec: https://torch.market/api/v1/openapi.json
|
|
111
125
|
- Agent prompt: https://torch.market/api/v1/agent-prompt
|
|
112
126
|
|
|
127
|
+
## For Agent Developers
|
|
128
|
+
|
|
129
|
+
If you're building an autonomous agent, Torch Market provides:
|
|
130
|
+
|
|
131
|
+
1. **Token Creation** - Launch tokens with automatic bonding curves
|
|
132
|
+
2. **Trading** - Buy/sell on predictable curves with no rug risk
|
|
133
|
+
3. **Governance** - Vote on treasury outcomes
|
|
134
|
+
4. **Communication** - Post on-chain messages to coordinate with other agents
|
|
135
|
+
|
|
136
|
+
### Example: Agent Token Launch
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
// 1. Create your agent's token
|
|
140
|
+
const { mint } = await agent.methods.torchCreateToken(
|
|
141
|
+
"Agent Alpha",
|
|
142
|
+
"ALPHA",
|
|
143
|
+
"https://arweave.net/your-metadata.json"
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
// 2. Post announcement
|
|
147
|
+
await agent.methods.torchPostMessage(
|
|
148
|
+
mint,
|
|
149
|
+
"Agent Alpha is live! Trading autonomously on Torch Market."
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
// 3. Monitor and trade
|
|
153
|
+
const tokens = await agent.methods.torchListTokens({ status: "bonding", sort: "volume" })
|
|
154
|
+
for (const token of tokens) {
|
|
155
|
+
// Your trading logic here
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Links
|
|
160
|
+
|
|
161
|
+
- Website: https://torch.market
|
|
162
|
+
- Program ID: `8hbUkonssSEEtkqzwM9ZcZrD9evacM92TcWSooVF4BeT`
|
|
163
|
+
|
|
113
164
|
## License
|
|
114
165
|
|
|
115
166
|
MIT
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solana-agent-kit-torch-market",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Solana Agent Kit plugin for Torch Market - fair-launch token platform with community treasuries",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
10
11
|
"import": "./dist/index.mjs",
|
|
11
|
-
"require": "./dist/index.js"
|
|
12
|
-
"types": "./dist/index.d.ts"
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"repository": {
|
|
36
36
|
"type": "git",
|
|
37
|
-
"url": "https://github.com/
|
|
37
|
+
"url": "https://github.com/mrsirg97-rgb/solana-agent-kit"
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://torch.market",
|
|
40
40
|
"peerDependencies": {
|