@meteora-ag/dynamic-bonding-curve-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/dist/index.cjs +14641 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5024 -0
- package/dist/index.d.ts +5024 -0
- package/dist/index.js +14641 -0
- package/dist/index.js.map +1 -0
- package/docs.md +317 -0
- package/eslint.config.mjs +4 -0
- package/package.json +46 -0
- package/src/client.ts +1848 -0
- package/src/common.ts +275 -0
- package/src/constants.ts +42 -0
- package/src/derive.ts +488 -0
- package/src/design.ts +394 -0
- package/src/idl/damm-v1/idl.json +4615 -0
- package/src/idl/damm-v1/idl.ts +1158 -0
- package/src/idl/damm-v2/idl.json +6322 -0
- package/src/idl/damm-v2/idl.ts +5224 -0
- package/src/idl/dynamic-bonding-curve/idl.json +5351 -0
- package/src/idl/dynamic-bonding-curve/idl.ts +4428 -0
- package/src/idl/dynamic-vault/idl.json +1723 -0
- package/src/idl/dynamic-vault/idl.ts +295 -0
- package/src/index.ts +7 -0
- package/src/math/curve.ts +230 -0
- package/src/math/feeMath.ts +286 -0
- package/src/math/safeMath.ts +88 -0
- package/src/math/swapQuote.ts +464 -0
- package/src/math/utilsMath.ts +154 -0
- package/src/types.ts +465 -0
- package/src/utils.ts +252 -0
- package/tests/math/curveMath.test.ts +79 -0
- package/tests/math/feeMath.test.ts +22 -0
- package/tests/math/feeMode.test.ts +97 -0
- package/tests/math/pool.test.ts +46 -0
- package/tests/math/swapQuote.test.ts +248 -0
- package/tests/utils/defaults.ts +90 -0
- package/tests/utils/test-helpers.ts +110 -0
- package/tsconfig.json +10 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Meteora Dynamic Bonding Curve SDK
|
|
2
|
+
|
|
3
|
+
A Typescript SDK for interacting with the Dynamic Bonding Curve on Meteora.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This SDK provides a set of tools and methods to interact with the [Meteora Dynamic Bonding Curve](https://github.com/MeteoraAg/ts-sdk/tree/main/packages/dynamic-bonding-curve). It enables developers to easily create and manage dynamic bonding curves, with support for custom configurations and fee structures.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm install @meteora-ag/dynamic-bonding-curve-sdk
|
|
13
|
+
# or
|
|
14
|
+
yarn add @meteora-ag/dynamic-bonding-curve-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Initialization
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
import { Connection } from "@solana/web3.js";
|
|
21
|
+
import { DynamicBondingCurveClient } from "@meteora-ag/dynamic-bonding-curve-sdk";
|
|
22
|
+
|
|
23
|
+
const connection = new Connection('https://api.mainnet-beta.solana.com')
|
|
24
|
+
const client = new DynamicBondingCurveClient(connection)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Test
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun install
|
|
31
|
+
bun test
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Program Address
|
|
35
|
+
|
|
36
|
+
- Mainnet-beta: virEFLZsQm1iFAs8py1XnziJ67gTzW2bfCWhxNPfccD
|
|
37
|
+
- Devnet: virEFLZsQm1iFAs8py1XnziJ67gTzW2bfCWhxNPfccD
|
|
38
|
+
|
|
39
|
+
### Config key for migration
|
|
40
|
+
|
|
41
|
+
#### DAMM V1:
|
|
42
|
+
|
|
43
|
+
- migration_fee_option == 0: EtwbXRxV8b46Vkho5EhMshi9qEU7xv6sMQnPHK3fX8WR
|
|
44
|
+
- migration_fee_option == 1: VEtZapzJXreco3cbzUT8ZszawsRvRRQzGN5GBaCMwWh
|
|
45
|
+
- migration_fee_option == 2: 8z2tYtwiAkby1tMSdf1hG2Ni8MFBk43o9tYey5zegNDh
|
|
46
|
+
- migration_fee_option == 3: 3BuQgW3g75azhKeE3yzaqeWkmwezuDGwF6FT5py3mFrt
|
|
47
|
+
|
|
48
|
+
#### DAMM V2:
|
|
49
|
+
|
|
50
|
+
- migration_fee_option == 0: 96gRhsiKyBJnXT2GxEnh54b9YLjzpEJ4aTetvLmQ5tWj
|
|
51
|
+
- migration_fee_option == 1: 3GZLmQJ98xPRLNJjofzK3bfvhU11WFCiZJhEuPwgfBHb
|
|
52
|
+
- migration_fee_option == 2: 7aqweHmWjiMJEVzTXjvpEasRiDQSK79GNWPqjbkeWtyL
|
|
53
|
+
- migration_fee_option == 3: 6ym6zMi5RqUH3k2BNdiXUtSdpeypdWMLsxTyRhKqzhz2
|