Magma Developer SDK
  • Getting started
  • Prerequisites
  • Features Available
  • Retrieve clmm pools
  • Retrieve positions
  • Retrieve reward
  • Retrieve ticks
  • Create clmm pool
  • Open position
  • Add liquidity
  • Remove liquidity
  • Close position
  • Collect fees
  • Collect rewards
  • Preswap
  • Swap
  • Partner swap
  • Smart router
  • Price impact
  • Minimum received & Maximum sold
  • Fee
  • Liquidity correlation calculation
  • APR correlation calculation
Powered by GitBook
On this page
  • 1. NPM install
  • 2. Setting Up Configuration

Prerequisites

1. NPM install

npm i @magmaprotocol/magma-clmm-sdk

2. Setting Up Configuration

Magma Typescript SDK includes a default initialization method that allows for quick generation of the Magma SDK configuration. You can utilize the src/config/initMagmaSDK method to swiftly initialize the configuration. You have the option to select either 'mainnet' or 'testnet' for the network.

import { initMagmaSDK } from '@magmaprotocol/magma-clmm-sdk'
const magmaClmmSDK = initMagmaSDK({network: 'mainnet})

If you wish to set your own full node URL and simulate address, you can do so as follows:

import { initMagmaSDK } from '@magmaprotocol/magma-clmm-sdk'

const network = 'mainnnet';
const fullNodeUrl = "https://..."
const simulationAccount = "0x..."
const magmaClmmSDK = initMagmaSDK({network, fullNodeUrl, simulationAccount})

Now, you can start using Magma SDK!

PreviousGetting startedNextFeatures Available

Last updated 4 months ago