Skip to content

Manahip/liquidswap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Liquidswap

Liquidswap is AMM protocol for Aptos blockchain.

We support two curves:

  • For uncorrelated swaps.
  • For stable swaps.

The current repository contains:

  • Low level core.
  • Base router.
  • Scripts.
  • Tests.

Add as dependency

Update your Move.toml with

[dependencies.Liquidswap]
git = 'https://github.com/pontem-network/liquidswap.git'
rev = 'v0.3.0'

[dependencies.TestCoins]
git = 'https://github.com/pontem-network/test-coins.git'
rev = 'v0.1.0'

And use in code:

use liquidswap::router;
use liquidswap::curves::Uncorrelated;

use test_coins::coins::{USDT, BTC};

...
let usdt_coins_to_get = 5292719411;
let btc_coins_to_swap_val = router::get_amount_in<BTC, USDT, Uncorrelated>(usdt_coins_to_get);
let btc_coins_to_swap = coin::withdraw<BTC>(account, btc_coins_to_swap_val);

let (coin_x, coin_y) = router::swap_coin_for_exact_coin<BTC, USDT, Uncorrelated>(
    btc_coins_to_swap,
    usdt_coins_to_get
);

Build

Aptos CLI required:

aptos move compile

Test

aptos move test

Security Audits

Look at section in our doc.

License

See LICENSE

About

AMM core smart contracts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Move 100.0%