Uniswap V3

These integrations provide users with an additional layer of privacy when handling their funds and performing trades via 3rd party liquidity protocols. All transactions on-chain appear to be performed solely by the singularity contract making identification of traders behind actions such as large buy or sell orders via Uniswap more challenging.

Swap

A trader generates a proof that encompasses their signature and gives permission for the singularity to exchange the value tied to a note for another asset via Uniswap.

Signature comes from cryptographically signing a message with the parameters:

[
    in_note,              // Note being spent
    in_nullifier,         // Corresponding nullifer to the note being spent
    out_note_footer,      // Note footer for newly formed note
    out_asset,            // Address of the asset being received in exchange
    pool_fee,             // Pool fee of the swap (Uniswap)
    amount_out_min,       // Minimum qty of the asset being received in exchange
    relayer               // Gas fee for the relayer
]

“I warrant for in_note to be spent and swapped out for a minimum of amount_out_min qty of out_asset stored as a newly created out_note that I own.”

Right now the Singularity provides support for single swaps that are performed via the exactInputSingle method call on the Uniswap V3 ISwapRouter interface.

Liquidity Provision Management

The Singularity allows traders to create and manage Uniswap V3 LP positions anonymously. Ownership of LP positions are tracked in the Singularity using notes in the form of NFTs that Uniswap issues for LP positions.

Initially, Singularity provides support for users to:

  • Provision liquidity

  • Collect fees on existing liquidity positions

  • Remove liquidity

Last updated