swap fee: our cut of each swap, shown in the preview, taken atomically #82

Open
opened 2026-10-09 10:08:10 +00:00 by grenade · 0 comments
Owner

Part of #71. Operator decision 2026-10-09: the sponsor (#81) is paid for by a fee on swaps, at or below the official Quantus wallet's 0.5%.

  • 1Click legs: appFees: [{recipient, fee}] in the quote request (basis points of amountIn, paid to an Intents account; pinned spec AppFee). 1Click deducts it, and the quote already reflects it.
  • Pool legs (Ref DCL): the fee is an mt_transfer of the input token to the recipient, in the same transaction as the swap's ft_withdraw. Both are actions to intents.near, so they succeed or fail together; the fee is never taken without the swap.
  • Bridge legs and plain deposits or withdrawals: no fee.
  • The rate and recipient come from the sponsor's terms (GET /v1/near/sponsor), not from the binary, so they can change without a release. The wallet refuses to proceed if the terms are unreadable, or name a rate above a ceiling compiled into it (50 bps).
  • The preview (#78) shows the fee as its own line: amount and percentage.

Operator-owned: the rate (≤ 50 bps), and the recipient account (the sponsor itself, or a fees. sub-account).

Part of #71. Operator decision 2026-10-09: the sponsor (#81) is paid for by a fee on swaps, at or below the official Quantus wallet's 0.5%. - **1Click legs:** `appFees: [{recipient, fee}]` in the quote request (basis points of `amountIn`, paid to an Intents account; pinned spec `AppFee`). 1Click deducts it, and the quote already reflects it. - **Pool legs (Ref DCL):** the fee is an `mt_transfer` of the input token to the recipient, in the **same transaction** as the swap's `ft_withdraw`. Both are actions to `intents.near`, so they succeed or fail together; the fee is never taken without the swap. - **Bridge legs and plain deposits or withdrawals:** no fee. - **The rate and recipient** come from the sponsor's terms (`GET /v1/near/sponsor`), not from the binary, so they can change without a release. The wallet refuses to proceed if the terms are unreadable, or name a rate above a ceiling compiled into it (50 bps). - **The preview (#78)** shows the fee as its own line: amount and percentage. Operator-owned: the rate (≤ 50 bps), and the recipient account (the sponsor itself, or a `fees.` sub-account).
grenade added the child label 2026-10-09 10:08:10 +00:00
grenade referenced this issue from a commit 2026-10-09 21:39:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blackbeard/wallet#82