#amm #soroban #wasm #no-std #soroswap

no-std soroswap-library

Library that enables efficient and optimized code execution across different contracts on the Soroswap.Finance protocol

14 releases (1 stable)

1.0.21 Jul 25, 2024
0.3.0 Feb 6, 2024
0.2.4 Dec 11, 2023
0.1.1 Oct 16, 2023
0.0.6 Oct 16, 2023

#4 in #amm

Download history 104/week @ 2024-07-21 54/week @ 2024-07-28 14/week @ 2024-09-15 6/week @ 2024-09-22 9/week @ 2024-09-29

608 downloads per month

GPL-3.0 license

38KB
451 lines

The Soroswap Library

Library that enables efficient and optimized code execution across different contracts on the Soroswap.Finance protocol.

This can be used as a Library Contract that can be deployed in the Soroban Blockchain or as a crate in your contract

Check https://crates.io/crates/soroswap-library

Usage as a crate

1.- Add this to your Cargo.toml:

[dependencies] soroswap-library = ""

2.- Import it:

use soroswap_library;

3.- Use it:

let quote = soroswap_library::quote(amount_a, reserve_a, reserve_b)

How to publish:

https://doc.rust-lang.org/cargo/reference/publishing.html

cargo login
cargo publish --dry-run
cargo publish

Examples

Acknowledgements

This library was inspired by the UniswapV2Library: https://github.com/Uniswap/v2-periphery/blob/master/contracts/libraries/UniswapV2Library.sol

WASM

The WASM target wasm32-unknown-unknown is supported.

Contributions

Contributions are welcome

Licence

This library is released under the GPL-3.0 License.

Dependencies

~11–15MB
~313K SLoC