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

no-std soroswap-library

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

13 unstable releases (3 breaking)

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

#2631 in Magic Beans

Download history 5/week @ 2023-12-18 1/week @ 2023-12-25 6/week @ 2024-01-15 11/week @ 2024-02-05 15/week @ 2024-02-19 32/week @ 2024-02-26 26/week @ 2024-03-04 23/week @ 2024-03-11 200/week @ 2024-03-18 124/week @ 2024-04-01

348 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

~13MB
~280K SLoC