9 releases (5 breaking)

new 0.6.1 Apr 27, 2025
0.6.0 Apr 20, 2025
0.5.1 Apr 20, 2025
0.4.0 Mar 24, 2025
0.1.1 Dec 30, 2024

#191 in Magic Beans

Download history 10/week @ 2025-01-07 1/week @ 2025-01-14 115/week @ 2025-01-21 3/week @ 2025-01-28 143/week @ 2025-02-04 6/week @ 2025-02-11 5/week @ 2025-02-18 1/week @ 2025-02-25 2/week @ 2025-03-04 1/week @ 2025-03-11 79/week @ 2025-03-18 43/week @ 2025-03-25 12/week @ 2025-04-01 26/week @ 2025-04-08 393/week @ 2025-04-15 95/week @ 2025-04-22

527 downloads per month

MIT license

265KB
6K SLoC

Uniswap V4 SDK Rust

Rust CI docs.rs crates.io

A Rust SDK for building applications on top of Uniswap V4. Rewrite of the TypeScript V4 SDK.

It is feature-complete but missing unit tests.

Features

  • Opinionated Rust implementation of the Uniswap V4 SDK with a focus on readability and performance

  • Usage of alloy-rs types

  • Consistent API and types with the V3 SDK and SDK Core

  • An extensions feature for additional functionalities related to Uniswap V4, including:

Supported Rust Versions (MSRV)

The current MSRV (minimum supported rust version) is 1.83.

Getting started

Add the following to your Cargo.toml file:

uniswap-v4-sdk = { version = "0.6.0", features = ["extensions", "std"] }

Usage

The package structure follows that of the TypeScript SDK, but with snake_case instead of camelCase.

For easy import, use the prelude:

use uniswap_v4_sdk::prelude::*;

Note on no_std

By default, this library does not depend on the standard library (std). However, the std feature can be enabled.

Contributing

Contributions are welcome. Please open an issue if you have any questions or suggestions.

Testing

Tests are run with

cargo test

Linting

Linting is done with clippy and rustfmt. To run the linter, use:

cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all -- --check

License

This project is licensed under the MIT License.

Acknowledgements

This project is inspired by and adapted from the following projects:

Dependencies

~8–21MB
~310K SLoC