PepecoinArcade
@ Create a new account

Swaps between chains: how a trade works here

docs/swaps.md

Jump to: The short version · Step by step · Why it is safe to close the page · What it costs · Listing your own swap · Taking a swap · Limits worth knowing

The Exchange lets you swap coins, tokens and NFTs between two different chains (Pepecoin for Dogecoin, for example) with somebody on any arcade, without trusting them, the arcade you use, or theirs. Nobody ever holds your coins: every swap is settled by lock scripts on both chains.

Swaps on a single chain (a token for PEP, an NFT priced in a token) do not need any of this. They settle instantly in one transaction on that chain's own market: the seller signs their half ahead of time and the buyer completes it.

The short version

Step by step

Say Alice lists 1,000 PEP for 300 DOGE and Bob takes it.

Because Bob can only take the PEP by revealing the secret, and the secret is all Alice needs to take the DOGE, the two claims stand or fall together. Alice's lock runs out before Bob's, so she always has time to claim after he does, and neither side can take the other's coins and keep their own.

Why it is safe to close the page

When your browser locks your coins it also signs, right away, the two transactions that finish your side: the claim of the other lock and the refund of your own. It hands them to your arcade node, which sends:

Your node cannot change either one: your signature covers where the coins go, and they can only go to you. All it adds is the secret, which by then is public.

What it costs

Whoever locks a side pays its fees, on top, so the other side receives exactly what was agreed:

You see these amounts before you say yes. Saying yes to Take, or to List, also approves locking your side when the time comes; you are not asked again.

Listing your own swap

On the Exchange, under Swaps between arcades (or on a coin pair's market, such as PEP/DOGE), choose what you offer and what you want. Your listing shows on other arcades while an arcade page is open in your browser; close them all and it stops being shown within the hour. Withdraw it whenever you like.

When somebody takes it, your browser checks that their terms match yours exactly, locks your side once theirs is confirmed, and hands your node the claim and refund. You can close the page after that.

Taking a swap

Press Take (or Buy / Sell on a market). Your browser makes the secret and proposes the swap to the lister. Nothing is locked until they accept. Then your side is locked, and the swap finishes by itself.

Limits worth knowing

← all docs