Skip to main content

Quick start

Setting Up

For any help/setup questions, feel free to ask in # ❓┆questions on Discord!

Installation

Requires Anchor and Solana's web3.js library to be installed.

npm i @invariant-labs/sdk

Usage

import { Market, Pair } from '@invariant-labs/sdk'

Program IDs

EndpointProgram ID
DevnetD8Xd5VFXJeANivc4LXEzYqiE8q2CGVbjym5JiynPCP6J
Mainnet48XDC18nH5FLq8kKfE6MJK2hcPFD7xsJQc4dSAgQWNAi

Data structures are an exact mapping, with the only changes being type and case. Methods called by a user have a corresponding method, that creates instructions, adds them to transaction, signs, and sends it. All methods (including ones used only by admin) have corresponding methods that return just the instruction.

Before you begin making your first pool and position, you must first construct the market as shown below.

const market = await Market.build([Network.MAIN | Network.DEV], provider.wallet, connection)