> For the complete documentation index, see [llms.txt](https://lens-project.gitbook.io/lens-project-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lens-project.gitbook.io/lens-project-docs/documentation/lens-sniper.md).

# Lens Sniper

#### How it works

Each user gets a dedicated Solana keypair generated and encrypted server-side using AES-256 (Fernet). The private key never leaves the server in plain text.

**Buying** - users tap a buy button on any alert. Lens fetches a quote from Jupiter, builds and signs the transaction, and submits it on-chain. Confirmation is polled until the transaction is verified.

**Selling** - users can sell 25%, 50%, or 100% of any position directly from the bot. Custom percentages are also supported.

**Route fallback** - if Jupiter fails, Lens automatically retries via Raydium, then falls back to pump.fun's bonding curve API for pump.fun tokens.

**Withdrawals** - users can withdraw SOL to any external wallet at any time.

#### Take Profit / Stop Loss

Premium and alpha users can configure automatic TP/SL:

* Take Profit triggers when a position is up by a set percentage
* Stop Loss triggers when a position is down by a set percentage
* Both support partial sells (e.g. sell 50% at TP, keep the rest)

#### Auto Buy

Alpha users can enable Auto Buy - every alert from tracked wallets automatically triggers a buy for a configured SOL amount. Dedup logic prevents the same token from being bought twice within 24 hours.

#### Dev Fee

A 1% fee is collected on buys and sells to fund ongoing development. The fee is sent as a separate transaction after the trade confirms.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lens-project.gitbook.io/lens-project-docs/documentation/lens-sniper.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
