@mmt-finance/clmm-sui-sdk
v1.0.0
Published
Momentum SDK to access the Momentum CLMM
Keywords
Readme
MMT Finance CLMM SDK
@mmt-finance/clmm-sui-sdk is the official TypeScript SDK for integrating with
MMT Finance CLMM for developers. Please visit
MMT Developer Docs
for detailed guideline.
Getting Started
Installation
npm i @mmt-finance/clmm-sui-sdkConfiguration
Our SDK has pre-configured network settings that allows you to connect to MMT CLMM on both mainnet and testnet. You can utilize the src/sdk NEW method to swiftly initialize the configuration.
import { MmtSDK } from '@mmt-finance/clmm-sui-sdk';
const mmtClmmSDK = new MmtSDK({
network: 'mainnet',
});Now, you can start using MMT SDK.
Supported Features
- Retrieve pool data
- Retrieve user data
- Swap
- Open and Add Liquidity
- Position Management
- Claim Fees and Rewards
- Close Position
For a full detailed technical integration doc, please visit MMT Developer Docs.
Examples
A comprehensive set of examples has been provided to demonstrate the fundamental usage of the SDK. Please refer to the detailed guidelines for further information example
Development Guidelines
To ensure the quality, maintainability, and consistency of the SDK, we follow a strict set of development guidelines. All contributors are expected to adhere to these standards.
1. Code Style & Linting
We enforce code style using ESLint (based on Airbnb config) and Prettier.
- Linting: Run
yarn run lintto check for issues. - Formatting: Run
yarn run prettier:fixto automatically format code. - IDE Setup: Configure your editor to run Prettier on save and display ESLint errors.
2. Naming Conventions
- Files: kebab-case (e.g.,
pool-utils.ts,clmm-sdk.ts). - Classes/Interfaces/Types: PascalCase (e.g.,
ClmmSdk,PoolConfig). - Variables/Functions: camelCase (e.g.,
getPoolData,tokenAmount). - Constants: UPPER_SNAKE_CASE for global constants (e.g.,
MAX_TICK_INDEX). - Private Members: Private functions or properties should start with
_(e.g.,_internalCalculate).
3. Function Parameters
- Object Params: Use an object (interface) for arguments if a function takes more than 3 parameters.
4. Git & Commits
We use husky & commitlint.
Format: <type>(<scope>): <description>
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- chore: Changes to the build process or auxiliary tools
Example: feat(pool): add support for fetching tick data
