diff --git a/ts-client/README.md b/ts-client/README.md index bbf67b32..71e4f442 100644 --- a/ts-client/README.md +++ b/ts-client/README.md @@ -40,8 +40,28 @@ const provider = new AnchorProvider(mainnetConnection, mockWallet, { }); // Alternatively, to use Solana Wallet Adapter -const constantProductPool = await AmmImpl.create(connection, MAINNET_POOL.USDC_SOL); -const stablePool = await AmmImpl.create(connection, MAINNET_POOL.USDT_USDC); +// https://station.jup.ag/blog/jupiter-token-list-api#endpoints +const tokenList = await fetch('https://token.jup.ag/all').then(res => res.json()); +const USDC = tokenList.find(token => token.address === ); +const USDT = tokenList.find(token => token.address === ); +const SOL = tokenList.find(token => token.address === ); +const constantProductPool = await AmmImpl.create(connection, MAINNET_POOL.USDC_SOL, USDC, SOL); +const stablePool = await AmmImpl.create(connection, MAINNET_POOL.USDT_USDC, USDT, USDC); + +// If you need to create multiple, can consider using `createMultiple` +const pools = [ + { + pool: MAINNET_POOL.USDC_SOL, + tokenInfoA: USDC, + tokenInfoB: SOL + }, + { + pool: MAINNET_POOL.USDT_USDC, + tokenInfoA: USDT, + tokenInfoB: USDC + } +] +const [constantProductPool, stablePool] = await AmmImpl.createMultiple(connection, pools) ``` 3. To interact with the AmmImpl diff --git a/ts-client/package.json b/ts-client/package.json index dba09bd5..4c01d321 100644 --- a/ts-client/package.json +++ b/ts-client/package.json @@ -1,6 +1,6 @@ { "name": "@mercurial-finance/dynamic-amm-sdk", - "version": "0.4.7", + "version": "0.4.8", "description": "Mercurial Vaults SDK is a typescript library that allows you to interact with Mercurial v2's AMM.", "main": "dist/cjs/index.js", "module": "dist/esm/index.js",