Margin trading
How leverage, take-profit, liquidations, funding and lending work on Atomic Launchpad V2.
Overview
After graduation every V2 token gets an isolated lending pool. On the token page you can open a long or a short with x1.1 to x10 leverage. Every trade is a real swap in the token's Uniswap v4 pool through our hook: no oracle and no synthetic price.
The key piece is the liquidation book in the hook: the hook does not let the price pass a liquidation level until the positions at that level are sold. The level is set when a position opens, from the permanently locked liquidity, so that the sale plus the trader's collateral always repays the loan. Losses are covered by the trader's collateral; lenders get back what they lent at any price move.
V1 and V2
| V1 | V2 | |
|---|---|---|
| What it is | Launches and spot trading, no leverage | Launches plus margin trading and lending |
| Contracts | The current stack, unchanged | A new stack: its own hook, factory, executor, Locker, trading and lending |
| Tokens | Tokens launched on V1 stay on V1 without leverage | New launches on V2 |
| Site | launch.atomic.green | launch.atomic.green/v2, with its own pages and these docs |
The V1 / V2 switch in the header moves between versions and remembers your choice. The V1 docs are here.
When leverage opens
Leverage opens after graduation, as soon as the token's snipe-tax window is over. If the token graduated earlier, leverage waits for the end of the window; the token page shows a countdown and then a Leverage available badge. There is no separate liquidity threshold: the contract computes the maximum leverage for each position, and thin pools simply get a small one.
Opening a position
Example: long x5 with 0.1 ETH of margin.
- You deposit 0.1 ETH.
- 0.5 ETH is borrowed from the lending pool (size = 5 × 0.1).
- The 0.5 ETH buys tokens through the hook. Fees are charged on the full size and taken from your margin (see Fees).
- The rest of the margin stays on the contract in ETH as collateral. It does not fall with the token price.
- The tokens go into the v4 pool as a range above the current price: this is your take-profit.
- The hook records the position in the liquidation book at the level computed for it.
A short is symmetric: tokens are borrowed and sold, and the ETH is placed in a range below the price (take-profit on the way down).
Fees
Opening a position pays, on the full size (margin × leverage):
- the hook fee, 1%;
- the creator tax the token's creator set, 0–10%;
- the pool's LP fee, 0.25%;
- funding, paid ahead for the position's term (see Funding).
Because the entry fee comes out of the margin, a high creator tax eats a large part of it at high leverage:
| Leverage | Tax 0% (fee 1%) | Tax 3% (4%) | Tax 5% (6%) | Tax 10% (11%) |
|---|---|---|---|---|
| x2 | 2% of margin | 8% | 12% | 22% |
| x5 | 5% | 20% | 30% | 55% |
| x10 | 10% | 40% | 60% | more than the margin |
(Hook fee and creator tax only; the 0.25% LP fee adds 0.25% × leverage.) Less collateral after entry puts the liquidation level closer, so a high tax also lowers the maximum leverage.
Take-profit
Your tokens sit in the v4 pool as liquidity above the price. When the price passes the range, the pool itself sells them to buyers: no keeper and no oracle, and the fill cannot be faked. Once the whole position has turned into ETH, the loan goes back to the lending pool and the remainder plus your collateral wait for you to claim them. Anyone may close a filled position for a small bounty, so it does not turn back into tokens if the price comes back down.
The buyer who takes tokens out of your range pays the hook fee, so exiting through take-profit costs you no fee. You choose the range type and the target:
Wide range (from entry to the target) sells at the average price √(entry · target), so profit at the target is smaller than for a plain long. Long x5 on 0.1 ETH, range [×1; ×3]:
| Price | Range [×1; ×3] | Plain long x5 | Profit on 0.1 ETH (range / plain) |
|---|---|---|---|
| ×1.5 | 0.690 ETH | 0.750 ETH | +190% / +250% |
| ×2 | 0.797 ETH | 1.000 ETH | +297% / +500% |
| ×3 | 0.866 ETH | 1.500 ETH | +366% / +1000% |
(Position value before the 0.5 ETH loan is repaid.)
Narrow range at the target (for example [×2.9; ×3]) works like a limit sell near ×2.95: profit at ×3 is about +975%, almost a plain long.
| Wide | Narrow | |
|---|---|---|
| Profit at the target | smaller (down to about a third at ×3) | almost full |
| On the way up | part is already in ETH, leverage falls by itself | all in tokens until the target |
| Depth for buyers | a sell wall across the range | only at the target |
Closing by hand
You can close at any time on the Positions page: the hook removes your range, sells the remaining tokens with a swap through the hook (the hook fee applies), repays the loan and leaves the remainder and your collateral to claim. It is an ordinary sale, so it goes through the book and can trigger liquidations of other positions below.
Liquidation book
On ordinary margin venues one large sale can drop the price 30–50% in a single transaction; between blocks there is nothing to liquidate and lenders take the loss. V2 avoids this because the token's price is set only by our pool, every swap goes through our hook, and the graduation liquidity is locked forever.
Positions are grouped in buckets by liquidation price (tick grid, ~1% steps).
beforeSwap: if the swap moves the price through the nearest level,
move the price to the level
sell the bucket's tokens starting exactly at its level
repeat for the next levels
then fill the rest of the user's swapThe price cannot pass a liquidation level until its bucket is sold. A trade that triggers liquidations fills after them at a worse price; the quote shows it and the usual minOut protects it.
The level is computed when the position opens, for the worst case: only the locked Locker liquidity is in the pool, every bucket above sells together, no fees. It is the highest price at which, in that case, sale proceeds + collateral ≥ debt + 30% of the collateral. The 30% is a buffer for lenders, so the loss is always covered by the collateral. On liquidation the whole collateral is kept: what the sale and the collateral leave after the debt and the keeper's bounty goes to the protocol, and the trader gets nothing back.
Example: 20 ETH of quote in the Locker; a bucket with 1 ETH size, 1 ETH loan and 0.2 ETH collateral (x5).
| Condition | Sale price vs entry |
|---|---|
| Proceeds + collateral just cover the debt (proceeds ≥ 0.8 ETH) | −16% |
| Debt covered with a buffer of 30% of the collateral (proceeds ≥ 0.86 ETH) | ≈ −10%: the liquidation level |
At −10% the bucket sells before any other trade. The lender gets 1 ETH back in any market; the trader's 0.2 ETH collateral is kept, and what is left after the debt goes to the protocol.
Maximum leverage
The maximum is the highest leverage at which the liquidation level exists and is at least 5% from the entry price. It depends on the Locker's depth and the position's size: the larger the position relative to the pool, the more its sale moves the price. The slider on the token page takes the value from the contract, not from these tables.
Maximum leverage (hook fee 1%, creator tax 0, no buckets above):
| Quote in Locker | Size 0.1 ETH | Size 0.5 ETH | Size 2 ETH |
|---|---|---|---|
| 2 ETH | x6.3 | x2.8 | x1.3 |
| 5 ETH | x8.3 | x4.6 | x2.1 |
| 20 ETH | x9.8 | x7.8 | x4.6 |
| 50 ETH | x10 | x9.2 | x6.8 |
| 100 ETH | x10 | x9.8 | x8.3 |
Distance to liquidation for a long x5 of 0.5 ETH:
| Quote in Locker | 2 ETH | 5 ETH | 20 ETH | 50 ETH | 100 ETH |
|---|---|---|---|---|---|
| Liquidation on a drop of | x5 not allowed | 3.9% (closer than 5%, x5 not allowed) | 10.4% | 11.6% | 12.0% |
- Small tokens get small leverage or none; no manual threshold is needed.
- The more positions are already open above the price, the lower the maximum for a new one: they are part of the worst-case cascade.
- Depth comes only from the Locker. Traders' take-profit ranges add depth but are not counted.
Funding
| Part | Who pays | To whom |
|---|---|---|
| Borrow rate | Everyone who borrowed, on the debt | The lending pool |
| Skew premium | The bigger side (long or short) | The lending pool |
The borrow rate has a kink at 70% utilization U = lent / supplied:
U ≤ 70%: rate = 5% + 15% · U / 70% (APR) U > 70%: rate = 20% + 300% · (U − 70%) / 30% (up to 320% APR at U = 100%)
Skew premium: k · |skew|, where skew = (OI long − OI short) / (OI long + OI short). At launch 0.02% per hour at full skew, capped at 0.05% per hour.
Funding is paid ahead for the position's term (7 days, renewable). The debt stays fixed, so the liquidation level does not move over time. The leverage panel shows the prepaid amount before you open.
Lending pools
- At graduation 20% of the raised funds go to the token's isolated lending pool and 80% to the v4 pool, locked forever in the Locker.
- The pool is open to everyone: ETH or USDC for longs, tokens for shorts. A holder can lend tokens and earn without selling.
- The 20% from graduation belong to nobody and stay in the pool for good; their share of income accrues in the pool.
- Lenders earn the borrow rate and the skew premium. Position losses are covered by traders' collateral, not by lenders.
Lend on the Lend page.
Withdrawals
A withdrawal is a request: it waits 24 hours and pays out at the lower of the value at request and at execution. Only the free (not lent) part of the pool can be withdrawn. This keeps lenders from running from a pool just before it is needed.
Risks
- Leverage multiplies losses: a liquidation keeps the whole collateral, nothing is returned to the trader.
- A wide take-profit range gives up a large part of the profit at the target.
- Sellers who cross liquidation levels get a worse price: they pay for the liquidations they trigger.
- A large sale across many buckets costs more gas; if the book cannot execute, the swap reverts rather than leaving lenders a loss.
Formulas
M — margin, L — leverage, N = L·M — size (all borrowed), f — trade fee (hook + creator tax), Q — quote reserve in the Locker, P — price.
- Collateral after entry: C = M − f·N (minus prepaid funding).
- Debt: N.
- Selling V into an x·y=k pool with quote reserve Q: proceeds = Q·V / (Q + V).
- Quote reserve of the locked full-range position at price Pₜ: Qₜ = Q·√(Pₜ / P).
- Liquidation level: the highest Pₜ with Qₜ·Vₜ / (Qₜ + Vₜ) + C ≥ debt + 0.3·C, Vₜ — value at Pₜ of this bucket and all above it.
- Maximum leverage: the highest L ≤ 10 whose level exists and is at least 5% from entry.
- Average sale price in a range [Pₐ; P_b]: √(Pₐ·P_b).
Quotes and integrations
A pool with open positions can liquidate buckets inside a swap, so a quote computed locally from ticks can be wrong. Quote by simulation (V4Quoter or eth_call) and estimate gas the same way. A pool with no open positions behaves exactly like a V1 pool.
Contracts
V2 contracts (hook with the liquidation book, trading, isolated lending pools and their factory) are not deployed yet. Addresses, ABI and events will be listed here after the Sepolia deployment.

