Skip to content

Commit

Permalink
feat: Create Meteora pools (#203)
Browse files Browse the repository at this point in the history
# Pull Request Description
This PR helps to create Meteora Dynamic and DLMM pool with prompt.

## Related Issue
Fixes # (issue number)

## Changes Made
This PR adds the following changes:
<!-- List the key changes made in this PR -->
- 
- 
  
## Implementation Details
<!-- Provide technical details about the implementation -->
- The agent kit uses the functions from the `dynamic-amm-sdk` and the
`dlmm-sdk` to create Meteora pools.
- Both the tools to create pools have the parameter
`computeUnitMicroLamports` to allow user inputs the priority fee so that
the transaction can be landed faster.

## Transaction executed by agent 
<!-- If applicable, provide example usage, transactions, or screenshots
-->
Example transaction: 
- Create Meteora Dynamic pool:
https://solscan.io/tx/3g1NEaiLAmrdewxTMP861MzZiubGs1K52PuADQpngX7frpABugUv1UfdKsyqFtvBjGcHqFW9wASMGtL8itADHujG
- Create Meteora DLMM pool:
https://solscan.io/tx/2zA6vzGAZZy3yQR9ZRNYw478gKtYLQpguiFAvbsedE7Sii65AVpoXM1YqQe3x1KsRxfqkqhZBdDaHpQ9hoq2hrZF

## Prompt Used
<!-- If relevant, include the prompt or configuration used -->
- Prompt to create Meteora Dynamic pool:
```
create meteora dynamic pool
```
- Prompt to input Dynamic pool params:
```
tokenAMint DVMkqJAx16dHV29RtHrFLe7VzbWCG64KCFfzgWQYvbVn tokenBMint So11111111111111111111111111111111111111112 tokenAAmount 100 tokenBAmount 0.01 tradeFeeNumerator 2500
```

- Prompt to create Meteora DLMM pool:
```
create meteora dlmm pool
```
- Prompt to input DLMM pool params:
```
tokenAMint DVMkqJAx16dHV29RtHrFLe7VzbWCG64KCFfzgWQYvbVn tokenBMint So11111111111111111111111111111111111111112 binStep 20 initialPrice 0.25 feeBps 20
```

## Additional Notes
<!-- Any additional information that reviewers should know -->

## Checklist
- [x] I have tested these changes locally
- [ ] I have updated the documentation
- [x] I have added a transaction link
- [x] I have added the prompt used to test it
  • Loading branch information
thearyanag authored Jan 17, 2025
2 parents 68cb11b + 89aed54 commit 54382a5
Show file tree
Hide file tree
Showing 19 changed files with 1,105 additions and 155 deletions.
123 changes: 123 additions & 0 deletions examples/discord-bot-starter/.eslintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
module.exports = {
env: {
es2021: true,
node: true,
},
root: true,
settings: {
'import/resolver': {
typescript: {},
},
},
ignorePatterns: [
'.eslintrc.js',
'webpack.config.js',
'dist/*',
'**/*.js',
'node_modules/*',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
project: 'tsconfig.json',
tsconfigRootDir: '.',
sourceType: 'module',
},
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
'plugin:sonarjs/recommended',
'plugin:security/recommended',
'plugin:promise/recommended',
'prettier',
],
plugins: [
'@typescript-eslint/eslint-plugin',
'sonarjs',
'security',
'promise',
'prettier',
],
rules: {
semi: [2, 'always'],
quotes: [1, 'single', { allowTemplateLiterals: true }],
curly: [2, 'all'],
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-misused-promises': [
'error',
{ checksVoidReturn: false },
],
'security/detect-non-literal-regexp': 0,
'security/detect-object-injection': 0,
'promise/always-return': 0,
'promise/no-callback-in-promise': 0,
'sonarjs/cognitive-complexity': [2, 50],
'sonarjs/no-duplicate-string': 0,
'sonarjs/no-useless-catch': 1,
'sonarjs/no-nested-template-literals': 0,
'sonarjs/prefer-single-boolean-return': 1,
'sonarjs/no-small-switch': 'off',
'@typescript-eslint/no-unused-vars': [
1,
{ argsIgnorePattern: '^_|^returns$|^of$|^type$' },
],
'import/extensions': 'off',
'import/no-import-module-exports': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-dynamic-require': 'off',
'prettier/prettier': [
'error',
{
useTabs: false,
arrowParens: 'always',
printWidth: 80,
singleQuote: true,
trailingComma: 'all',
endOfLine: 'auto',
bracketSpacing: true,
},
{
usePrettierrc: false,
},
],
'no-restricted-imports': [
'error',
{
patterns: ['**/dist/**'],
},
],
'no-use-before-define': 'off',
'no-console': 'off',
'no-return-await': 'off',
'consistent-return': 'off',
'default-case': 'off',
'no-fallthrough': 'off',
'no-plusplus': 'off',
'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'no-continue': 'off',
'no-nested-ternary': 'off',
'no-void': 'off',
'no-param-reassign': 'off',
'class-methods-use-this': 'off',
'no-return-assign': 'off',
'no-case-declarations': 'off',
'global-require': 'off',
'security/detect-non-literal-require': 'off',
'global-require': 'off',
},
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
"@metaplex-foundation/umi": "^0.9.2",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
"@metaplex-foundation/umi-web3js-adapters": "^0.9.2",
"@mercurial-finance/dynamic-amm-sdk": "^1.1.19",
"@meteora-ag/alpha-vault": "^1.1.7",
"@meteora-ag/dlmm": "^1.3.0",
"@onsol/tldparser": "^0.6.7",
"@orca-so/common-sdk": "0.6.4",
"@orca-so/whirlpools-sdk": "^0.13.12",
Expand Down
Loading

0 comments on commit 54382a5

Please sign in to comment.