project screenshot 1
project screenshot 2
project screenshot 3

Sparky

A coincidence-of-wants swap implementation for Starknet. It should reduce fees by matching orders

Sparky

Created At

StarkHack

Project Description

A coincidence-of-wants swap implementation for Starknet. It should reduce fees by matching orders with different direction, and batching user's orders into a single transaction. The original CoW protocol uses the single service to rate and compare solver's strategies, but this implementation was intended to use an L3 appchain for publishing the batches, receiving solvers' strategies and rating them automatically. The smart contracts on L3 receive proof of price from Starknet oracle like Pragma, controls that solvers provide the same or better prices, then choose the best strategy and issue the "proof of best strategy" that can be used on Starknet to execute the swap. The other idea is that not only plain ERC20 token swaps may participate in transactions, but any other actions that can be expressed as "intent message", that consists of intent type (string), expiry date, account address and application-specific data.

How it's Made

This project uses Starknet-scaffold as a template, which is using Starknet Foundry and Next.js under the hood. Unfortunately I didn't finished it, so I'll describe how it was supposed to be made. Users of this swap sign SNIP-12 messages to express their trading intent. This messages are collected by the system to form a batch, which is then finalized on reaching the threshold age. Then different solvers compete to provide the best strategy for executing the batch. They can combine different orders with the same assets, forming rings or chains, and use external AMMs for sourcing liquidity.

background image mobile

Join the mailing list

Get the latest news and updates