#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

16 releases (3 stable)

new 2.0.0 Dec 18, 2024
1.0.22 Dec 17, 2024
1.0.21 Jul 25, 2024
0.3.0 Feb 6, 2024
0.0.6 Oct 16, 2023

#62 in Magic Beans

32 downloads per month

GPL-3.0 license

42KB
481 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
~317K SLoC