How Sells Work
A NAKA sell redeems tokens for ETH from the hook's reserve, at a rate determined by the curve's current state. Sells continue to function even after self-deprecation. Only the buy path closes once issuance ends.
Two-Step Flow (First Time)
The first sell from any wallet is two transactions:
- Approve the router to spend NAKA:
naka.approve(router, amount). - Sell:
router.sellNaka(tokensIn, minEthOut).
Subsequent sells from the same wallet skip step 1 unless the previous approval has been used up. The frontend at naka.exchange detects this automatically and shows approve naka or sell naka accordingly.
What Happens On-Chain
- Wallet signs the sell call.
- Router transfers
tokensInfrom the user to the hook (using the prior approval). - Hook computes ETH out by walking the inverse curve from
totalMintedFairdown by the proportional amount. - 30 bps of
tokensInare sent to0xdEaD(permanent burn). The user does not pay this fee in ETH; it comes out of the tokens being sold. - The remaining 99.70% of tokens are burned, and the corresponding ETH is transferred from the reserve to the seller.
- The hook updates
totalMintedFair -= ethOutand the reserveactualEthBalance -= ethOut. Sell(user, tokensIn, ethOut, tokensLocked)event is emitted.
If minEthOut is not met, the entire transaction reverts.
Slippage
The frontend hardcodes 2% slippage on sells, mirroring the buy path: minEthOut = quotedEthOut · 9800/10000. Same protections apply. Same-block ordering, MEV.
Anti-Flip Cooldown
The hook implements a cooldown to mitigate same-block buy/sell exploits. After a buy from a given account, the same account cannot sell within COOLDOWN_BLOCKS blocks. This prevents specific MEV patterns where an attacker buys, manipulates a downstream price oracle, and sells in the same block.
The cooldown does not affect normal users. Most retail flows are minutes apart, not blocks apart. It only constrains adversarial scripts.
Reserve-Backed Execution
Sells are paid out of the hook's ETH reserve. The reserve is sized by every prior buy's ETH input minus prior sells' ETH output. As long as the reserve is non-zero, sells execute at the curve's prevailing rate.
The reserve cannot be drained outside the sell path. There is no admin withdrawal, no emergency pause, no operator extraction.
Receiving ETH
ETH arrives in the seller's wallet within the same transaction. No claim, no vest. The transferred amount is ethOut from the event log, post-fee.