-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
723 lines (695 loc) · 24.3 KB
/
openapi.yaml
File metadata and controls
723 lines (695 loc) · 24.3 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
openapi: 3.1.0
info:
title: LaserSell API
version: 1.0.0
description: |
The LaserSell API builds unsigned Solana transactions for buying and selling tokens across supported DEXs.
All transactions are non-custodial: the API returns unsigned `VersionedTransaction` payloads that you sign locally with your own keypair.
Supported markets: Pump.fun, PumpSwap, Raydium (CPMM, Launchpad), Meteora (DBC, DAMM v2).
servers:
- url: https://api.lasersell.io
description: Production
security:
- apiKey: []
components:
securitySchemes:
apiKey:
type: apiKey
in: header
name: x-api-key
description: Your LaserSell API key. Obtain one from the [LaserSell dashboard](https://www.lasersell.io).
schemas:
# ── Sell ──────────────────────────────────────────────
BuildSellTxRequest:
type: object
required:
- mint
- user_pubkey
- amount_tokens
- output
- slippage_bps
properties:
mint:
type: string
description: Token mint address (base58).
example: "So11111111111111111111111111111111111111112"
user_pubkey:
type: string
description: Your wallet public key (base58).
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
amount_tokens:
type: integer
description: Amount to sell in the token's atomic units.
example: 1000000
output:
type: string
enum: ["SOL", "USD1"]
description: Desired output asset.
example: "SOL"
slippage_bps:
type: integer
description: Maximum slippage tolerance in basis points (e.g., `2000` = 20%).
example: 2000
mode:
type: string
enum: ["fast", "secure"]
default: "fast"
description: Routing mode hint.
market_context:
type: object
description: Pre-resolved market context. Omit to let the server resolve automatically.
send_mode:
type: string
enum: ["helius_sender", "astralane", "rpc"]
description: Transaction send mode.
tip_lamports:
type: integer
description: Optional priority fee tip in lamports.
partner_fee_recipient:
type: string
description: Partner fee recipient wallet (base58 pubkey).
partner_fee_bps:
type: integer
description: Partner fee in basis points (max 50 = 0.5%). Mutually exclusive with `partner_fee_lamports`.
maximum: 50
partner_fee_lamports:
type: integer
description: Partner fee as flat SOL lamports (max 50,000,000). Mutually exclusive with `partner_fee_bps`.
maximum: 50000000
# ── Buy ───────────────────────────────────────────────
BuildBuyTxRequest:
type: object
required:
- mint
- user_pubkey
- slippage_bps
properties:
mint:
type: string
description: Token mint address to buy (base58).
example: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
user_pubkey:
type: string
description: Your wallet public key (base58).
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
amount:
type: number
description: |
Human-readable amount to spend (e.g., `0.1` for 0.1 SOL, `10.0` for 10 USD1).
Mutually exclusive with `amount_in_total`. Exactly one of `amount` or `amount_in_total` must be provided.
example: 0.1
amount_in_total:
type: integer
description: |
Amount to spend in input-asset atomic units (e.g., lamports for SOL).
Mutually exclusive with `amount`. Exactly one of `amount` or `amount_in_total` must be provided.
example: 100000000
slippage_bps:
type: integer
description: Maximum slippage tolerance in basis points (e.g., `2000` = 20%).
example: 2000
input:
type: string
enum: ["SOL", "USD1"]
default: "SOL"
description: Input asset.
mode:
type: string
enum: ["fast", "secure"]
default: "fast"
description: Routing mode hint.
send_mode:
type: string
enum: ["helius_sender", "astralane", "rpc"]
description: Transaction send mode.
tip_lamports:
type: integer
description: Optional priority fee tip in lamports.
partner_fee_recipient:
type: string
description: Partner fee recipient wallet (base58 pubkey).
partner_fee_bps:
type: integer
description: Partner fee in basis points (max 50 = 0.5%). Mutually exclusive with `partner_fee_lamports`.
maximum: 50
partner_fee_lamports:
type: integer
description: Partner fee as flat SOL lamports (max 50,000,000). Mutually exclusive with `partner_fee_bps`.
maximum: 50000000
# ── Shared Tx Response ────────────────────────────────
BuildTxResponse:
type: object
required:
- tx
properties:
tx:
type: string
description: Base64-encoded unsigned Solana `VersionedTransaction`. Sign this locally with your keypair before submitting.
example: "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA..."
route:
type: object
description: Routing metadata.
properties:
market_type:
type: string
description: DEX used for this route.
example: "pumpswap"
pool_id:
type: string
description: Pool address used.
debug:
type: object
description: Debug information (included when available).
# ── Account ───────────────────────────────────────────
AccountResponse:
type: object
required:
- tier
- tier_name
- limits
properties:
tier:
type: integer
enum: [0, 1, 2]
description: Numeric tier identifier.
example: 1
tier_name:
type: string
enum: ["free", "tier_1", "tier_2"]
description: Human-readable plan name.
example: "tier_1"
limits:
$ref: "#/components/schemas/AccountLimits"
AccountLimits:
type: object
required:
- max_wallets
- max_positions_per_wallet
- max_positions_per_session
properties:
max_wallets:
type: integer
description: Maximum wallets you can track simultaneously.
example: 5
max_positions_per_wallet:
type: integer
description: Maximum open positions per wallet.
example: 100
max_positions_per_session:
type: integer
description: Maximum total open positions across all wallets.
example: 500
# ── History ───────────────────────────────────────────
TradeHistoryResponse:
type: object
required:
- trades
properties:
trades:
type: array
description: Array of trade records, ordered by most recent first.
items:
$ref: "#/components/schemas/TradeHistoryItem"
total:
type:
- integer
- "null"
description: Estimated total number of matching trades for pagination.
example: 42
TradeHistoryItem:
type: object
required:
- id
- session_id
- position_id
- wallet_pubkey
- mint
- entry_quote_units
- tokens
- opened_at
properties:
id:
type: integer
description: Unique trade record identifier.
example: 42
session_id:
type: integer
description: Stream session that produced this trade.
example: 1001
position_id:
type: integer
description: Position identifier within the session.
example: 3
wallet_pubkey:
type: string
description: Wallet public key that held the position (base58).
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
mint:
type: string
description: Token mint address (base58).
example: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
entry_quote_units:
type: integer
description: Amount spent to open the position in quote asset atomic units.
example: 500000000
exit_quote_units:
type:
- integer
- "null"
description: Proceeds received on close in quote asset atomic units.
example: 650000000
profit_quote_units:
type:
- integer
- "null"
description: Net profit or loss in quote asset atomic units.
example: 150000000
tokens:
type: integer
description: Number of tokens acquired at entry in atomic units.
example: 1000000
exit_reason:
type:
- string
- "null"
enum: ["target_profit", "stop_loss", "trailing_stop", "manual", null]
description: Why the position was closed.
example: "target_profit"
market_kind:
type:
- string
- "null"
description: DEX or launchpad the token was traded on.
example: "PumpFun"
strategy_target_profit_pct:
type:
- number
- "null"
description: Target profit percentage configured when the position opened.
example: 30.0
strategy_stop_loss_pct:
type:
- number
- "null"
description: Stop loss percentage configured when the position opened.
example: 50.0
strategy_trailing_stop_pct:
type:
- number
- "null"
description: Trailing stop percentage configured when the position opened.
example: 20.0
opened_at:
type: string
format: date-time
description: ISO 8601 timestamp when the position was opened.
example: "2026-03-07T12:00:00Z"
closed_at:
type:
- string
- "null"
format: date-time
description: ISO 8601 timestamp when the position was closed.
example: "2026-03-07T12:30:00Z"
# ── Wallet Registration ───────────────────────────────
RegisterWalletRequest:
type: object
required:
- wallet_pubkey
- signature
- message
properties:
wallet_pubkey:
type: string
description: Solana wallet public key to register (base58).
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
signature:
type: string
description: Ed25519 signature of the message, base58-encoded.
message:
type: string
description: |
Structured message in the format `lasersell-register:<pubkey>:<unix_timestamp>`.
The timestamp must be within 5 minutes of the server's current time.
example: "lasersell-register:9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM:1706000000"
label:
type: string
description: Optional human-readable label for the wallet.
example: "My Trading Wallet"
RegisterWalletResponse:
type: object
required:
- wallet_pubkey
- registered
properties:
wallet_pubkey:
type: string
description: The registered wallet public key.
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
registered:
type: boolean
description: Whether the wallet was successfully registered.
example: true
UnregisterWalletRequest:
type: object
required:
- wallet_pubkey
properties:
wallet_pubkey:
type: string
description: Solana wallet public key to unregister (base58).
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
UnregisterWalletResponse:
type: object
required:
- wallet_pubkey
- removed
properties:
wallet_pubkey:
type: string
description: The unregistered wallet public key.
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
removed:
type: boolean
description: Whether the wallet was successfully removed.
example: true
# ── Errors ────────────────────────────────────────────
ErrorResponse:
type: object
required:
- error
properties:
error:
type: string
description: Human-readable error message.
example: "invalid mint address"
UnsupportedResponse:
type: object
required:
- status
- reason
- message
properties:
status:
type: string
const: "unsupported"
reason:
type: string
enum: ["no_route", "invalid_mint", "unsupported_token_program"]
description: Machine-readable reason code.
message:
type: string
description: Human and AI-readable explanation.
example: "No supported market found for this mint. Supported DEXs: PumpSwap, Raydium (CPMM, Launchpad), Meteora (DBC, DAMM v2), Pump.fun."
NotIndexedResponse:
type: object
required:
- status
- mint
- reason
properties:
status:
type: string
const: "not_indexed"
mint:
type: string
description: The mint address that is not yet indexed.
reason:
type: string
example: "mint not indexed yet; try again shortly"
paths:
# ── POST /v1/sell ───────────────────────────────────────
/v1/sell:
post:
operationId: buildSellTx
summary: Build Sell Transaction
description: |
Build an unsigned sell transaction to swap tokens for SOL or USD1 via one of the supported DEXs.
The response contains a base64-encoded unsigned `VersionedTransaction`. Sign it locally with your keypair and submit it to the network.
tags:
- Trading
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/BuildSellTxRequest"
responses:
"200":
description: Unsigned sell transaction built successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/BuildTxResponse"
"400":
description: Bad request (invalid parameters, invalid mint, or unsupported token program).
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/ErrorResponse"
- $ref: "#/components/schemas/UnsupportedResponse"
"401":
description: Unauthorized. Missing or invalid API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"404":
description: Unsupported market or mint not indexed yet.
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UnsupportedResponse"
- $ref: "#/components/schemas/NotIndexedResponse"
"422":
description: Valid request but no viable route found.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"429":
description: Rate limited. Back off and retry.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"500":
description: Internal server error.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
# ── POST /v1/buy ────────────────────────────────────────
/v1/buy:
post:
operationId: buildBuyTx
summary: Build Buy Transaction
description: |
Build an unsigned buy transaction to swap SOL or USD1 for tokens via one of the supported DEXs.
The response contains a base64-encoded unsigned `VersionedTransaction`. Sign it locally with your keypair and submit it to the network.
tags:
- Trading
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/BuildBuyTxRequest"
responses:
"200":
description: Unsigned buy transaction built successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/BuildTxResponse"
"400":
description: Bad request (invalid parameters, invalid mint, or unsupported token program).
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/ErrorResponse"
- $ref: "#/components/schemas/UnsupportedResponse"
"401":
description: Unauthorized. Missing or invalid API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"404":
description: Unsupported market or mint not indexed yet.
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UnsupportedResponse"
- $ref: "#/components/schemas/NotIndexedResponse"
"422":
description: Valid request but no viable route found.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"429":
description: Rate limited. Back off and retry.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"500":
description: Internal server error.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
# ── GET /v1/account ─────────────────────────────────────
/v1/account:
get:
operationId: getAccount
summary: Get Account
description: Retrieve your account tier, plan name, and usage limits.
tags:
- Account
responses:
"200":
description: Account details.
content:
application/json:
schema:
$ref: "#/components/schemas/AccountResponse"
"401":
description: Unauthorized. Missing or invalid API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
# ── GET /v1/history ─────────────────────────────────────
/v1/history:
get:
operationId: getTradeHistory
summary: Get Trade History
description: Fetch paginated trade history for your account, ordered by most recent first.
tags:
- Account
parameters:
- name: limit
in: query
required: false
description: Maximum number of trades to return (capped at 200).
schema:
type: integer
default: 50
maximum: 200
example: 20
- name: offset
in: query
required: false
description: Number of trades to skip for pagination.
schema:
type: integer
default: 0
example: 0
- name: mint
in: query
required: false
description: Filter results to a specific token mint address (base58).
schema:
type: string
example: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
- name: wallet
in: query
required: false
description: Filter results to a specific wallet public key (base58).
schema:
type: string
example: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"
responses:
"200":
description: Trade history page.
content:
application/json:
schema:
$ref: "#/components/schemas/TradeHistoryResponse"
"401":
description: Unauthorized. Missing or invalid API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
# ── POST /v1/wallets/register ───────────────────────────
/v1/wallets/register:
post:
operationId: registerWallet
summary: Register Wallet
description: |
Register a wallet by proving ownership with an Ed25519 signature. Registration is required before connecting wallets to the Exit Intelligence Stream.
No on-chain transaction is needed. Generate the proof locally using your keypair and the SDK's `proveOwnership` helper.
tags:
- Wallets
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/RegisterWalletRequest"
responses:
"200":
description: Wallet registered successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/RegisterWalletResponse"
"400":
description: Invalid pubkey format, malformed message, or expired timestamp (>5 min).
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"401":
description: Unauthorized. Missing or invalid API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
"403":
description: Signature verification failed.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
# ── DELETE /v1/wallets ──────────────────────────────────
/v1/wallets:
delete:
operationId: unregisterWallet
summary: Unregister Wallet
description: Remove a wallet registration from your account.
tags:
- Wallets
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UnregisterWalletRequest"
responses:
"200":
description: Wallet unregistered successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/UnregisterWalletResponse"
"401":
description: Unauthorized. Missing or invalid API key.
content:
application/json:
schema:
$ref: "#/components/schemas/ErrorResponse"
tags:
- name: Trading
description: Build unsigned buy and sell transactions.
- name: Account
description: Account details and trade history.
- name: Wallets
description: Wallet registration for the Exit Intelligence Stream.