A collection of libraries to be implemented for Automated Market Makers built in Sway.

Related tags

Cryptography amm
Overview

πŸͺ“ 🌴 Executor AMM πŸͺ“ 🌴

The Executor AMM is a reference implementation of Concentrated Liquidity in Sway. To run on the FuelVM many modifications had to be made, specifically around the typing of many variables. The design expectation of this AMM is that tokens on the FuelVM would use 8 decimal precision, and store balances in a u64.

Type Table

This Table keep tracks of which types which changed and why

Orginal Variable Type New Type Reasoning
Reserve{0,1} uint128 u64 Max Integer Size to Store token balances, planned to support 8 decimal tokens which use u64 for token balances
liquidity uint128 U128 Since Liquidity = x * y, if both x and y are reserves, then if both are max u64, liquidity could be up to U128
price uint160 Q64x64 Since price is originally a Q64.96, it's scaled down to a Q64.64, represents sqrt of price, since Q64.64 has more the enough integer precision, makes it easier to scale back up, and decimal is still very very accurate on numbers where balances are represented as u64

Library Reference

Exeggutor requires many new additions of libraries to be built, and so docs and descriptions of each of these libraries are included below.

dydx_math

A library used to determine token amounts from a pure liquidity number (amount0 * amount1), and liquidity from amounts. Also for general change within a tick math.

full_math

A library to compute multiplication/division with complete accuracy by upcasting to a higher precision before performing calculations.

i24

Concentrated Liquidity requires an i24 to represent ticks, because with every value in i24 a tick can represnet a change in basis point.

Q64x64

The Q64x64 library is a library for basic handling of Fixed-Point numbers, with 64 bits for the integer, and 64 bits for decimal. Used to store price and do other partial values.

Q128x128

The Q128x128 library is a library for basic handling of Fixed-Point numbers, with 128 bits for the integer, and 128 bits for decimal. Mostly used for when math is needed with more precision than a Q64.64.

swap_lib

A swap_lib to just perform fee calculations for concentrated liquidity, and take into account but protocol fees and liquidity provider fees.

tick_math

Another math library to determine tick value from price, and price from tick.

You might also like...
rust-native-tls β€” Bindings for native TLS libraries

rust-native-tls Documentation An abstraction over platform-specific TLS implementations. Specifically, this crate uses SChannel on Windows (via the sc

Collect libraries and packages about cryptography in Rust.

Awesome Cryptography Rust Collect libraries and packages about cryptography in Rust. Collection Library Symmetric Public-key / Asymmetric One-way Hash

Rust starter project for building CLI and libraries, with great CI
Rust starter project for building CLI and libraries, with great CI

Using the starter project: find where bumblefoot is and replace it with the name of your project. $ rg bumblefoot This is a dual library and binary pr

Collection of cryptographic hash functions written in pure Rust

RustCrypto: hashes Collection of cryptographic hash functions written in pure Rust. All algorithms reside in the separate crates and implemented using

Dank - The Internet Computer Decentralized Bank - A collection of Open Internet Services - Including the Cycles Token (XTC)
Dank - The Internet Computer Decentralized Bank - A collection of Open Internet Services - Including the Cycles Token (XTC)

Dank - The Internet Computer Decentralized Bank Dank is a collection of Open Internet Services for users and developers on the Internet Computer. In t

The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime.

Solana Program Library The Solana Program Library (SPL) is a collection of on-chain programs targeting the Sealevel parallel runtime. These programs a

A guide for Mozilla's developers and data scientists to analyze and interpret the data gathered by our data collection systems.

Mozilla Data Documentation This documentation was written to help Mozillians analyze and interpret data collected by our products, such as Firefox and

Multilayered Linkable Spontaneous Anonymous Group - Implemented as is from paper. Not Monero specific

MLSAG This is a pure Rust implementation of the Multilayered Linkable Spontaneous Anonymous Group construction. This implementation has not been revie

Collection of stream cipher algorithms

RustCrypto: stream ciphers Collection of stream cipher algorithms written in pure Rust. ⚠️ Security Warning: Hazmat! Crates in this repository do not

Owner
Sway Libraries
Common libraries to build your own Sway contracts.
Sway Libraries
Automated security testing for open source libraries and applications.

autovet continuously searches for security breaches in open source libraries and applications. Recently processed packages package version channel las

null 5 Aug 23, 2022
multi-market crank for serum-dex

A performance and cost optimized serum-dex crank that allows combining multiple market cranking instructions into a single transaction, while concurrently generating the crank instructions allowing for increased throughput.

SolFarm 33 Nov 23, 2022
Crib - Extensible, Minimal Template for Sway Projects

crib β€’ Extensible, Minimal Template for Sway Projects. Developing First Time? New to rust? Install with: curl --proto '=https' --tlsv1.2 -sSf https://

velleity.eth 17 Jul 31, 2022
Extensible, Minimal Template for Sway Projects

crib β€’ Extensible, Minimal Template for Sway Projects. Developing First Time? New to rust? Install with: curl --proto '=https' --tlsv1.2 -sSf https://

andreas 17 Jul 31, 2022
Simple automated proof assistant.

Esther is a work-in-progress, proof-of-concept automated theorem proof assistant based on Homotopy Type Theory. Acknowledgements Arend, Lean, Coq and

Aodhnait Γ‰taΓ­n 5 Sep 14, 2021
An automated CLI tool that optimizes gas usage in Solidity smart contracts, focusing on storage and function call efficiency.

Solidity-Gas-Optimizoor An high performance automated CLI tool that optimizes gas usage in Solidity smart contracts, focusing on storage and function

Chia Yong Kang 10 Mar 11, 2024
Automated Solana tool for quick arbitrage, customizable, with real-time data and wallet integration. Trade responsibly.

Solana Arbitrage Trading Tool The Solana Arbitrage Trading Tool is an automated solution crafted to spot and capitalize on arbitrage opportunities wit

null 43 Mar 12, 2024
CosmWasm-Examples is a collection of example contracts and applications built using the CosmWasm framework

CosmWasm-Examples is a collection of example contracts and applications built using the CosmWasm framework. CosmWasm is a secure and efficient smart contract platform designed specifically for the Cosmos ecosystem.

Vitalii Tsyhulov 20 Jun 9, 2023
Built for Perpetual Protocol v2 Curie on Optimism chain. This CLI tool was built with Rust.

Perpetual Protocol CLI for Perp v2 Curie This tool is to provide a simple, fast and efficient way to interact Perpetual Protocol contracts from your t

Brendan Wenzel 4 Jan 11, 2023
rust client libraries to deal with the current cardano mainnet (byron / cardano-sl)

Rust implementation of Cardano primitives, helpers, and related applications Cardano Rust is a modular toolbox of Cardano’s cryptographic primitives,

Input Output 275 Oct 9, 2022