Atomic Ninja

Atomic is a transaction batcher, that will execute several actions within one atomic transaction, including performing flashloans, flashswaps, token transfers and much more.

Demo Video Live Demo Source Code

Description

Atomic Ninja is a tool for sending atomic transactions to Ethereum. The money lego analogy has been used several times to describe how Defi (and Ethereum as whole) gains from interoperability, but some of the most interesting blocks were previously available to a select few that possess the technical skills necessary to use them. This is where Atomic Ninja comes in, we leveraged the great work by Google and MIT on Blockly and Scratch Blocks to build a tool for interacting with well known and loved lego pieces from several Defi dapps. The goal was to make interacting with them as easy as child's play, much like legos.

How It's Made

We started with just one smart contract, that would send one transaction after another on behalf of the user. The atomic functionality is still contained in a single contract, but we also had to develop a proxy contract for all "sandwich" blocks, or blocks that need to handle a callback like flashloans. We used Buidler to perform tests, also using a fork from the mainnet in Ganache. For the UI we forked scratch-blocks, and tweaked for our needs (removing all blocks provided by the library and adding our own, plus some other small mods). We made those changes with extensibility in mind. Each block lives in a single JS file, the way we envision this in the future is that companies will pull request blocks that use their platforms. We also of course used Ethers JS extensively for encoding a bunch of data and any interaction with Web3, and our choice of wallet was Portis. Currently there are bocks for ETH transfers, ERC20 Transfers, Uniswap swap (V1 and V2) and flashswap, Aave flashloan, Compound supplying and borrowing, Pooltogether, Defi Zaps, Balancer and an ENS resolver. The dapp was deployed to IPFS (it's serverless) and is served through the Cloudflare public gateway at https://atomic.ninja

Team

Fabio Hildebrand
← click here to see all projects