Skip to content

invariant-labs/protocol-sonic

Repository files navigation

⚡Invariant protocol⚡

DISCORD 🌐 |

Invariant protocol is an AMM built on Sonic, leveraging high capital efficiency and the ability to list markets in a permissionless manner. At the core of the DEX is the Concentrated Liquidity mechanism, designed to handle tokens compatible with the SPL token and Token 2022 standards. The protocol is structured around a single contract architecture.

🔨 Getting Started

Prerequisites

Rust & Cargo

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Solana

sh -c "$(curl -sSfL https://release.anza.xyz/v1.18.18/install)"

Anchor

cargo install --git https://github.com/coral-xyz/anchor avm --force
avm install 0.29.0
avm use 0.29.0

Build protocol

  • Clone repository
git clone [email protected]:invariant-labs/protocol-sonic.git
  • Build contract
npm run program
  • Run tests
cargo test

Typescript SDK

Utilize the Invariant SDK from the npm registry by including it as a dependency. Alternatively, for a customized approach, build the SDK on your own using the commands provided below:

To begin, navigate to the directory dedicated to the SDK

  • Build SDK
cd ./sdk
npm i
npm run build
  • Run e2e tests
npm run test:all

Check out the sdk usage guide