Mainnet goes live Wed 21 Oct, 13:00 UTC.

See the countdown

How it works

Private swaps

Swap one token for another straight from your private balance, on Robinhood Chain and Tempo mainnet. Who swapped stays private. The tokens and the amounts are public, like any trade on a DEX.

Where
RH + Tempo mainnet
Who swapped
Private
Amounts
Public
Sent by
The Gloam relay

How a swap works

One swap, one transaction
Step 1Out of the vaultThe vault releases one of your private notes to a one-time escrow address, made for this swap alone.
Step 2Swap on a DEXThe swap router buys an exact amount of the other token on a public DEX: Uniswap v4 on Robinhood Chain, Tempo's stablecoin exchange on Tempo.
Step 3Back in the vaultThe output goes straight back into the vault as a new private note that only you know.

All three steps run in one transaction. If any step fails, the whole swap reverts and nothing moves.

The Gloam relay sends the transaction and pays its network fee, so your wallet never signs it or shows up next to it. Swaps always go through the relay. Sending one from your own wallet would put your wallet right next to the swap, so the app does not offer it.

What you can swap

ChainPairsWhere it trades
Robinhood ChainUSDG and $GLOAMUniswap v4, in two hops through ETH, or the direct USDG and $GLOAM pool when it pays more
TempoUSDC.e, pathUSD, USDT0 and OUSD, any one for anotherTempo's stablecoin exchange

An example on Tempo: 1 pathUSD gets about 0.9964 USDC.e, after the vault fee and the price buffer below. Prices move, so the app always shows the live quote.

Swaps are on mainnet only. The testnets have no swap router. Stock tokens stay on Robinhood Chain testnet and cannot be swapped.

What stays private and what is public

Private:

  • Who swapped. The Gloam relay sends it, so your wallet never shows.
  • Which private balance it came from. The proof shows you own a note in the vault, not which one.
  • Where the new balance goes next. It is a fresh note only you know.

Public:

  • The two tokens and the two amounts, as with any trade on a DEX.
  • When it happened, and that it went through the Gloam swap router.

On the explorer, one swap shows as the relay calling the router, the vault paying a one-time escrow address, a trade on the DEX, and a deposit from the router back into the vault. A private swap hides you, not the trade.

Keep a swap from linking back to you

  • Don't swap exactly what you deposited. A swap the same size as a recent deposit is easy to match to it. Swap a different amount.
  • Don't cash out exactly what you received. A cash out of the swap's exact output can be matched to the swap. Send it on, or cash out a different amount.
  • Mind the crowd. The mainnet vaults are new, so there are few notes to hide among for now.

One note per swap

Your private balance can be made of several notes: each deposit, payment you claimed, or change from a payment is its own. A swap spends exactly one of them.

So Max is your largest single note, not your whole balance. When your balance is in several parts, the app says how much one swap can take. Swap the rest in a second swap.

Swap less than a note and the app first sets that part aside in a note of its own, privately and through the relay. The rest stays in your private balance. The app picks the note that matches your amount exactly, or else the smallest one that covers it.

What it costs

  • Vault fee, 0.25% of the amount you swap. A swap takes the note out of the vault the same way a cash out does, so the vault keeps its usual cash-out fee.
  • Price buffer, 0.5% on Robinhood Chain and 0.1% on Tempo. The swap asks for a little less than the quote, so a small price move before it lands does not make it fail. Whatever the trade does not use goes to the Gloam treasury.
  • Pool fees are already in the quoted price.
  • Network fee: the relay pays it.

Open Details under the rate to see each part before you swap: what you receive, the vault fee, the price buffer, the route, and who sends it.

The amount shown is the least you get. The quote refreshes every 15 seconds, and the app prices the swap once more just before it goes. If the price moved your way, you get the better amount. If it moved against you by more than the buffer, the swap does not go through and nothing moves.

Beta deposit limits apply to what lands, because the new note is a deposit. One swap brings in at most 500 of a stablecoin, or 25,000 $GLOAM, and only while the vault has room under its total.

If a swap can't finish

Once a swap is sent, its proofs are public. Anyone can copy its first step, the release from the vault, and send it on its own. That makes the swap fail on purpose. It cannot send your money anywhere else.

Here is why. The escrow address is worked out from everything the swap must do: the note spent, your new note, a refund note and the route. Only the router can open it, and only to put the money back into the vault for you.

So the money comes back to your private balance as a refund note, made in advance with the swap. You get back 99% of the note. The other 1% covers the vault's cash-out fee (0.25% today), and what is left of it goes to the Gloam treasury. The app finishes the refund by itself, through the relay, the next time it syncs your balance.

If a swap simply doesn't go through, for example because the price moved past the buffer, nothing moved and your money is safe in the vault. Refresh in a minute, then get a new quote.

A swap that didn't go through isn't cancelled, though. Its proofs stay valid, so anyone can send it again, and it lands if the price comes back within the buffer. It can only land exactly as you made it: the same output, into your new note. The app keeps that note until the chain settles it and counts it the moment it lands. Spending the same money on anything else, such as a new swap, a send or a cash-out, ends the old swap for good.

What the router can and cannot do

  • No owner, no admin, no upgrade. The routers have no settings anyone can change after deploy.
  • Fixed venues. On Robinhood Chain the router only uses three Uniswap v4 pools fixed when it was deployed. On Tempo it only uses Tempo's stablecoin exchange.
  • Exact output or nothing. The router checks that it got the full amount of your new note and paid no more than arrived from the vault. Otherwise the whole swap reverts.
  • The vault is unchanged. The mainnet vault still has no swap code. The router uses only its normal calls: release a note with a proof, and deposit with a proof.
  • Not audited. The routers were reviewed internally before deploy. An external audit is planned, as for the vault.

The full list of risks is in the threat model.

Contracts

  • Robinhood Chain router (GloamVaultSwapV4), 0x34AB06208586A737Bf1607fa996Bc9162271c52d
  • Tempo router (GloamVaultSwapTempo), 0xfCa1887e77f738ef9C5751974b3f3873d029F2DC
  • Vault, the same address on both chains, 0x39e28cde55cab798874746ac52cb4b5cc99a0194
  • Treasury, where unused input goes, fixed in both routers, 0xB3900ac9350903218e4c7597bAb0f008F01B30B8

The old sealed trade

Private swaps replace the first private trade design, the sealed swap. That one is retired and stays off. See sealed trade (retired).

Try it

In the app, open Vault > Swap on a mainnet. Connect a wallet and you can check prices before you have a private balance. To swap, first add one of the tokens above in Add. See also what stays private and networks.