project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4

AutoSwapper

A multisig plugin that automatically swaps your tokens by computing the optimal path offchain

AutoSwapper

Created At

ETHOnline 2023

Winner of

🥉 Safe — Best Use of Safe{Core} Protocol

Project Description

The current liquidity pool landscape is so vast, that optimising path between all the pools has become too computationally intensive to perform onchain. Aggregators such as 1inch solve this problem by moving pathfinding offchain, but this now means swaps can no longer be initiated from onchain; the product resides in web2 land.

Using Chainlink Functions, we call our own custom built API endpoint that performs the resource intensive path-finding offchain. The result is then encoded into a blog of bytes and sent back to the blockchain. Here, the AutoSwapperModule now is able to perform the most optimal path for its tokens.

By adding Chainlink Keepers to this, we can now automatically perform these swaps (e.g. at regular intervals, or at a certain threshold).

How it's Made

Chainlink Functions:

  • Needs to be aware of the arguments needed for the swapping intention (a target Safe multisig address, chain id, token out)
  • Calls the endpoint and returns the response on-chain to enable the swap execution

Chainlink Keeper:

  • Keepers are watching subscribed Safe address to initiate the necessary functions
  • Leverage Chainlink Functions to call the web2 API endpoint

Safe Protocol Compliance:

  • The entire system adheres to the principles of the Safe Protocol white paper, ensuring all Safe multisigs can benefit from the auto swap feature by enabling the SmartGardenManager

Instructions and Execution:

  • The endpoint returns the instructions, outlining the steps needed for the swap
  • Once these instructions are transmitted onto the blockchain, it triggers the autonomous execution of the targeted swap via fulfillRequest
background image mobile

Join the mailing list

Get the latest news and updates