@meteora-ag/dynamic-bonding-curve-sdk 1.5.13 → 2.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/CHANGELOG.md +718 -0
- package/README.md +16 -7
- package/dist/chunk-IRVDOLO7.cjs +2024 -0
- package/dist/chunk-IRVDOLO7.cjs.map +1 -0
- package/dist/chunk-P4K4GKFH.js +2024 -0
- package/dist/chunk-P4K4GKFH.js.map +1 -0
- package/dist/index.cjs +16819 -26959
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +815 -20956
- package/dist/index.d.ts +815 -20956
- package/dist/index.js +17139 -27279
- package/dist/index.js.map +1 -1
- package/dist/math.cjs +125 -0
- package/dist/math.cjs.map +1 -0
- package/dist/math.d.cts +216 -0
- package/dist/math.d.ts +216 -0
- package/dist/math.js +125 -0
- package/dist/math.js.map +1 -0
- package/dist/swapQuote-CURAm57K.d.cts +6608 -0
- package/dist/swapQuote-CURAm57K.d.ts +6608 -0
- package/docs.md +7200 -0
- package/package.json +17 -5
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Meteora Dynamic Bonding Curve SDK
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A TypeScript SDK for interacting with the Dynamic Bonding Curve on Meteora.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
This SDK provides a set of tools and methods to interact with the [Meteora Dynamic Bonding Curve](https://github.com/MeteoraAg/dynamic-bonding-curve). It
|
|
7
|
+
This SDK provides a set of tools and methods to interact with the [Meteora Dynamic Bonding Curve](https://github.com/MeteoraAg/dynamic-bonding-curve). It lets developers create and manage dynamic bonding curves with custom configurations and fee structures.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -30,6 +30,15 @@ const client = new DynamicBondingCurveClient(connection, 'confirmed')
|
|
|
30
30
|
|
|
31
31
|
Refer to the [docs](./docs.md) for how to use the functions.
|
|
32
32
|
|
|
33
|
+
The package root exports the client, the curve builders, quotes, parameter builders, and address derivations. The ports of the program's curve, fee, and swap math (dynamic-bonding-curve 0.2.2) are published under a separate entry:
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import {
|
|
37
|
+
getFeeMode,
|
|
38
|
+
getSwapResult,
|
|
39
|
+
} from '@meteora-ag/dynamic-bonding-curve-sdk/math'
|
|
40
|
+
```
|
|
41
|
+
|
|
33
42
|
## Flow
|
|
34
43
|
|
|
35
44
|
The generic flow of how Dynamic Bonding Curve works is as follows:
|
|
@@ -37,7 +46,7 @@ The generic flow of how Dynamic Bonding Curve works is as follows:
|
|
|
37
46
|
1. The partner creates a config key for the pool.
|
|
38
47
|
2. The creator creates a pool.
|
|
39
48
|
3. The pool is tradeable on the Dynamic Bonding Curve.
|
|
40
|
-
4. Meteora's migrator service migrates the pool to DAMM V2 based on the config key once the quote reserve
|
|
49
|
+
4. Meteora's migrator service migrates the pool to DAMM V2 based on the config key once the quote reserve reaches the migration quote threshold. Existing DBC pools created with `MigrationOption.MET_DAMM` can still graduate to DAMM V1; new configs and new pools cannot use that option.
|
|
41
50
|
5. The graduated pool is tradeable on DAMM V2. Existing DAMM V1-graduated pools remain tradeable on DAMM V1.
|
|
42
51
|
|
|
43
52
|
## Flow of migration
|
|
@@ -55,7 +64,7 @@ The generic flow of how Dynamic Bonding Curve works is as follows:
|
|
|
55
64
|
1. `createLocker` (if the token has locked vesting)
|
|
56
65
|
2. `migrateToDammV2`
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
## Test
|
|
59
68
|
|
|
60
69
|
1. Run solana localnet validator
|
|
61
70
|
|
|
@@ -70,16 +79,16 @@ pnpm start-validator
|
|
|
70
79
|
pnpm test
|
|
71
80
|
```
|
|
72
81
|
|
|
73
|
-
|
|
82
|
+
## Manual Migrator
|
|
74
83
|
|
|
75
84
|
We have created a [Manual Migrator UI](https://migrator.meteora.ag) that allows you to manually migrate a pool to either DAMM V1 or DAMM V2. Compatible with both Mainnet and Devnet pools.
|
|
76
85
|
|
|
77
|
-
|
|
86
|
+
## Program Address
|
|
78
87
|
|
|
79
88
|
- Mainnet-beta: dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN
|
|
80
89
|
- Devnet: dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN
|
|
81
90
|
|
|
82
|
-
|
|
91
|
+
## Graduated DAMM Pool Config Keys
|
|
83
92
|
|
|
84
93
|
Accessible via `DAMM_V1_MIGRATION_FEE_ADDRESS[i]` in the SDK.
|
|
85
94
|
|