diff --git a/examples/discord-bot-starter/.eslintrc.ts b/examples/discord-bot-starter/.eslintrc.ts new file mode 100644 index 00000000..a8917ae2 --- /dev/null +++ b/examples/discord-bot-starter/.eslintrc.ts @@ -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', + }, +}; diff --git a/package.json b/package.json index 26e2604c..661c9834 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2b643242..d105bbb5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: '@3land/listings-sdk': specifier: ^0.0.6 - version: 0.0.6(@types/node@22.10.5)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + version: 0.0.6(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) '@ai-sdk/openai': specifier: ^1.0.11 version: 1.0.11(zod@3.24.1) @@ -28,7 +28,7 @@ importers: version: 2.107.0-beta.3(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) '@drift-labs/vaults-sdk': specifier: ^0.2.49 - version: 0.2.49(@types/node@22.10.5)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(utf-8-validate@5.0.10) + version: 0.2.49(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(utf-8-validate@5.0.10) '@langchain/core': specifier: ^0.3.26 version: 0.3.27(openai@4.77.3(zod@3.24.1)) @@ -47,6 +47,9 @@ importers: '@lightprotocol/stateless.js': specifier: ^0.17.1 version: 0.17.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@mercurial-finance/dynamic-amm-sdk': + specifier: ^1.1.19 + version: 1.1.23(@solana/buffer-layout@4.0.1)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) '@metaplex-foundation/mpl-core': specifier: ^1.1.1 version: 1.1.1(@metaplex-foundation/umi@0.9.2)(@noble/hashes@1.7.0) @@ -65,6 +68,12 @@ importers: '@metaplex-foundation/umi-web3js-adapters': specifier: ^0.9.2 version: 0.9.2(@metaplex-foundation/umi@0.9.2)(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@meteora-ag/alpha-vault': + specifier: ^1.1.7 + version: 1.1.7(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@meteora-ag/dlmm': + specifier: ^1.3.0 + version: 1.3.8(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) '@onsol/tldparser': specifier: ^0.6.7 version: 0.6.7(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bn.js@5.2.1)(borsh@2.0.0)(buffer@6.0.3)(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -143,7 +152,7 @@ importers: version: 5.0.1 '@types/node': specifier: ^22.10.2 - version: 22.10.5 + version: 22.10.7 '@typescript-eslint/eslint-plugin': specifier: ^8.18.2 version: 8.19.0(@typescript-eslint/parser@8.19.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2) @@ -158,13 +167,13 @@ importers: version: 9.1.0(eslint@8.57.1) eslint-plugin-prettier: specifier: ^5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2) + version: 5.2.2(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2) husky: specifier: ^9.1.7 version: 9.1.7 lint-staged: specifier: ^15.3.0 - version: 15.3.0 + version: 15.4.1 prettier: specifier: ^3.4.2 version: 3.4.2 @@ -603,8 +612,8 @@ packages: '@ethersproject/wordlists@5.7.0': resolution: {integrity: sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==} - '@gerrit0/mini-shiki@1.26.1': - resolution: {integrity: sha512-gHFUvv9f1fU2Piou/5Y7Sx5moYxcERbC7CXc6rkDLQTUBg5Dgg9L4u29/nHqfoQ3Y9R0h0BcOhd14uOEZIBP7Q==} + '@gerrit0/mini-shiki@1.27.2': + resolution: {integrity: sha512-GeWyHz8ao2gBiUW4OJnQDxXQnFgZQwwQk05t/CVVgNBN7/rK8XZ7xY6YhLVv9tH3VppWWmr9DCl3MwemB/i+Og==} '@grpc/grpc-js@1.12.5': resolution: {integrity: sha512-d3iiHxdpg5+ZcJ6jnDSOT8Z0O0VMVGy34jAnYLUX8yd36b1qn8f1TwOA/Lc7TsOh03IkPJ38eGI5qD2EjNkoEA==} @@ -765,6 +774,23 @@ packages: '@lightprotocol/stateless.js@0.17.1': resolution: {integrity: sha512-EjId1n33A6dBwpce33Wsa/fs/CDKtMtRrkxbApH0alXrnEXmbW6QhIViXOrKYXjZ4uJQM1xsBtsKe0vqJ4nbtQ==} + '@mercurial-finance/dynamic-amm-sdk@1.1.19': + resolution: {integrity: sha512-e828SZkwSdzLKrQjOyr+/dyKdLKebwwR+rQj/CC3m3HvzaM1E1PgAaafjv4C/Z4eTR1TVdCNIq5p2bJtEDTPiQ==} + peerDependencies: + '@solana/buffer-layout': ^3 || ^4 + + '@mercurial-finance/dynamic-amm-sdk@1.1.23': + resolution: {integrity: sha512-bI1X+785iqGiys5iLbuI6G1oGSP5crE1Taw2HEFIhKGbEssi6nRHVI9F6YyZbKq00PKKi8DjFoVAwN7J3RNmPg==} + peerDependencies: + '@solana/buffer-layout': ^3 || ^4 + + '@mercurial-finance/token-math@6.0.0': + resolution: {integrity: sha512-/o2Kr+gXXE4UvkBJ4QLcbiBmKUyBvU1C0tty6y4smJxEItJYiH6yQzRSWpkBhP5Q387n/j05nqoizX4uZkBlwg==} + engines: {node: '>=10'} + + '@mercurial-finance/vault-sdk@2.2.0': + resolution: {integrity: sha512-Q6Ejkl/mDXR+d4K1p9TL0FJ8p18hQH2rUwPwq+1twLxoHvmHeHM+9bfU3iMLQ+odcC6vh3LXBiMEBdyzgMGXlg==} + '@metaplex-foundation/beet-solana@0.3.1': resolution: {integrity: sha512-tgyEl6dvtLln8XX81JyBvWjIiEcjTkUwZbrM5dIobTmoqMuGewSyk9CClno8qsMsFdB5T3jC91Rjeqmu/6xk2g==} @@ -913,6 +939,22 @@ packages: '@metaplex-foundation/umi@0.9.2': resolution: {integrity: sha512-9i4Acm4pruQfJcpRrc2EauPBwkfDN0I9QTvJyZocIlKgoZwD6A6wH0PViH1AjOVG5CQCd1YI3tJd5XjYE1ElBw==} + '@meteora-ag/alpha-vault@1.1.7': + resolution: {integrity: sha512-wIfACyzT8XjMUxx/BKNtmb+nrn/jOne03tkVh5oEdTCas0dCCTHSjUZhkC7/X92+KjNNWckMGmHutE6EZzYdIA==} + + '@meteora-ag/dlmm@1.3.0': + resolution: {integrity: sha512-k3VdtisuNaSavTY+M8vLsB3wqqpC/dyFPujp6MScz85Nj0Beuua6PRg5XSjzhAt8rbuXcnTSKWCTYzc24UMHmA==} + + '@meteora-ag/dlmm@1.3.8': + resolution: {integrity: sha512-c5mOL/EUh0tDzHO/8tflJtmaDnkzz+jgUDCYzCCpEw6Z4qbW7PtZQhKopuQl90rNBfeVHCyezcWk7PQpwIae6w==} + + '@meteora-ag/m3m3@1.0.4': + resolution: {integrity: sha512-tjNsQ7qCE9LAyZ8TpyNsg8kOiaarAQ91ckAGObKO/gcDkUfm5m/qrDo3qypN9aCAcFnNmvsuJecrJnLhRGq33g==} + + '@meteora-ag/stake-for-fee@1.0.28': + resolution: {integrity: sha512-FevXshZyeFD+CpYoYBrg95lRx8CyrhV5R31IteNzGlSRcQ6NWFRhTmgxtt+yMHFGj8+24qwfBUrBCNx2vT/G4A==} + deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. + '@msgpack/msgpack@2.8.0': resolution: {integrity: sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ==} engines: {node: '>= 10'} @@ -1044,6 +1086,10 @@ packages: resolution: {integrity: sha512-oIdm4vTJkUy6GmE6JgqDAuQPKI7XM4TPJkjtoIzp69RZe0iAD9JP2XHx7lV1jLdYXeYHqDXfBt3zcq7W91K6PA==} engines: {node: '>=11'} + '@project-serum/anchor@0.24.2': + resolution: {integrity: sha512-0/718g8/DnEuwAidUwh5wLYphUYXhUbiClkuRNhvNoa+1Y8a4g2tJyxoae+emV+PG/Gikd/QUBNMkIcimiIRTA==} + engines: {node: '>=11'} + '@project-serum/anchor@0.26.0': resolution: {integrity: sha512-Nq+COIjE1135T7qfnOHEn7E0q39bQTgXLFk837/rgFe6Hkew9WML7eHsS+lSYD2p3OJaTiUOHTAq1lHy36oIqQ==} engines: {node: '>=11'} @@ -1142,29 +1188,35 @@ packages: '@scure/bip32@1.4.0': resolution: {integrity: sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==} + '@scure/bip32@1.6.1': + resolution: {integrity: sha512-jSO+5Ud1E588Y+LFo8TaB8JVPNAZw/lGGao+1SepHDeTs2dFLurdNIAgUuDlwezqEjRjElkCJajVrtrZaBxvaQ==} + '@scure/bip39@1.1.0': resolution: {integrity: sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==} '@scure/bip39@1.3.0': resolution: {integrity: sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==} - '@shikijs/core@1.26.1': - resolution: {integrity: sha512-yeo7sG+WZQblKPclUOKRPwkv1PyoHYkJ4gP9DzhFJbTdueKR7wYTI1vfF/bFi1NTgc545yG/DzvVhZgueVOXMA==} + '@scure/bip39@1.5.1': + resolution: {integrity: sha512-GnlufVSP9UdAo/H2Patfv22VTtpNTyfi+I3qCKpvuB5l1KWzEYx+l2TNpBy9Ksh4xTs3Rn06tBlpWCi/1Vz8gw==} - '@shikijs/engine-javascript@1.26.1': - resolution: {integrity: sha512-CRhA0b8CaSLxS0E9A4Bzcb3LKBNpykfo9F85ozlNyArxjo2NkijtiwrJZ6eHa+NT5I9Kox2IXVdjUsP4dilsmw==} + '@shikijs/core@1.27.2': + resolution: {integrity: sha512-ns1dokDr0KE1lQ9mWd4rqaBkhSApk0qGCK1+lOqwnkQSkVZ08UGqXj1Ef8dAcTMZNFkN6PSNjkL5TYNX7pyPbQ==} - '@shikijs/engine-oniguruma@1.26.1': - resolution: {integrity: sha512-F5XuxN1HljLuvfXv7d+mlTkV7XukC1cawdtOo+7pKgPD83CAB1Sf8uHqP3PK0u7njFH0ZhoXE1r+0JzEgAQ+kg==} + '@shikijs/engine-javascript@1.27.2': + resolution: {integrity: sha512-0JB7U5vJc16NShBdxv9hSSJYSKX79+32O7F4oXIxJLdYfomyFvx4B982ackUI9ftO9T3WwagkiiD3nOxOOLiGA==} - '@shikijs/langs@1.26.1': - resolution: {integrity: sha512-oz/TQiIqZejEIZbGtn68hbJijAOTtYH4TMMSWkWYozwqdpKR3EXgILneQy26WItmJjp3xVspHdiUxUCws4gtuw==} + '@shikijs/engine-oniguruma@1.27.2': + resolution: {integrity: sha512-FZYKD1KN7srvpkz4lbGLOYWlyDU4Rd+2RtuKfABTkafAPOFr+J6umfIwY/TzOQqfNtWjL7SAwPAO0dcOraRLaQ==} - '@shikijs/themes@1.26.1': - resolution: {integrity: sha512-JDxVn+z+wgLCiUhBGx2OQrLCkKZQGzNH3nAxFir4PjUcYiyD8Jdms9izyxIogYmSwmoPTatFTdzyrRKbKlSfPA==} + '@shikijs/langs@1.27.2': + resolution: {integrity: sha512-MSrknKL0DbeXvhtSigMLIzjPOOQfvK7fsbcRv2NUUB0EvuTTomY8/U+lAkczYrXY2+dygKOapJKk8ScFYbtoNw==} - '@shikijs/types@1.26.1': - resolution: {integrity: sha512-d4B00TKKAMaHuFYgRf3L0gwtvqpW4hVdVwKcZYbBfAAQXspgkbWqnFfuFl3MDH6gLbsubOcr+prcnsqah3ny7Q==} + '@shikijs/themes@1.27.2': + resolution: {integrity: sha512-Yw/uV7EijjWavIIZLoWneTAohcbBqEKj6XMX1bfMqO3llqTKsyXukPp1evf8qPqzUHY7ibauqEaQchhfi857mg==} + + '@shikijs/types@1.27.2': + resolution: {integrity: sha512-DM9OWUyjmdYdnKDpaGB/GEn9XkToyK1tqxuqbmc5PV+5K8WjjwfygL3+cIvbkSw2v1ySwHDgqATq/+98pJ4Kyg==} '@shikijs/vscode-textmate@10.0.1': resolution: {integrity: sha512-fTIQwLF+Qhuws31iw7Ncl1R3HUDtGwIipiJ9iU+UsDUwMhegFcQKQHd51nZjb7CArq0MvON8rbgCGQYWHUKAdg==} @@ -1182,6 +1234,9 @@ packages: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} + '@solana-developers/helpers@2.5.6': + resolution: {integrity: sha512-NPWZblVMl4LuVVSJOZG0ZF0VYnrMUjCyMNTiGwNUXPK2WWYJCqpuDyzs/PMqwvM4gMTjk4pEToBX8N2UxDvZkQ==} + '@solana/buffer-layout-utils@0.2.0': resolution: {integrity: sha512-szG4sxgJGktbuZYDg2FfNmkMi0DYQoVjN2h7ta1W1hPrwzarcFLBq9UpX1UjNXsNpT9dn+chgprtWGioUAr4/g==} engines: {node: '>= 10'} @@ -1318,6 +1373,10 @@ packages: peerDependencies: '@solana/web3.js': ^1.95.3 + '@solana/spl-token-registry@0.2.4574': + resolution: {integrity: sha512-JzlfZmke8Rxug20VT/VpI2XsXlsqMlcORIUivF+Yucj7tFi7A0dXG7h+2UnD0WaZJw8BrUz2ABNkUnv89vbv1A==} + engines: {node: '>=10'} + '@solana/spl-token@0.1.8': resolution: {integrity: sha512-LZmYCKcPQDtJgecvWOgT/cnoIQPWjdH+QVyzPcFvyDUiT0DiRjZaam4aqNUyvchLFhzgunv3d9xOoyE34ofdoQ==} engines: {node: '>= 10'} @@ -1448,6 +1507,9 @@ packages: '@tsconfig/node16@1.0.4': resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@types/big.js@6.2.2': + resolution: {integrity: sha512-e2cOW9YlVzFY2iScnGBBkplKsrn2CsObHQ2Hiw4V1sSyiGbgWL8IyqE3zFi1Pt5o1pdAtYkDAIsF3KKUPjdzaA==} + '@types/bn.js@5.1.6': resolution: {integrity: sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==} @@ -1514,14 +1576,14 @@ packages: '@types/node@20.17.11': resolution: {integrity: sha512-Ept5glCK35R8yeyIeYlRIZtX6SLRyqMhOFTgj5SOkMpLTdw3SEHI9fHx60xaUZ+V1aJxQJODE+7/j5ocZydYTg==} - '@types/node@22.10.5': - resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==} + '@types/node@22.10.7': + resolution: {integrity: sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==} '@types/promise-retry@1.1.6': resolution: {integrity: sha512-EC1+OMXV0PZb0pf+cmyxc43MEP2CDumZe4AfuxWboxxEixztIebknpJPZAX5XlodGF1OY+C1E/RAeNGzxf+bJA==} - '@types/qs@6.9.17': - resolution: {integrity: sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==} + '@types/qs@6.9.18': + resolution: {integrity: sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==} '@types/range-parser@1.2.7': resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} @@ -1852,6 +1914,9 @@ packages: bluebird@3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} + bn-sqrt@1.0.0: + resolution: {integrity: sha512-XdCMQ7tfEF/f7nrQgnrJ+DLQBwQzSQyPOKIXdUOTcGEvsRKBcIsdfORp7B5H8DWo8FOzZ4+a2TjSZzaqKgzicg==} + bn.js@4.11.6: resolution: {integrity: sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==} @@ -2099,6 +2164,9 @@ packages: cron-validator@1.3.1: resolution: {integrity: sha512-C1HsxuPCY/5opR55G5/WNzyEGDWFVG+6GLrA+fW/sCTcP6A6NTjUP2AK7B8n2PyFs90kDG2qzwm8LMheADku6A==} + cross-fetch@3.0.6: + resolution: {integrity: sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ==} + cross-fetch@3.2.0: resolution: {integrity: sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==} @@ -2169,6 +2237,9 @@ packages: decimal.js-light@2.5.1: resolution: {integrity: sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==} + decimal.js@10.3.1: + resolution: {integrity: sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ==} + decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} @@ -2320,8 +2391,8 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} - es-object-atoms@1.0.0: - resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} es6-promise@4.2.8: @@ -2356,8 +2427,8 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-plugin-prettier@5.2.1: - resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} + eslint-plugin-prettier@5.2.2: + resolution: {integrity: sha512-1yI3/hf35wmlq66C8yOyrujQnel+v5l1Vop5Cl2I6ylyNTT1JbuUUnV3/41PzwTzcyDp/oF0jWE3HXvcH5AQOQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: '@types/eslint': '>=8.0.0' @@ -2638,6 +2709,10 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + gaussian@1.3.0: + resolution: {integrity: sha512-rYQ0ESfB+z0t7G95nHH80Zh7Pgg9A0FUYoZqV0yPec5WJZWKIHV2MPYpiJNy8oZAeVqyKwC10WXKSCnUQ5iDVg==} + engines: {node: '>= 0.6.0'} + get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} @@ -3110,8 +3185,8 @@ packages: linkify-it@5.0.0: resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} - lint-staged@15.3.0: - resolution: {integrity: sha512-vHFahytLoF2enJklgtOtCtIjZrKD/LoxlaUusd5nh7dWv/dkKQJY74ndFSzxCdv7g0ueGg1ORgTSt4Y9LPZn9A==} + lint-staged@15.4.1: + resolution: {integrity: sha512-P8yJuVRyLrm5KxCtFx+gjI5Bil+wO7wnTl7C3bXhvtTaAFGirzeB24++D0wGoUwxrUKecNiehemgCob9YL39NA==} engines: {node: '>=18.12.0'} hasBin: true @@ -3397,6 +3472,10 @@ packages: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} + node-fetch@2.6.1: + resolution: {integrity: sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==} + engines: {node: 4.x || >=6.0.0} + node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -3470,8 +3549,8 @@ packages: resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} engines: {node: '>=18'} - oniguruma-to-es@0.10.0: - resolution: {integrity: sha512-zapyOUOCJxt+xhiNRPPMtfJkHGsZ98HHB9qJEkdT8BGytO/+kpe4m1Ngf0MzbzTmhacn11w9yGeDP6tzDhnCdg==} + oniguruma-to-es@2.1.0: + resolution: {integrity: sha512-Iq/949c5IueVC5gQR7OYXs0uHsDIePcgZFlVRIVGfQcWwbKG+nsyWfthswdytShlRdkZADY+bWSi+BRyUL81gA==} openai@4.77.3: resolution: {integrity: sha512-wLDy4+KWHz31HRFMW2+9KQuVuT2QWhs0z94w1Gm1h2Ut9vIHr9/rHZggbykZEfyiaJRVgw8ZS9K6AylDWzvPYw==} @@ -3848,8 +3927,8 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - shiki@1.26.1: - resolution: {integrity: sha512-Gqg6DSTk3wYqaZ5OaYtzjcdxcBvX5kCy24yvRJEgjT5U+WHlmqCThLuBUx0juyxQBi+6ug53IGeuQS07DWwpcw==} + shiki@1.27.2: + resolution: {integrity: sha512-QtA1C41oEVixKog+V8I3ia7jjGls7oCZ8Yul8vdHrVBga5uPoyTtMvFF4lMMXIyAZo5A5QbXq91bot2vA6Q+eQ==} side-channel-list@1.0.0: resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} @@ -4457,7 +4536,7 @@ packages: snapshots: - '@3land/listings-sdk@0.0.6(@types/node@22.10.5)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + '@3land/listings-sdk@0.0.6(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@irys/sdk': 0.2.11(arweave@1.15.5)(bufferutil@4.0.9)(utf-8-validate@5.0.10) @@ -4475,7 +4554,7 @@ snapshots: fs: 0.0.1-security irys: 0.0.1 node-fetch: 3.3.2 - ts-node: 10.9.2(@types/node@22.10.5)(typescript@5.7.2) + ts-node: 10.9.2(@types/node@22.10.7)(typescript@5.7.2) tweetnacl: 1.0.3 transitivePeerDependencies: - '@swc/core' @@ -4544,8 +4623,8 @@ snapshots: '@aptos-labs/aptos-client': 0.1.1 '@noble/curves': 1.8.0 '@noble/hashes': 1.7.0 - '@scure/bip32': 1.4.0 - '@scure/bip39': 1.3.0 + '@scure/bip32': 1.6.1 + '@scure/bip39': 1.5.1 eventemitter3: 5.0.1 form-data: 4.0.1 js-base64: 3.7.7 @@ -4842,7 +4921,7 @@ snapshots: - typescript - utf-8-validate - '@drift-labs/vaults-sdk@0.2.49(@types/node@22.10.5)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(utf-8-validate@5.0.10)': + '@drift-labs/vaults-sdk@0.2.49(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@drift-labs/sdk': 2.107.0-beta.3(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -4856,7 +4935,7 @@ snapshots: dotenv: 16.4.5 rpc-websockets: 7.5.1 strict-event-emitter-types: 2.0.0 - ts-node: 10.9.2(@types/node@22.10.5)(typescript@5.6.3) + ts-node: 10.9.2(@types/node@22.10.7)(typescript@5.6.3) typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -5293,10 +5372,10 @@ snapshots: '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - '@gerrit0/mini-shiki@1.26.1': + '@gerrit0/mini-shiki@1.27.2': dependencies: - '@shikijs/engine-oniguruma': 1.26.1 - '@shikijs/types': 1.26.1 + '@shikijs/engine-oniguruma': 1.27.2 + '@shikijs/types': 1.27.2 '@shikijs/vscode-textmate': 10.0.1 '@grpc/grpc-js@1.12.5': @@ -5616,6 +5695,83 @@ snapshots: - encoding - utf-8-validate + '@mercurial-finance/dynamic-amm-sdk@1.1.19(@solana/buffer-layout@4.0.1)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@coral-xyz/borsh': 0.28.0(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@mercurial-finance/token-math': 6.0.0 + '@mercurial-finance/vault-sdk': 2.2.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@metaplex-foundation/mpl-token-metadata': 2.13.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@meteora-ag/stake-for-fee': 1.0.28(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@project-serum/anchor': 0.24.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@solana/buffer-layout': 4.0.1 + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/spl-token-registry': 0.2.4574 + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bn-sqrt: 1.0.0 + bn.js: 5.2.1 + decimal.js: 10.4.3 + dotenv: 16.4.7 + invariant: 2.2.4 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - supports-color + - typescript + - utf-8-validate + + '@mercurial-finance/dynamic-amm-sdk@1.1.23(@solana/buffer-layout@4.0.1)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@coral-xyz/borsh': 0.28.0(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@mercurial-finance/token-math': 6.0.0 + '@mercurial-finance/vault-sdk': 2.2.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@metaplex-foundation/mpl-token-metadata': 2.13.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@meteora-ag/m3m3': 1.0.4(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@project-serum/anchor': 0.24.2(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@solana/buffer-layout': 4.0.1 + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/spl-token-registry': 0.2.4574 + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bn-sqrt: 1.0.0 + bn.js: 5.2.1 + decimal.js: 10.4.3 + dotenv: 16.4.7 + invariant: 2.2.4 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - supports-color + - typescript + - utf-8-validate + + '@mercurial-finance/token-math@6.0.0': + dependencies: + '@types/big.js': 6.2.2 + big.js: 6.2.2 + tiny-invariant: 1.3.3 + tslib: 2.8.1 + + '@mercurial-finance/vault-sdk@2.2.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@solana/buffer-layout': 4.0.1 + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/spl-token-registry': 0.2.4574 + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + cross-fetch: 3.2.0 + decimal.js: 10.3.1 + jsbi: 4.3.0 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + '@metaplex-foundation/beet-solana@0.3.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: '@metaplex-foundation/beet': 0.7.2 @@ -5630,7 +5786,7 @@ snapshots: '@metaplex-foundation/beet-solana@0.4.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: - '@metaplex-foundation/beet': 0.7.2 + '@metaplex-foundation/beet': 0.7.1 '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) bs58: 5.0.0 debug: 4.4.0 @@ -5819,7 +5975,7 @@ snapshots: '@metaplex-foundation/mpl-candy-machine@5.1.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10)': dependencies: - '@metaplex-foundation/beet': 0.7.2 + '@metaplex-foundation/beet': 0.7.1 '@metaplex-foundation/beet-solana': 0.4.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@metaplex-foundation/cusper': 0.0.2 '@solana/spl-token': 0.3.11(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.6.3)(utf-8-validate@5.0.10) @@ -6002,6 +6158,97 @@ snapshots: '@metaplex-foundation/umi-public-keys': 0.8.9 '@metaplex-foundation/umi-serializers': 0.9.0 + '@meteora-ag/alpha-vault@1.1.7(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@mercurial-finance/dynamic-amm-sdk': 1.1.19(@solana/buffer-layout@4.0.1)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@meteora-ag/dlmm': 1.3.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/buffer-layout': 4.0.1 + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@types/node': 22.10.7 + decimal.js: 10.4.3 + gaussian: 1.3.0 + js-sha256: 0.11.0 + tiny-invariant: 1.3.3 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - supports-color + - typescript + - utf-8-validate + + '@meteora-ag/dlmm@1.3.0(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@coral-xyz/borsh': 0.28.0(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/buffer-layout': 4.0.1 + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + decimal.js: 10.4.3 + express: 4.21.2 + gaussian: 1.3.0 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - supports-color + - typescript + - utf-8-validate + + '@meteora-ag/dlmm@1.3.8(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@coral-xyz/borsh': 0.28.0(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana-developers/helpers': 2.5.6(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/buffer-layout': 4.0.1 + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + decimal.js: 10.4.3 + express: 4.21.2 + gaussian: 1.3.0 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - supports-color + - typescript + - utf-8-validate + + '@meteora-ag/m3m3@1.0.4(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana-developers/helpers': 2.5.6(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + decimal.js: 10.4.3 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + + '@meteora-ag/stake-for-fee@1.0.28(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@coral-xyz/anchor': 0.28.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bn.js: 5.2.1 + decimal.js: 10.4.3 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + '@msgpack/msgpack@2.8.0': {} '@msgpack/msgpack@3.0.0-beta2': {} @@ -6216,6 +6463,27 @@ snapshots: - encoding - utf-8-validate + '@project-serum/anchor@0.24.2(bufferutil@4.0.9)(utf-8-validate@5.0.10)': + dependencies: + '@project-serum/borsh': 0.2.5(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + base64-js: 1.5.1 + bn.js: 5.2.1 + bs58: 4.0.1 + buffer-layout: 1.2.2 + camelcase: 5.3.1 + cross-fetch: 3.2.0 + crypto-hash: 1.3.0 + eventemitter3: 4.0.7 + js-sha256: 0.9.0 + pako: 2.1.0 + snake-case: 3.0.4 + toml: 3.0.0 + transitivePeerDependencies: + - bufferutil + - encoding + - utf-8-validate + '@project-serum/anchor@0.26.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/borsh': 0.26.0(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) @@ -6410,6 +6678,12 @@ snapshots: '@noble/hashes': 1.4.0 '@scure/base': 1.1.9 + '@scure/bip32@1.6.1': + dependencies: + '@noble/curves': 1.8.0 + '@noble/hashes': 1.7.0 + '@scure/base': 1.2.1 + '@scure/bip39@1.1.0': dependencies: '@noble/hashes': 1.1.3 @@ -6420,35 +6694,40 @@ snapshots: '@noble/hashes': 1.4.0 '@scure/base': 1.1.9 - '@shikijs/core@1.26.1': + '@scure/bip39@1.5.1': dependencies: - '@shikijs/engine-javascript': 1.26.1 - '@shikijs/engine-oniguruma': 1.26.1 - '@shikijs/types': 1.26.1 + '@noble/hashes': 1.7.0 + '@scure/base': 1.2.1 + + '@shikijs/core@1.27.2': + dependencies: + '@shikijs/engine-javascript': 1.27.2 + '@shikijs/engine-oniguruma': 1.27.2 + '@shikijs/types': 1.27.2 '@shikijs/vscode-textmate': 10.0.1 '@types/hast': 3.0.4 hast-util-to-html: 9.0.4 - '@shikijs/engine-javascript@1.26.1': + '@shikijs/engine-javascript@1.27.2': dependencies: - '@shikijs/types': 1.26.1 + '@shikijs/types': 1.27.2 '@shikijs/vscode-textmate': 10.0.1 - oniguruma-to-es: 0.10.0 + oniguruma-to-es: 2.1.0 - '@shikijs/engine-oniguruma@1.26.1': + '@shikijs/engine-oniguruma@1.27.2': dependencies: - '@shikijs/types': 1.26.1 + '@shikijs/types': 1.27.2 '@shikijs/vscode-textmate': 10.0.1 - '@shikijs/langs@1.26.1': + '@shikijs/langs@1.27.2': dependencies: - '@shikijs/types': 1.26.1 + '@shikijs/types': 1.27.2 - '@shikijs/themes@1.26.1': + '@shikijs/themes@1.27.2': dependencies: - '@shikijs/types': 1.26.1 + '@shikijs/types': 1.27.2 - '@shikijs/types@1.26.1': + '@shikijs/types@1.27.2': dependencies: '@shikijs/vscode-textmate': 10.0.1 '@types/hast': 3.0.4 @@ -6465,6 +6744,20 @@ snapshots: '@sindresorhus/is@4.6.0': {} + '@solana-developers/helpers@2.5.6(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + dependencies: + '@solana/spl-token': 0.4.9(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + '@solana/spl-token-metadata': 0.1.6(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2) + '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + bs58: 6.0.0 + dotenv: 16.4.7 + transitivePeerDependencies: + - bufferutil + - encoding + - fastestsmallesttextencoderdecoder + - typescript + - utf-8-validate + '@solana/buffer-layout-utils@0.2.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: '@solana/buffer-layout': 4.0.1 @@ -6740,7 +7033,7 @@ snapshots: '@solana/spl-account-compression@0.1.10(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: - '@metaplex-foundation/beet': 0.7.2 + '@metaplex-foundation/beet': 0.7.1 '@metaplex-foundation/beet-solana': 0.4.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@solana/web3.js': 1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) bn.js: 5.2.1 @@ -6842,6 +7135,10 @@ snapshots: - fastestsmallesttextencoderdecoder - typescript + '@solana/spl-token-registry@0.2.4574': + dependencies: + cross-fetch: 3.0.6 + '@solana/spl-token@0.1.8(bufferutil@4.0.9)(utf-8-validate@5.0.10)': dependencies: '@babel/runtime': 7.26.0 @@ -7334,20 +7631,22 @@ snapshots: '@tsconfig/node16@1.0.4': {} + '@types/big.js@6.2.2': {} + '@types/bn.js@5.1.6': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/body-parser@1.19.5': dependencies: '@types/connect': 3.4.38 - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/cacheable-request@6.0.3': dependencies: '@types/http-cache-semantics': 4.0.4 '@types/keyv': 3.1.4 - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/responselike': 1.0.3 '@types/chai@5.0.1': @@ -7356,7 +7655,7 @@ snapshots: '@types/connect@3.4.38': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/deep-eql@4.0.2': {} @@ -7366,8 +7665,8 @@ snapshots: '@types/express-serve-static-core@4.19.6': dependencies: - '@types/node': 22.10.5 - '@types/qs': 6.9.17 + '@types/node': 22.10.7 + '@types/qs': 6.9.18 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -7375,7 +7674,7 @@ snapshots: dependencies: '@types/body-parser': 1.19.5 '@types/express-serve-static-core': 4.19.6 - '@types/qs': 6.9.17 + '@types/qs': 6.9.18 '@types/serve-static': 1.15.7 '@types/hast@3.0.4': @@ -7390,7 +7689,7 @@ snapshots: '@types/keyv@3.1.4': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/mdast@4.0.4': dependencies: @@ -7400,7 +7699,7 @@ snapshots: '@types/node-fetch@2.6.12': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.7 form-data: 4.0.1 '@types/node@11.11.6': {} @@ -7415,7 +7714,7 @@ snapshots: dependencies: undici-types: 6.19.8 - '@types/node@22.10.5': + '@types/node@22.10.7': dependencies: undici-types: 6.20.0 @@ -7423,13 +7722,13 @@ snapshots: dependencies: '@types/retry': 0.12.5 - '@types/qs@6.9.17': {} + '@types/qs@6.9.18': {} '@types/range-parser@1.2.7': {} '@types/responselike@1.0.3': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/retry@0.12.0': {} @@ -7438,12 +7737,12 @@ snapshots: '@types/send@0.17.4': dependencies: '@types/mime': 1.3.5 - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/serve-static@1.15.7': dependencies: '@types/http-errors': 2.0.4 - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/send': 0.17.4 '@types/unist@3.0.3': {} @@ -7456,11 +7755,11 @@ snapshots: '@types/ws@7.4.7': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@types/ws@8.5.13': dependencies: - '@types/node': 22.10.5 + '@types/node': 22.10.7 '@typescript-eslint/eslint-plugin@8.19.0(@typescript-eslint/parser@8.19.0(eslint@8.57.1)(typescript@5.7.2))(eslint@8.57.1)(typescript@5.7.2)': dependencies: @@ -7899,6 +8198,10 @@ snapshots: bluebird@3.7.2: {} + bn-sqrt@1.0.0: + dependencies: + bn.js: 5.2.1 + bn.js@4.11.6: {} bn.js@4.12.1: {} @@ -8143,6 +8446,10 @@ snapshots: cron-validator@1.3.1: {} + cross-fetch@3.0.6: + dependencies: + node-fetch: 2.6.1 + cross-fetch@3.2.0: dependencies: node-fetch: 2.7.0 @@ -8194,6 +8501,8 @@ snapshots: decimal.js-light@2.5.1: {} + decimal.js@10.3.1: {} + decimal.js@10.4.3: {} decompress-response@6.0.0: @@ -8319,7 +8628,7 @@ snapshots: es-errors@1.3.0: {} - es-object-atoms@1.0.0: + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 @@ -8368,7 +8677,7 @@ snapshots: dependencies: eslint: 8.57.1 - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2): + eslint-plugin-prettier@5.2.2(eslint-config-prettier@9.1.0(eslint@8.57.1))(eslint@8.57.1)(prettier@3.4.2): dependencies: eslint: 8.57.1 prettier: 3.4.2 @@ -8800,6 +9109,8 @@ snapshots: function-bind@1.1.2: {} + gaussian@1.3.0: {} + get-caller-file@2.0.5: {} get-east-asian-width@1.3.0: {} @@ -8809,7 +9120,7 @@ snapshots: call-bind-apply-helpers: 1.0.1 es-define-property: 1.0.1 es-errors: 1.3.0 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 function-bind: 1.1.2 get-proto: 1.0.1 gopd: 1.2.0 @@ -8820,7 +9131,7 @@ snapshots: get-proto@1.0.1: dependencies: dunder-proto: 1.0.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 get-stream@5.2.0: dependencies: @@ -9000,7 +9311,7 @@ snapshots: humanize-ms@1.2.1: dependencies: - ms: 2.1.3 + ms: 2.1.2 husky@9.1.7: {} @@ -9263,7 +9574,7 @@ snapshots: openapi-types: 12.1.3 p-retry: 4.6.2 uuid: 10.0.0 - yaml: 2.7.0 + yaml: 2.6.1 zod: 3.24.1 zod-to-json-schema: 3.24.1(zod@3.24.1) optionalDependencies: @@ -9309,7 +9620,7 @@ snapshots: dependencies: uc.micro: 2.1.0 - lint-staged@15.3.0: + lint-staged@15.4.1: dependencies: chalk: 5.4.1 commander: 12.1.0 @@ -9573,6 +9884,8 @@ snapshots: node-domexception@1.0.0: {} + node-fetch@2.6.1: {} + node-fetch@2.7.0: dependencies: whatwg-url: 5.0.0 @@ -9620,7 +9933,7 @@ snapshots: call-bind: 1.0.8 call-bound: 1.0.3 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 has-symbols: 1.1.0 object-keys: 1.1.1 @@ -9644,7 +9957,7 @@ snapshots: dependencies: mimic-function: 5.0.1 - oniguruma-to-es@0.10.0: + oniguruma-to-es@2.1.0: dependencies: emoji-regex-xs: 1.0.0 regex: 5.1.1 @@ -9826,7 +10139,7 @@ snapshots: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 22.10.5 + '@types/node': 22.10.7 long: 5.2.4 proxy-addr@2.0.7: @@ -10065,14 +10378,14 @@ snapshots: shebang-regex@3.0.0: {} - shiki@1.26.1: + shiki@1.27.2: dependencies: - '@shikijs/core': 1.26.1 - '@shikijs/engine-javascript': 1.26.1 - '@shikijs/engine-oniguruma': 1.26.1 - '@shikijs/langs': 1.26.1 - '@shikijs/themes': 1.26.1 - '@shikijs/types': 1.26.1 + '@shikijs/core': 1.27.2 + '@shikijs/engine-javascript': 1.27.2 + '@shikijs/engine-oniguruma': 1.27.2 + '@shikijs/langs': 1.27.2 + '@shikijs/themes': 1.27.2 + '@shikijs/types': 1.27.2 '@shikijs/vscode-textmate': 10.0.1 '@types/hast': 3.0.4 @@ -10379,14 +10692,14 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - ts-node@10.9.2(@types/node@22.10.5)(typescript@5.6.3): + ts-node@10.9.2(@types/node@22.10.7)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.10.5 + '@types/node': 22.10.7 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -10397,14 +10710,14 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - ts-node@10.9.2(@types/node@22.10.5)(typescript@5.7.2): + ts-node@10.9.2(@types/node@22.10.7)(typescript@5.7.2): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.10.5 + '@types/node': 22.10.7 acorn: 8.14.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -10462,13 +10775,13 @@ snapshots: lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 - shiki: 1.26.1 + shiki: 1.27.2 typescript: 5.7.2 yaml: 2.7.0 typedoc@0.27.6(typescript@5.7.2): dependencies: - '@gerrit0/mini-shiki': 1.26.1 + '@gerrit0/mini-shiki': 1.27.2 lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 diff --git a/src/agent/index.ts b/src/agent/index.ts index 8d82a9b1..6f6f9c96 100644 --- a/src/agent/index.ts +++ b/src/agent/index.ts @@ -69,6 +69,8 @@ import { fetchPythPriceFeedID, flashOpenTrade, flashCloseTrade, + createMeteoraDynamicAMMPool, + createMeteoraDlmmPool, createCollection, createSingle, multisig_transfer_from_treasury, @@ -397,6 +399,57 @@ export class SolanaAgentKit { ); } + async meteoraCreateDynamicPool( + tokenAMint: PublicKey, + tokenBMint: PublicKey, + tokenAAmount: BN, + tokenBAmount: BN, + tradeFeeNumerator: number, + activationPoint: BN | null, + hasAlphaVault: boolean, + activationType: number, + ): Promise { + return createMeteoraDynamicAMMPool( + this, + tokenAMint, + tokenBMint, + tokenAAmount, + tokenBAmount, + { + tradeFeeNumerator, + activationPoint, + hasAlphaVault, + activationType, + padding: new Array(90).fill(0), + }, + ); + } + + async meteoraCreateDlmmPool( + tokenAMint: PublicKey, + tokenBMint: PublicKey, + binStep: number, + initialPrice: number, + priceRoundingUp: boolean, + feeBps: number, + activationType: number, + hasAlphaVault: boolean, + activationPoint: BN | undefined, + ): Promise { + return createMeteoraDlmmPool( + this, + binStep, + tokenAMint, + tokenBMint, + initialPrice, + priceRoundingUp, + feeBps, + activationType, + hasAlphaVault, + activationPoint, + ); + } + async orcaClosePosition(positionMintAddress: PublicKey) { return orcaClosePosition(this, positionMintAddress); } @@ -656,7 +709,7 @@ export class SolanaAgentKit { collectionOpts: CreateCollectionOptions, isDevnet: boolean = false, ): Promise { - let optionsWithBase58: StoreInitOptions = { + const optionsWithBase58: StoreInitOptions = { privateKey: this.wallet.secretKey, }; if (isDevnet) { @@ -675,7 +728,7 @@ export class SolanaAgentKit { isDevnet: boolean = false, withPool: boolean = false, ): Promise { - let optionsWithBase58: StoreInitOptions = { + const optionsWithBase58: StoreInitOptions = { privateKey: this.wallet.secretKey, }; if (isDevnet) { @@ -782,7 +835,7 @@ export class SolanaAgentKit { }) { return await createVault(this, params); } - + async depositIntoDriftVault(amount: number, vault: string) { return await depositIntoVault(this, amount, vault); } @@ -924,6 +977,7 @@ export class SolanaAgentKit { } async getLendAndBorrowAPY(symbol: string) { return getLendingAndBorrowAPY(this, symbol); + } async voltrDepositStrategy( depositAmount: BN, diff --git a/src/constants/index.ts b/src/constants/index.ts index 5e261b48..472213fd 100644 --- a/src/constants/index.ts +++ b/src/constants/index.ts @@ -27,6 +27,8 @@ export const DEFAULT_OPTIONS = { LEVERAGE_BPS: 50000, // 10000 = x1, 50000 = x5, 100000 = x10, 1000000 = x100 } as const; +export const METEORA_DYNAMIC_FEE_DENOMINATOR = 100000; + /** * Jupiter API URL */ @@ -34,6 +36,12 @@ export const JUP_API = "https://quote-api.jup.ag/v6"; export const JUP_REFERRAL_ADDRESS = "REFER4ZgmyYx9c6He5XfaTMiGfdLwRnkV4RPp9t9iF3"; +export const METEORA_DYNAMIC_AMM_PROGRAM_ID = new PublicKey( + "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB", +); +export const METEORA_DLMM_PROGRAM_ID = new PublicKey( + "LbVRzDTvBDEcrthxfZ4RL6yiq3uZw8bS6MwtdY6UhFQ", +); /** * Minimum compute price required to carry out complex transactions on the Drift protocol */ diff --git a/src/langchain/index.ts b/src/langchain/index.ts index 788a834b..7f6bcd18 100644 --- a/src/langchain/index.ts +++ b/src/langchain/index.ts @@ -24,6 +24,7 @@ export * from "./tiplink"; export * from "./sns"; export * from "./lightprotocol"; export * from "./squads"; +export * from "./meteora"; export * from "./helius"; export * from "./drift"; export * from "./voltr"; @@ -96,6 +97,8 @@ import { SolanaApproveProposal2by2Multisig, SolanaExecuteProposal2by2Multisig, SolanaRejectProposal2by2Multisig, + SolanaMeteoraCreateDynamicPool, + SolanaMeteoraCreateDlmmPool, SolanaSendTransactionWithPriorityFee, SolanaHeliusWebhookTool, SolanaGetHeliusWebhookTool, @@ -163,6 +166,8 @@ export function createSolanaTools(solanaKit: SolanaAgentKit) { new SolanaBatchOrderTool(solanaKit), new SolanaCancelAllOrdersTool(solanaKit), new SolanaWithdrawAllTool(solanaKit), + new SolanaMeteoraCreateDynamicPool(solanaKit), + new SolanaMeteoraCreateDlmmPool(solanaKit), new SolanaClosePosition(solanaKit), new SolanaOrcaCreateCLMM(solanaKit), new SolanaOrcaCreateSingleSideLiquidityPool(solanaKit), diff --git a/src/langchain/lulo/lulo_lend.ts b/src/langchain/lulo/lulo_lend.ts index 0d5371e6..1f375e6b 100644 --- a/src/langchain/lulo/lulo_lend.ts +++ b/src/langchain/lulo/lulo_lend.ts @@ -2,36 +2,36 @@ import { Tool } from "langchain/tools"; import { SolanaAgentKit } from "../../agent"; export class SolanaLuloLendTool extends Tool { - name = "solana_lulo_lend"; - description = `Lend token for yield using Lulo. (support USDC/PYUSD/USDS/USDT/SOL/jitoSOL/bSOL/mSOL/BONK/JUP) + name = "solana_lulo_lend"; + description = `Lend token for yield using Lulo. (support USDC/PYUSD/USDS/USDT/SOL/jitoSOL/bSOL/mSOL/BONK/JUP) Inputs: mintAddress: string, eg "So11111111111111111111111111111111111111112" (required) amount: number, eg 1, 0.01 (required)`; - constructor(private solanaKit: SolanaAgentKit) { - super(); - } + constructor(private solanaKit: SolanaAgentKit) { + super(); + } - async _call(input: string): Promise { - try { - const parsedInput = JSON.parse(input); - const mintAddress = parsedInput.mintAddress - const amount = parsedInput.amount; + async _call(input: string): Promise { + try { + const parsedInput = JSON.parse(input); + const mintAddress = parsedInput.mintAddress; + const amount = parsedInput.amount; - const tx = await this.solanaKit.luloLend(mintAddress, amount); + const tx = await this.solanaKit.luloLend(mintAddress, amount); - return JSON.stringify({ - status: "success", - message: "Asset lent successfully", - transaction: tx, - amount, - }); - } catch (error: any) { - return JSON.stringify({ - status: "error", - message: error.message, - code: error.code || "UNKNOWN_ERROR", - }); - } + return JSON.stringify({ + status: "success", + message: "Asset lent successfully", + transaction: tx, + amount, + }); + } catch (error: any) { + return JSON.stringify({ + status: "error", + message: error.message, + code: error.code || "UNKNOWN_ERROR", + }); } - } \ No newline at end of file + } +} diff --git a/src/langchain/lulo/lulo_withdraw.ts b/src/langchain/lulo/lulo_withdraw.ts index fe2671d2..851387c4 100644 --- a/src/langchain/lulo/lulo_withdraw.ts +++ b/src/langchain/lulo/lulo_withdraw.ts @@ -2,36 +2,36 @@ import { Tool } from "langchain/tools"; import { SolanaAgentKit } from "../../agent"; export class SolanaLuloWithdrawTool extends Tool { - name = "solana_lulo_withdraw"; - description = `Withdraw token USDC using Lulo. (support USDC/PYUSD/USDS/USDT/SOL/jitoSOL/bSOL/mSOL/BONK/JUP) + name = "solana_lulo_withdraw"; + description = `Withdraw token USDC using Lulo. (support USDC/PYUSD/USDS/USDT/SOL/jitoSOL/bSOL/mSOL/BONK/JUP) Inputs (input is a json string): mintAddress: string, eg "So11111111111111111111111111111111111111112" (required) amount: number, eg 1, 0.01 (required)`; - constructor(private solanaKit: SolanaAgentKit) { - super(); - } + constructor(private solanaKit: SolanaAgentKit) { + super(); + } - async _call(input: string): Promise { - try { - const parsedInput = JSON.parse(input); - const mintAddress = parsedInput.mintAddress - const amount = parsedInput.amount; + async _call(input: string): Promise { + try { + const parsedInput = JSON.parse(input); + const mintAddress = parsedInput.mintAddress; + const amount = parsedInput.amount; - const tx = await this.solanaKit.luloWithdraw(mintAddress, amount); + const tx = await this.solanaKit.luloWithdraw(mintAddress, amount); - return JSON.stringify({ - status: "success", - message: "Asset withdraw successfully", - transaction: tx, - amount, - }); - } catch (error: any) { - return JSON.stringify({ - status: "error", - message: error.message, - code: error.code || "UNKNOWN_ERROR", - }); - } + return JSON.stringify({ + status: "success", + message: "Asset withdraw successfully", + transaction: tx, + amount, + }); + } catch (error: any) { + return JSON.stringify({ + status: "error", + message: error.message, + code: error.code || "UNKNOWN_ERROR", + }); } - } \ No newline at end of file + } +} diff --git a/src/langchain/meteora/index.ts b/src/langchain/meteora/index.ts new file mode 100644 index 00000000..62db3947 --- /dev/null +++ b/src/langchain/meteora/index.ts @@ -0,0 +1,2 @@ +export * from "./meteora_dlmm_pool"; +export * from "./meteora_dynamic_pool"; diff --git a/src/langchain/meteora/meteora_dlmm_pool.ts b/src/langchain/meteora/meteora_dlmm_pool.ts new file mode 100644 index 00000000..1ff15110 --- /dev/null +++ b/src/langchain/meteora/meteora_dlmm_pool.ts @@ -0,0 +1,78 @@ +import { PublicKey } from "@solana/web3.js"; +import { Tool } from "langchain/tools"; +import { SolanaAgentKit } from "../../agent"; +import { BN } from "bn.js"; + +export class SolanaMeteoraCreateDlmmPool extends Tool { + name = "meteora_create_dlmm_pool"; + description = `Create a Meteora DLMM Pool. This function doesn't add liquidity. + + Inputs (JSON string): + - tokenAMint: string, token A mint (required). + - tokenBMint: string, token B mint (required). + - binStep: number, pool bin step, e.g., 20 (required). + - initialPrice: number, pool initial price, e.g., 0.25 (required). + - feeBps: number, trade fee in percentage, e.g. 20 for 0.2% (required). + - priceRoundingUp: boolean, whether the initial price should be rounded up or not, default is true (optional). + - activationType: number, pool start trading time indicator. 0 is slot and 1 is timestamp, default is 1 for timestamp (optional). + - activationPoint: number, pool start trading slot / timestamp, default is null means pool can start trading immediately (optional). + - hasAlphaVault: boolean, whether the pool supports alpha vault, default is false (optional). + `; + + constructor(private solanaKit: SolanaAgentKit) { + super(); + } + + async _call(input: string): Promise { + try { + interface CreateMeteoraDlmmPoolInput { + tokenAMint: string; + tokenBMint: string; + binStep: number; + initialPrice: number; + feeBps: number; + priceRoundingUp?: boolean; + activationType?: number; + activationPoint?: number; + hasAlphaVault?: boolean; + } + const inputFormat: CreateMeteoraDlmmPoolInput = JSON.parse(input); + + const tokenAMint = new PublicKey(inputFormat.tokenAMint); + const tokenBMint = new PublicKey(inputFormat.tokenBMint); + const binStep = inputFormat.binStep; + const initialPrice = inputFormat.initialPrice; + const feeBps = inputFormat.feeBps; + const priceRoundingUp = inputFormat.priceRoundingUp ?? true; + const activationType = inputFormat.activationType ?? 1; + const activationPoint = inputFormat.activationPoint + ? new BN(inputFormat.activationPoint) + : undefined; + const hasAlphaVault = inputFormat.hasAlphaVault ?? false; + + const txId = await this.solanaKit.meteoraCreateDlmmPool( + tokenAMint, + tokenBMint, + binStep, + initialPrice, + priceRoundingUp, + feeBps, + activationType, + hasAlphaVault, + activationPoint, + ); + + return JSON.stringify({ + status: "success", + message: "Meteora DLMM pool created successfully.", + transaction: txId, + }); + } catch (error: any) { + return JSON.stringify({ + status: "error", + message: error.message, + code: error.code || "UNKNOWN_ERROR", + }); + } + } +} diff --git a/src/langchain/meteora/meteora_dynamic_pool.ts b/src/langchain/meteora/meteora_dynamic_pool.ts new file mode 100644 index 00000000..21dbc3f4 --- /dev/null +++ b/src/langchain/meteora/meteora_dynamic_pool.ts @@ -0,0 +1,111 @@ +import { PublicKey } from "@solana/web3.js"; +import { Tool } from "langchain/tools"; +import { SolanaAgentKit } from "../../agent"; +import { BN } from "bn.js"; +import { MintLayout } from "@solana/spl-token"; +import Decimal from "decimal.js"; + +export class SolanaMeteoraCreateDynamicPool extends Tool { + name = "meteora_create_dynamic_pool"; + description = `Create a Meteora Dynamic Pool. This function adds liquidity with a constant-product formula. + + Inputs (JSON string): + - tokenAMint: string, token A mint (required). + - tokenBMint: string, token B mint (required). + - tokenAAmount: number, token A amount not including decimals, e.g., 1 (required). + - tokenBAmount: number, token B amount not including decimals, e.g., 0.2 (required). + - tradeFeeNumerator: number, trade fee numerator, e.g., 2500 for 2.5% (required). + - activationType: number, pool start trading time indicator, 0 is slot and 1 is timestamp, default is 1 for timestamp (optional). + - activationPoint: number, pool start trading slot / timestamp, default is null means pool can start trading immediately (optional). + - hasAlphaVault: boolean, whether the pool supports alpha vault, default is false (optional). + `; + + constructor(private solanaKit: SolanaAgentKit) { + super(); + } + + async _call(input: string): Promise { + try { + interface CreateMeteoraDynamicAmmPoolInput { + tokenAMint: string; + tokenBMint: string; + tokenAAmount: number; + tokenBAmount: number; + tradeFeeNumerator: number; + activationType?: number; + activationPoint?: number; + hasAlphaVault?: boolean; + } + const inputFormat: CreateMeteoraDynamicAmmPoolInput = JSON.parse(input); + + const tokenAMint = new PublicKey(inputFormat.tokenAMint); + const tokenBMint = new PublicKey(inputFormat.tokenBMint); + + const tokenAMintInfo = + await this.solanaKit.connection.getAccountInfo(tokenAMint); + const tokenBMintInfo = + await this.solanaKit.connection.getAccountInfo(tokenBMint); + + if (!tokenAMintInfo) { + return JSON.stringify({ + status: "error", + message: "failed to fetch tokenAMint info", + code: "UNKNOWN_ERROR", + }); + } + if (!tokenBMintInfo) { + return JSON.stringify({ + status: "error", + message: "failed to fetch tokenBMint info", + code: "UNKNOWN_ERROR", + }); + } + + const tokenADecimals = MintLayout.decode(tokenAMintInfo.data).decimals; + const tokenBDecimals = MintLayout.decode(tokenBMintInfo.data).decimals; + + const tokenAAmount = new BN( + new Decimal(inputFormat.tokenAAmount) + .mul(10 ** tokenADecimals) + .toString(), + ); + const tokenBAmount = new BN( + new Decimal(inputFormat.tokenBAmount) + .mul(10 ** tokenBDecimals) + .toString(), + ); + + const tradeFeeNumerator = new BN( + inputFormat.tradeFeeNumerator.toString(), + ).toNumber(); + const activationType = inputFormat.activationType ?? 1; + const activationPoint = inputFormat.activationPoint + ? new BN(inputFormat.activationPoint) + : null; + const hasAlphaVault = inputFormat.hasAlphaVault ?? false; + + const txId = await this.solanaKit.meteoraCreateDynamicPool( + tokenAMint, + tokenBMint, + tokenAAmount, + tokenBAmount, + tradeFeeNumerator, + activationPoint, + hasAlphaVault, + activationType, + ); + + return JSON.stringify({ + status: "success", + message: "Meteora Dynamic pool created successfully.", + transaction: txId, + }); + } catch (error: any) { + return JSON.stringify({ + status: "error", + message: error.message, + code: error.code || "UNKNOWN_ERROR", + }); + } + } +} diff --git a/src/tools/index.ts b/src/tools/index.ts index b02c01c0..d7aa8791 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -24,5 +24,6 @@ export * from "./3land"; export * from "./tiplink"; export * from "./lightprotocol"; export * from "./squads"; +export * from "./meteora"; export * from "./helius"; export * from "./voltr"; diff --git a/src/tools/lulo/lulo_lend.ts b/src/tools/lulo/lulo_lend.ts index ab4610c7..e1e689d0 100644 --- a/src/tools/lulo/lulo_lend.ts +++ b/src/tools/lulo/lulo_lend.ts @@ -21,7 +21,7 @@ export async function luloLend( headers: { "Content-Type": "application/json", "x-wallet-pubkey": agent.wallet.publicKey.toBase58(), - "x-api-key": process.env.FLEXLEND_API_KEY! + "x-api-key": process.env.FLEXLEND_API_KEY!, }, body: JSON.stringify({ owner: agent.wallet.publicKey.toBase58(), @@ -30,7 +30,9 @@ export async function luloLend( }), }, ); - const { data: { transactionMeta } } = await response.json() + const { + data: { transactionMeta }, + } = await response.json(); // Deserialize the transaction const luloTxn = VersionedTransaction.deserialize( diff --git a/src/tools/lulo/lulo_withdraw.ts b/src/tools/lulo/lulo_withdraw.ts index cfc88b22..2ced78e9 100644 --- a/src/tools/lulo/lulo_withdraw.ts +++ b/src/tools/lulo/lulo_withdraw.ts @@ -25,7 +25,7 @@ export async function luloWithdraw( headers: { "Content-Type": "application/json", "x-wallet-pubkey": agent.wallet.publicKey.toBase58(), - "x-api-key": agent.config.FLEXLEND_API_KEY + "x-api-key": agent.config.FLEXLEND_API_KEY, }, body: JSON.stringify({ owner: agent.wallet.publicKey.toBase58(), @@ -35,7 +35,9 @@ export async function luloWithdraw( }, ); - const { data: { transactionMeta } } = await response.json() + const { + data: { transactionMeta }, + } = await response.json(); // Deserialize the transaction const luloTxn = VersionedTransaction.deserialize( diff --git a/src/tools/meteora/create_meteora_dlmm_pool.ts b/src/tools/meteora/create_meteora_dlmm_pool.ts new file mode 100644 index 00000000..c55d7c44 --- /dev/null +++ b/src/tools/meteora/create_meteora_dlmm_pool.ts @@ -0,0 +1,70 @@ +import { SolanaAgentKit } from "../../agent"; +import BN from "bn.js"; +import { PublicKey } from "@solana/web3.js"; +import DLMM, { ActivationType } from "@meteora-ag/dlmm"; +import { getMint } from "@solana/spl-token"; +import { sendTx } from "../../utils/send_tx"; + +/** + * Create Meteora DLMM pool + * @param agent SolanaAgentKit instance + * @param binStep DLMM pool bin step + * @param tokenAMint Token A mint + * @param tokenBMint Token B mint + * @param initialPrice Initial pool price in ratio tokenA / tokenB + * @param priceRoundingUp Whether to rounding up the initial pool price + * @param feeBps Pool trading fee in BPS + * @param activationType Pool activation type (ActivationType.Timestamp or ActivationType.Slot) + * @param hasAlphaVault Whether the pool has Meteora alpha vault or not + * @param activationPoint Activation point depending on activation type, or null if pool doesn't have an activation point + * @returns Transaction signature + */ +export async function createMeteoraDlmmPool( + agent: SolanaAgentKit, + binStep: number, + tokenAMint: PublicKey, + tokenBMint: PublicKey, + initialPrice: number, + priceRoundingUp: boolean, + feeBps: number, + activationType: ActivationType, + hasAlphaVault: boolean, + activationPoint: BN | undefined, +): Promise { + const tokenAMintInfo = await getMint(agent.connection, tokenAMint); + const tokenBMintInfo = await getMint(agent.connection, tokenBMint); + + const initPrice = DLMM.getPricePerLamport( + tokenAMintInfo.decimals, + tokenBMintInfo.decimals, + initialPrice, + ); + + const activateBinId = DLMM.getBinIdFromPrice( + initPrice, + binStep, + !priceRoundingUp, + ); + + const initPoolTx = await DLMM.createCustomizablePermissionlessLbPair( + agent.connection, + new BN(binStep), + tokenAMint, + tokenBMint, + new BN(activateBinId.toString()), + new BN(feeBps), + activationType, + hasAlphaVault, + agent.wallet_address, + activationPoint, + { + cluster: "mainnet-beta", + }, + ); + + const initPoolTxHash = await sendTx(agent, initPoolTx.instructions, [ + agent.wallet, + ]); + + return initPoolTxHash; +} diff --git a/src/tools/meteora/create_meteora_dynamic_amm_pool.ts b/src/tools/meteora/create_meteora_dynamic_amm_pool.ts new file mode 100644 index 00000000..b75ac6e0 --- /dev/null +++ b/src/tools/meteora/create_meteora_dynamic_amm_pool.ts @@ -0,0 +1,47 @@ +import AmmImpl from "@mercurial-finance/dynamic-amm-sdk"; +import { SolanaAgentKit } from "../../agent"; +import BN from "bn.js"; +import { PublicKey } from "@solana/web3.js"; +import { CustomizableParams } from "@mercurial-finance/dynamic-amm-sdk/dist/cjs/src/amm/types"; +import { sendTx } from "../../utils/send_tx"; + +/** + * Create Meteora Dynamic AMM pool + * @param agent SolanaAgentKit instance + * @param tokenAMint Token A mint + * @param tokenBMint Token B mint + * @param tokenAAmount Token A amount in lamport units + * @param tokenBAmount Token B amount in lamport units + * @param customizableParams Parameters to create Dynamic AMM pool + * tradeFeeNumerator (number): Trade fee numerator, with default denominator is 100000 + * activationType (enum): Should be ActivationType.Timestamp or ActivationType.Slot + * activationPoint (BN | null): Activation point depending on activation type, or null if pool doesn't have an activation point + * hasAlphaVault (boolean): Whether the pool has Meteora alpha vault or not + * padding (Array): Should be set to value Array(90).fill(0) + * @returns Transaction signature + */ +export async function createMeteoraDynamicAMMPool( + agent: SolanaAgentKit, + tokenAMint: PublicKey, + tokenBMint: PublicKey, + tokenAAmount: BN, + tokenBAmount: BN, + customizableParams: CustomizableParams, +): Promise { + const initPoolTx = + await AmmImpl.createCustomizablePermissionlessConstantProductPool( + agent.connection, + agent.wallet_address, + tokenAMint, + tokenBMint, + tokenAAmount, + tokenBAmount, + customizableParams, + ); + + const initPoolTxHash = await sendTx(agent, initPoolTx.instructions, [ + agent.wallet, + ]); + + return initPoolTxHash; +} diff --git a/src/tools/meteora/index.ts b/src/tools/meteora/index.ts new file mode 100644 index 00000000..2ba0ce92 --- /dev/null +++ b/src/tools/meteora/index.ts @@ -0,0 +1,2 @@ +export * from "./create_meteora_dlmm_pool"; +export * from "./create_meteora_dynamic_amm_pool"; diff --git a/test/tools/create_meteora_dlmm_pool.ts b/test/tools/create_meteora_dlmm_pool.ts new file mode 100644 index 00000000..59b52ef5 --- /dev/null +++ b/test/tools/create_meteora_dlmm_pool.ts @@ -0,0 +1,59 @@ +import { SolanaAgentKit, createSolanaTools } from "../../src"; +import { deploy_token } from "../../src/tools"; + +const agent = new SolanaAgentKit( + process.env.SOLANA_PRIVATE_KEY!, + process.env.RPC_URL!, + { OPENAI_API_KEY: process.env.OPENAI_API_KEY! }, +); + +async function main() { + console.log("<<< Test Create Meteora DLMM pool"); + + const { mint: tokenAMint } = await deploy_token( + agent, + "token_a_mint", + "www.example.com", + "TOKEN_A", + 6, + 100_000, + ); + const { mint: tokenBMint } = await deploy_token( + agent, + "token_b_mint", + "www.example.com", + "TOKEN_B", + 6, + 100_000, + ); + + // Delay for 5 seconds + await new Promise((resolve) => setTimeout(resolve, 5000)); + + const binStep = 20; + const initialPrice = 0.25; + const priceRoundingUp = true; + const feeBps = 20; + const activationType = 1; // timestamp + const hasAlphaVault = false; + const activationPoint = undefined; + + const txHash = await agent.meteoraCreateDlmmPool( + tokenAMint, + tokenBMint, + binStep, + initialPrice, + priceRoundingUp, + feeBps, + activationType, + hasAlphaVault, + activationPoint, + ); + console.log(`Tx successfully ${txHash.toString()}`); + + console.log(">>> Test Create Meteora DLMM Pool Passed"); +} + +main(); + +export { SolanaAgentKit, createSolanaTools }; diff --git a/test/tools/create_meteora_dynamic_amm_pool.ts b/test/tools/create_meteora_dynamic_amm_pool.ts new file mode 100644 index 00000000..e25d7687 --- /dev/null +++ b/test/tools/create_meteora_dynamic_amm_pool.ts @@ -0,0 +1,70 @@ +import { SolanaAgentKit, createSolanaTools } from "../../src"; +import { deploy_token } from "../../src/tools"; +import BN from "bn.js"; +import AmmImpl from "@mercurial-finance/dynamic-amm-sdk"; +import { deriveCustomizablePermissionlessConstantProductPoolAddress } from "@mercurial-finance/dynamic-amm-sdk/dist/cjs/src/amm/utils"; +import { METEORA_DYNAMIC_AMM_PROGRAM_ID } from "../../src/constants"; + +const agent = new SolanaAgentKit( + process.env.SOLANA_PRIVATE_KEY!, + process.env.RPC_URL!, + { OPENAI_API_KEY: process.env.OPENAI_API_KEY! }, +); + +async function main() { + console.log("<<< Test Create Meteora Dynamic AMM pool"); + + const { mint: tokenAMint } = await deploy_token( + agent, + "token_a_mint", + "www.example.com", + "TOKEN_A", + 6, + 100_000, + ); + const { mint: tokenBMint } = await deploy_token( + agent, + "token_b_mint", + "www.example.com", + "TOKEN_B", + 6, + 100_000, + ); + + // Delay for 5 seconds + await new Promise((resolve) => setTimeout(resolve, 5000)); + + const tokenAAmount = new BN(1000 * 10 ** 6); + const tokenBAmount = new BN(5 * 10 ** 6); + const params = { + tradeFeeNumerator: 2500, + activationPoint: null, + hasAlphaVault: false, + activationType: 0, + }; + const txHash = await agent.meteoraCreateDynamicPool( + tokenAMint, + tokenBMint, + tokenAAmount, + tokenBAmount, + params.tradeFeeNumerator, + params.activationPoint, + params.hasAlphaVault, + params.activationType, + ); + console.log(`Tx successfully ${txHash.toString()}`); + + const poolKey = deriveCustomizablePermissionlessConstantProductPoolAddress( + tokenAMint, + tokenBMint, + METEORA_DYNAMIC_AMM_PROGRAM_ID, + ); + const pool = await AmmImpl.create(agent.connection, poolKey); + await pool.updateState(); + + console.log(">>> Test Create Meteora Dynamic AMM Pool Passed"); +} + +main(); + +export { SolanaAgentKit, createSolanaTools };