Acuity Atomic Swap DEX begins public testing

Posted July 14, 2022 by Jonathan Brown ‐ 5 min read

On July 11th 2022 the first cross-chain trade on Acuity Testnet occurred between Estonia and Vietnam. 0.02 Rinkeby was bought with 0.002 Ropsten. The Acuity Atomic Swap DEX is ready for general testing.

The DEX has a unique design in that it is a cross-chain exchange that is fully autonomous. Typically cross-chain exchanges require centralized coordination systems to operate. This leads to various problems such as downtime and increased attack surface.

Because Acuity DEX is fully autonomous (like an on-chain smart contract) it is not susceptible to these issues.

How does it work?

There is no backend whatsoever. The web app connects to the Acuity blockchain and all the chains you wish to trade on. It maintains permanent connections for monitoring via Websockets. Transactions are broadcast via the Polkadot and Metamask browser extensions.

Traders set their account name on the Acuity blockchain.

Traders prove that they are in control of their accounts on other blockchains by publishing those account addresses on the Acuity blockchain and publishing their Acuity address on the other blockchains.

The seller must stash what they want to sell in the Acuity Atomic Swap smart contract on the selling chain. If they wanted to sell ETH for AVAX, they stash their ETH in the ETH / AVAX pair. For each pair the contract maintains a linked list of stashes with the largest first. This is the decentralized sell order discoverability mechanism. With a simple query to the smart contract the app can find the largest sellers for a pair. Spammers will be relegated to the bottom of the list and ignored.

The seller publishes their sell quantity and price for the pair on the Acuity blockchain. ACU transactions are extremely cheap so the sell order can be modified very cheaply.

When a buyer wishes to purchase from the sell order they create a buy lock in the smart contract on the buy chain for the correct amount. Only the buyer knows the secret. The hash of the secret is known publically.

The seller then creates a buy lock in the smart contract on the selling chain using the hash of the secret, moving the funds from the stash.

Both the buyer and the seller have now created their locks, but only the buyer knows the secret.

The buyer then unlocks the sell lock with the secret, taking what has been sold. In doing so they reveal the secret meaning that the seller can then unlock the buy lock, taking what was used to pay for the purchase.

At no point was there any counterparty risk because if either party fails to fulfill their part of the deal, the other party can just wait for the lock to time out and get their funds back.

The whole process can be seen in this technology preview video.

Fees

Because the DEX is fully autonomous, there are no fees being paid out to centralized entities. Blockchain transaction fees need to be paid for:

  • Stashing on the sell chain.
  • Setting sell orders on Acuity.
  • Creating and unlocking locks on the buy chain.
  • Creating and unlocking locks on the sell chain.

Help us test the DEX

Before we can launch with mainnet trading, the web app requires testing and further development. If you would like to test the DEX web app and experience the future of fully decentralized autonomous cross-chain trading, please join our Acuity Trading Telegram group and let yourself be known. You will be provided with some Test ACU. Visit the web app at: https://dex.acuity.social/. You'll need to install both the Polkadot and MetaMask browser extensions. The following testnets are currently supported:

  • Ropsten
  • Rinkeby
  • Görli
  • Kovan
  • Moonbase Alpha
  • Avalanche Fuji
  • Polygon Mumbai
  • Arbitrum Nitro

Future Features

  • Enable trading of ACU. As Acuity is a Substrate blockchain the Acuity Atomic Swap pallet needs to be updated before ACU can be traded on the DEX.
  • ERC20 support: currently only the base coin of each blockchain can be traded. The ERC20 variant of our atomic swap smart contract will need to be finished. This will enable all tokens on all Ethereum-compatible blockchains to be traded autonomously.
  • There needs to be a hot wallet within the web app. This will automate the whole trading process, creating and unlocking locks as necessary.
  • Market price determination. The app needs to be able to determine the current market price of an asset by examining recent trades within the user's trust network.
  • The web app will be available via IPFS.
  • The app will also be available as a desktop app.
  • Intra-chain trading.
  • NFT trading.