> For the complete documentation index, see [llms.txt](https://dirolprotocols-organization.gitbook.io/dirol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dirolprotocols-organization.gitbook.io/dirol/one-click-trading.md).

# One-Click Trading

One-click trading lets you buy and sell with **zero wallet popups**. You approve once, and every trade after that executes in a single tap — no signing each swap, no waiting on MetaMask.

This page explains how it works under the hood.

{% hint style="success" %}
**Still fully non-custodial.** One-click never asks for your private keys. It uses standard on-chain permissions with a spending cap and an expiry that you control and can revoke at any time.
{% endhint %}

### The idea

A normal swap needs a wallet signature for every trade — approve, then sign, then wait. That's fine until you're trying to ape a memecoin that's moving every second.

One-click removes the loop. You grant Dirol permission to move a capped amount of your tokens, and from then on Dirol's **keeper** (an execution relayer) submits your swaps for you the instant you click — using the permission you already gave, inside your own wallet.

Because Monad settles blocks extremely fast, the whole thing feels instant.

### Two setups, depending on your wallet

When you connect, Dirol detects which mechanism your wallet supports and picks one of two "tiers".

#### MetaMask → delegation tier (native MON)

MetaMask supports **ERC-7715** (`wallet_grantPermissions`) and **EIP-7702** smart accounts. This lets you grant a **native MON** spending permission through MetaMask's own permission screen.

* One approval screen, and native MON one-click is live.
* This is the **only** setup today that can one-click swaps paid **directly in native MON**.
* The grant is registered with Dirol's keeper; the keeper is the only party allowed to use it, within your caps.

#### Other wallets → module tier (session + approvals)

Backpack, Phantom, and everything else use Dirol's on-chain **OneClickModule session**.

* You send **one** `enableSession` transaction that opens a session with a spending cap and an expiry.
* Individual ERC-20 tokens are then authorized to trade one-click (see Approvals below).
* **Native MON can't be one-clicked here** — native MON has no on-chain "allowance" to grant. Wrap it to **WMON** and you can one-click it like any other token. Every other token (USDC, memecoins, etc.) works normally.

### The session / grant

Whichever tier you're on, the permission is bounded:

| Property         | What it means                                                                                      |
| ---------------- | -------------------------------------------------------------------------------------------------- |
| **Spending cap** | A daily cap per token (or an "open" session where approved tokens trade uncapped). You set it.     |
| **Expiry**       | Default **30 days**, maximum **90 days**. After it lapses, one-click simply stops until you renew. |
| **Scope**        | The keeper can only call Dirol's own swap contracts inside your account — nothing else.            |
| **Revocable**    | You can revoke the session (and token approvals) at any time from the one-click settings.          |

### Approvals

For the module tier, each ERC-20 you sell needs a one-time on-chain approval. You have two options:

* **Lazy (default)** — the first time you sell a given token, it asks for one approval; every sell after that is popup-free.
* **Pre-approve** — approve all the tokens you hold in a single batched confirmation, so even the first sell of each is instant.

{% hint style="info" %}
When a new token lands in your wallet, Dirol prompts you once to make it one-click-ready for next time. That's this approval step.
{% endhint %}

### What happens when you click

```mermaid
sequenceDiagram
    participant You
    participant Dirol as Dirol app
    participant Keeper as Dirol keeper
    participant Chain as Monad

    You->>Dirol: Click Buy / Sell
    Dirol->>Keeper: Signed swap intent (token, amount, min-out)
    Keeper->>Chain: Submit swap from your account (using your grant/session)
    Chain-->>Keeper: Confirmed
    Keeper-->>Dirol: Result (tx hash, filled amount)
    Dirol-->>You: Done ✅ (no popup)
```

Your app sends a **swap intent** — what you want to trade, how much, and your minimum acceptable output. The keeper executes it on-chain from your account using the permission you granted, then returns the confirmed result (typically a few seconds). You never sign the trade itself.

The intent always carries a **minimum output**: if the price moves past your slippage tolerance, the trade reverts instead of filling at a bad price.

### Security model

* **Non-custodial.** No private keys are ever shared. Permissions are standard on-chain grants (ERC-7715 for MetaMask, an OneClickModule session for others).
* **Capped & time-boxed.** The keeper can never move more than your cap, and only until your session/grant expires.
* **Keeper-scoped.** The permission only lets the keeper call Dirol's swap contracts inside your account, and Dirol's backend enforces that the delegate is the keeper and that there's at most one active grant per account.
* **Revocable anytime.** Revoke the session or approvals whenever you want, and one-click stops immediately.

### DCA & limit orders

DCA recurring buys and limit-order fills run through the same one-click keeper path — that's how they execute automatically without you signing each one. They rely on the same session/grant, caps, and expiry described above.

### Fees

One-click swaps carry a small convenience fee (0.10% on major tokens, 0.20% on memecoins), already netted into your quote. See Fees for the full breakdown.
