Swap KAS and kUSDT
KasPool is a KAS⇄kUSDT pool on Kaspa L1. It holds a reserve of KAS and a reserve of kUSDT and prices every swap by the constant-product rule: after a swap, the product of the two reserves may not shrink. Each swap is a single Kaspa transaction.
How a swap works
Section titled “How a swap works”- Get a quote. Your app reads the pool’s current state: the KAS reserve X and the kUSDT reserve Y.
- Build the transaction. The app builds a transaction that spends the pool UTXO, the pool’s kUSDT reserve and your own coins, and names the exact amount you receive.
- Sign and submit. Your wallet signs your inputs. The pool covenant accepts the transaction only if the reserves after the swap satisfy the constant-product rule with the fee applied.
Price and fee
Section titled “Price and fee”Every swap pays 0.50 % of its input: 0.45 % stays in the pool for liquidity providers, 0.05 % accrues to the protocol. The best amount a swap can return is:
effective = floor(input × 9 950 / 10 000)output = floor(reserve_out × effective / (reserve_in + effective))For a buy, the input is KAS, reserve_in is X and reserve_out is Y. For a sell, the input is kUSDT,
reserve_in is Y and reserve_out is X. Asking for one base unit more than this quote is rejected.
| Pool | You send | You receive (quote) |
|---|---|---|
| 10 000 KAS and 1 000 kUSDT | 100 KAS | about 9.85 kUSDT |
A round trip (KAS to kUSDT and back) returns a little less than you started with, about the 1 % paid in fees. You also pay the normal Kaspa network fee in KAS. The wallet shows about how much before you swap, at the feerate its Kaspa node names, and sends nothing if the node names more than half as much again by the time the swap is built. Nor does it send a swap that would leave the network change too small to keep (under 0.2 KAS, more at a high feerate) beyond what was shown: it tries other coins, or asks you to merge your KAS or change the amount a little. A buy of Max keeps 0.3 KAS for the fee, and the fee row then says “up to 0.3 KAS”.
No sandwiching, no slippage after signing
Section titled “No sandwiching, no slippage after signing”A swap transaction spends the exact pool UTXO it was built on and names the exact amount you receive. Three things follow:
- Nobody can worsen your price after you sign. If another swap lands first, it spends that pool UTXO. Your transaction then becomes invalid, rather than executing at a worse price.
- You may need to retry. In a busy moment your app may have to re-quote and re-sign against the new pool state.
- The wallet asks before a worse price. It goes ahead on its own only if the new quote is at least as good as the one you confirmed. Your slippage minimum stays the hard floor. kUSDT Wallet asks in its own window.
Selling kUSDT
Section titled “Selling kUSDT”A sell is the mirror image. Your kUSDT state is an input, any remaining kUSDT returns to you as change, and the KAS goes to an output you choose.
A very small sale can be refused. The network keeps change only from 0.2 KAS up, and the wallet’s builders leave less than that to the network fee. When you sell a part of a kUSDT state and hold no other KAS, what the sale brings is that change: if less than 0.2 KAS of it is left after the network fee, all of it would go to the fee. The wallet refuses such a sale before it signs anything and says why. Sell more, sell all of that kUSDT (the 1.5 KAS under it then comes back with the proceeds), or hold some KAS first. It also refuses a sale whose network fee is as large as what the sale brings.
The sell limit
Section titled “The sell limit”To bound a dump of forged kUSDT, the KAS sells take out of the pool, less what buys bring in, may be at most 10 % of its KAS reserve per hour (the circuit breaker). Buys are not limited, and each buy gives sells back the KAS it brought. If your sell is over what is left, the app tells you that the pool lets at most so much KAS out until about a given time. Sell less, or wait for the next window.
When the pool is paused
Section titled “When the pool is paused”The bridge’s guardian pauses the pool on any alarm, with the vaults and the minter. While it is paused:
| Stops | Keeps working |
|---|---|
| Buys, sells and adding liquidity | Removing liquidity: you can always withdraw your Position |
Only the pool admin resumes it.
Providing liquidity
Section titled “Providing liquidity”Anyone can add KAS and kUSDT in the current ratio and receive a Position: a covenant UTXO that records liquidity shares and the key that owns them. Burning the Position returns at most its share of each reserve. The owner can transfer a Position to another key. See KasPool for the exact rules.