{"_id":"@double-mangoes/drift-sdk","_rev":"3-3773ef462341f25c5ecc3a7d5a935da2","name":"@double-mangoes/drift-sdk","dist-tags":{"latest":"2.60.0-beta.6.0.0.4"},"versions":{"2.60.0-beta.6.0.0.1":{"name":"@double-mangoes/drift-sdk","version":"2.60.0-beta.6.0.0.1","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"crispheaney"},"scripts":{"lint":"eslint './**/*.{ts,tsx}' --quiet","build":"yarn clean && tsc","clean":"rm -rf lib","test":"mocha -r ts-node/register tests/**/*.ts","test:inspect":"mocha --inspect-brk -r ts-node/register tests/**/*.ts","test:bignum":"mocha -r ts-node/register tests/bn/**/*.ts","patch-and-pub":"npm version patch --force && npm publish","prettify":"prettier --check './src/***/*.ts'","prettify:fix":"prettier --write './{src,tests}/***/*.ts'","version":"node ./scripts/updateVersion.js"},"keywords":["drift-labs","drift","perps"],"license":"Apache-2.0","directories":{"lib":"lib"},"publishConfig":{"access":"public"},"dependencies":{"@coral-xyz/anchor":"0.28.1-beta.2","@ellipsis-labs/phoenix-sdk":"^1.4.2","@project-serum/serum":"^0.13.38","@pythnetwork/client":"2.5.3","@solana/spl-token":"^0.3.7","@solana/web3.js":"1.73.2","strict-event-emitter-types":"^2.0.0","uuid":"^8.3.2"},"devDependencies":{"object-sizeof":"^2.6.3","@types/big.js":"^6.2.0","@types/bn.js":"^5.1.3","@types/chai":"^4.3.1","@types/jest":"^28.1.3","@types/mocha":"^9.1.1","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","chai":"^4.3.6","encoding":"^0.1.13","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","lodash":"^4.17.21","mocha":"^10.0.0","prettier":"^3.0.1","ts-node":"^10.8.0","typescript":"^4.9.5"},"description":"SDK for Drift Protocol","engines":{"node":">=12"},"gitHead":"0d2a198f21d7567eb208d7d99afbb3b1c6eed2bb","_id":"@double-mangoes/drift-sdk@2.60.0-beta.6.0.0.1","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-IUuYk16e5AsaT0mj2gYITFY0jSOtfUHJ8eY5Ovw350vLLwdn6OW+crrF77DSmWF6ePSeyU/k4JWNpU8BRzrvAg==","shasum":"924b3b180beb19143013e1501ef59cefa0ff5025","tarball":"https://registry.npmjs.org/@double-mangoes/drift-sdk/-/drift-sdk-2.60.0-beta.6.0.0.1.tgz","fileCount":425,"unpackedSize":3882473,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKf23X4ckAD2vGRQqoIn02yWHpjp9V28IqpcOog09zpQIgK+r6loTSH/s+/19BmGjU6R76R9EcDC0JBdmmgWdXvnw="}]},"_npmUser":{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"},"maintainers":[{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/drift-sdk_2.60.0-beta.6.0.0.1_1707129477520_0.1649786479911879"},"_hasShrinkwrap":false},"2.60.0-beta.6.0.0.2":{"name":"@double-mangoes/drift-sdk","version":"2.60.0-beta.6.0.0.2","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"crispheaney"},"scripts":{"lint":"eslint './**/*.{ts,tsx}' --quiet","build":"yarn clean && tsc","clean":"rm -rf lib","test":"mocha -r ts-node/register tests/**/*.ts","test:inspect":"mocha --inspect-brk -r ts-node/register tests/**/*.ts","test:bignum":"mocha -r ts-node/register tests/bn/**/*.ts","patch-and-pub":"npm version patch --force && npm publish","prettify":"prettier --check './src/***/*.ts'","prettify:fix":"prettier --write './{src,tests}/***/*.ts'","version":"node ./scripts/updateVersion.js"},"keywords":["drift-labs","drift","perps"],"license":"Apache-2.0","directories":{"lib":"lib"},"publishConfig":{"access":"public"},"dependencies":{"@coral-xyz/anchor":"0.28.1-beta.2","@ellipsis-labs/phoenix-sdk":"^1.4.2","@project-serum/serum":"^0.13.38","@pythnetwork/client":"2.5.3","@solana/spl-token":"^0.3.7","@solana/web3.js":"1.73.2","strict-event-emitter-types":"^2.0.0","uuid":"^8.3.2"},"devDependencies":{"object-sizeof":"^2.6.3","@types/big.js":"^6.2.0","@types/bn.js":"^5.1.3","@types/chai":"^4.3.1","@types/jest":"^28.1.3","@types/mocha":"^9.1.1","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","chai":"^4.3.6","encoding":"^0.1.13","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","lodash":"^4.17.21","mocha":"^10.0.0","prettier":"^3.0.1","ts-node":"^10.8.0","typescript":"^4.9.5"},"description":"SDK for Drift Protocol","engines":{"node":">=12"},"gitHead":"0d2a198f21d7567eb208d7d99afbb3b1c6eed2bb","_id":"@double-mangoes/drift-sdk@2.60.0-beta.6.0.0.2","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-A8ybgTPIg6R/BtOEa+vioKo93uUXn9P/EHprc4+n3Skn6qOd98U4y0oOQCYnF5nQqqESLtVGlLeF1oFpm4CzBQ==","shasum":"0d420763d9ceeead2caee26ef7651a88cb40bbb3","tarball":"https://registry.npmjs.org/@double-mangoes/drift-sdk/-/drift-sdk-2.60.0-beta.6.0.0.2.tgz","fileCount":425,"unpackedSize":3883874,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7iRWtAY8vjQSvLrMRd5mZtTSSBEcwxQTckFkkI0S36wIga8Ie+2VH4506gzdD093SvIjDmcYgNZ5ejVhE+fKABHc="}]},"_npmUser":{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"},"maintainers":[{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/drift-sdk_2.60.0-beta.6.0.0.2_1707194881679_0.5847885143940883"},"_hasShrinkwrap":false},"2.60.0-beta.6.0.0.3":{"name":"@double-mangoes/drift-sdk","version":"2.60.0-beta.6.0.0.3","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"crispheaney"},"scripts":{"lint":"eslint './**/*.{ts,tsx}' --quiet","build":"yarn clean && tsc","clean":"rm -rf lib","test":"mocha -r ts-node/register tests/**/*.ts","test:inspect":"mocha --inspect-brk -r ts-node/register tests/**/*.ts","test:bignum":"mocha -r ts-node/register tests/bn/**/*.ts","patch-and-pub":"npm version patch --force && npm publish","prettify":"prettier --check './src/***/*.ts'","prettify:fix":"prettier --write './{src,tests}/***/*.ts'","version":"node ./scripts/updateVersion.js"},"keywords":["drift-labs","drift","perps"],"license":"Apache-2.0","directories":{"lib":"lib"},"publishConfig":{"access":"public"},"dependencies":{"@coral-xyz/anchor":"0.28.1-beta.2","@ellipsis-labs/phoenix-sdk":"^1.4.2","@project-serum/serum":"^0.13.38","@pythnetwork/client":"2.5.3","@solana/spl-token":"^0.3.7","@solana/web3.js":"1.73.2","strict-event-emitter-types":"^2.0.0","uuid":"^8.3.2"},"devDependencies":{"object-sizeof":"^2.6.3","@types/big.js":"^6.2.0","@types/bn.js":"^5.1.3","@types/chai":"^4.3.1","@types/jest":"^28.1.3","@types/mocha":"^9.1.1","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","chai":"^4.3.6","encoding":"^0.1.13","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","lodash":"^4.17.21","mocha":"^10.0.0","prettier":"^3.0.1","ts-node":"^10.8.0","typescript":"^4.9.5"},"description":"SDK for Drift Protocol","engines":{"node":">=12"},"gitHead":"0d2a198f21d7567eb208d7d99afbb3b1c6eed2bb","_id":"@double-mangoes/drift-sdk@2.60.0-beta.6.0.0.3","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-K8gEAjHCZEWo5fn8BiGdsKr6XKVexy+lAsDjy3gZ2DpaEdxB6y3u86jDtF0i/mcdEOe2ZXVRKK3KYGipCSn9Vw==","shasum":"035551afad66a5c634cf654116f3787553ba0e50","tarball":"https://registry.npmjs.org/@double-mangoes/drift-sdk/-/drift-sdk-2.60.0-beta.6.0.0.3.tgz","fileCount":425,"unpackedSize":3882114,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCx2MTVDInu/u6mJP5+1oFHH+e2ldSRyeVXo9+9SjEbugIhAOQ2iFsqeO4TmqlVG1OCLPTdvKOMTAG8Dd+vjMFYQV7Y"}]},"_npmUser":{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"},"maintainers":[{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/drift-sdk_2.60.0-beta.6.0.0.3_1707200717696_0.0458658268443084"},"_hasShrinkwrap":false},"2.60.0-beta.6.0.0.4":{"name":"@double-mangoes/drift-sdk","version":"2.60.0-beta.6.0.0.4","main":"lib/index.js","types":"lib/index.d.ts","author":{"name":"crispheaney"},"scripts":{"lint":"eslint './**/*.{ts,tsx}' --quiet","build":"yarn clean && tsc","clean":"rm -rf lib","test":"mocha -r ts-node/register tests/**/*.ts","test:inspect":"mocha --inspect-brk -r ts-node/register tests/**/*.ts","test:bignum":"mocha -r ts-node/register tests/bn/**/*.ts","patch-and-pub":"npm version patch --force && npm publish","prettify":"prettier --check './src/***/*.ts'","prettify:fix":"prettier --write './{src,tests}/***/*.ts'","version":"node ./scripts/updateVersion.js"},"keywords":["drift-labs","drift","perps"],"license":"Apache-2.0","directories":{"lib":"lib"},"publishConfig":{"access":"public"},"dependencies":{"@coral-xyz/anchor":"0.28.1-beta.2","@ellipsis-labs/phoenix-sdk":"^1.4.2","@project-serum/serum":"^0.13.38","@pythnetwork/client":"2.5.3","@solana/spl-token":"^0.3.7","@solana/web3.js":"1.73.2","strict-event-emitter-types":"^2.0.0","uuid":"^8.3.2"},"devDependencies":{"object-sizeof":"^2.6.3","@types/big.js":"^6.2.0","@types/bn.js":"^5.1.3","@types/chai":"^4.3.1","@types/jest":"^28.1.3","@types/mocha":"^9.1.1","@typescript-eslint/eslint-plugin":"^4.28.0","@typescript-eslint/parser":"^4.28.0","chai":"^4.3.6","encoding":"^0.1.13","eslint":"^7.29.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","lodash":"^4.17.21","mocha":"^10.0.0","prettier":"^3.0.1","ts-node":"^10.8.0","typescript":"^4.9.5"},"description":"SDK for Drift Protocol","engines":{"node":">=12"},"gitHead":"0d2a198f21d7567eb208d7d99afbb3b1c6eed2bb","_id":"@double-mangoes/drift-sdk@2.60.0-beta.6.0.0.4","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-9wwQUpHQphJTq91QXAVHQyyN8D+QvKCu4iVxcDWfdqWUkjQwuEw8SNi21KRQYKKDLGV3+Uhbsz1PCfmoQszPSQ==","shasum":"95523f04bedf593147f904584c69f13aa0ac063b","tarball":"https://registry.npmjs.org/@double-mangoes/drift-sdk/-/drift-sdk-2.60.0-beta.6.0.0.4.tgz","fileCount":425,"unpackedSize":3882744,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCirSLfh//DbmVTTZttwAomiKTzphWndrVjQt21KYMI+wIhAO7OCCU8voCboy5b+qhc+cxmTIfMv9i4gsfgiT03FK4T"}]},"_npmUser":{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"},"maintainers":[{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/drift-sdk_2.60.0-beta.6.0.0.4_1707229241567_0.27125747502094977"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-05T10:37:57.395Z","2.60.0-beta.6.0.0.1":"2024-02-05T10:37:57.747Z","modified":"2024-02-06T14:20:41.940Z","2.60.0-beta.6.0.0.2":"2024-02-06T04:48:01.883Z","2.60.0-beta.6.0.0.3":"2024-02-06T06:25:17.904Z","2.60.0-beta.6.0.0.4":"2024-02-06T14:20:41.799Z"},"maintainers":[{"name":"double-mangoes","email":"huongduongtrang0@gmail.com"}],"description":"SDK for Drift Protocol","keywords":["drift-labs","drift","perps"],"author":{"name":"crispheaney"},"license":"Apache-2.0","readme":"<div align=\"center\">\n  <img height=\"120x\" src=\"https://uploads-ssl.webflow.com/611580035ad59b20437eb024/616f97a42f5637c4517d0193_Logo%20(1)%20(1).png\" />\n\n  <h1 style=\"margin-top:20px;\">Drift Protocol v2</h1>\n\n  <p>\n    <a href=\"https://www.npmjs.com/package/@double-mangoes/drift-sdk\"><img alt=\"SDK npm package\" src=\"https://img.shields.io/npm/v/@double-mangoes/drift-sdk\" /></a>\n    <a href=\"https://drift-labs.github.io/protocol-v2/sdk/\"><img alt=\"Docs\" src=\"https://img.shields.io/badge/docs-tutorials-blueviolet\" /></a>\n    <a href=\"https://discord.com/channels/849494028176588802/878700556904980500\"><img alt=\"Discord Chat\" src=\"https://img.shields.io/discord/889577356681945098?color=blueviolet\" /></a>\n    <a href=\"https://opensource.org/licenses/Apache-2.0\"><img alt=\"License\" src=\"https://img.shields.io/github/license/project-serum/anchor?color=blueviolet\" /></a>\n  </p>\n</div>\n\n## Installation\n\n```\nnpm i @double-mangoes/drift-sdk\n```\n\n## Getting Started\n\n### Setting up a wallet for your program\n\n```bash\n# Generate a keypair\nsolana-keygen new\n\n# Get the pubkey for the new wallet (You will need to send USDC to this address to Deposit into Drift (only on mainnet - devnet has a faucet for USDC))\nsolana address\n\n# Put the private key into your .env to be used by your bot\ncd {projectLocation}\necho BOT_PRIVATE_KEY=`cat ~/.config/solana/id.json` >> .env\n```\n\n## Concepts\n\n### BN / Precision\n\nThe Drift SDK uses BigNum (BN), using [this package](https://github.com/indutny/bn.js/), to represent numerical values. This is because Solana tokens tend to use levels of precision which are too precise for standard Javascript floating point numbers to handle. All numbers in BN are represented as integers, and we will often denote the `precision` of the number so that it can be converted back down to a regular number.\n\n```bash\nExample:\na BigNum: 10,500,000, with precision 10^6, is equal to 10.5 because 10,500,000 / 10^6 = 10.5.\n```\n\nThe Drift SDK uses some common precisions, which are available as constants to import from the SDK.\n\n| Precision Name        | Value |\n| --------------------- | ----- |\n| FUNDING_RATE_BUFFER   | 10^3  |\n| QUOTE_PRECISION       | 10^6  |\n| PEG_PRECISION         | 10^6  |\n| PRICE_PRECISION       | 10^6  |\n| AMM_RESERVE_PRECISION | 10^9  |\n| BASE_PRECISION        | 10^9  |\n\n**Important Note for BigNum division**\n\nBecause BN only supports integers, you need to be conscious of the numbers you are using when dividing. BN will return the floor when using the regular division function; if you want to get the exact division, you need to add the modulus of the two numbers as well. There is a helper function `convertToNumber` in the SDK which will do this for you.\n\n```typescript\nimport {convertToNumber} from @double-mangoes/drift-sdk\n\n// Gets the floor value\nnew BN(10500).div(new BN(1000)).toNumber(); // = 10\n\n// Gets the exact value\nnew BN(10500).div(new BN(1000)).toNumber() + BN(10500).mod(new BN(1000)).toNumber(); // = 10.5\n\n// Also gets the exact value\nconvertToNumber(new BN(10500), new BN(1000)); // = 10.5\n```\n\n## Examples\n\n### Setting up an account and making a trade\n\n```typescript\nimport { AnchorProvider, BN } from '@coral-xyz/anchor';\nimport { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token';\nimport { Connection, Keypair, PublicKey } from '@solana/web3.js';\nimport {\n\tcalculateReservePrice,\n\tDriftClient,\n\tUser,\n\tinitialize,\n\tPositionDirection,\n\tconvertToNumber,\n\tcalculateTradeSlippage,\n\tPRICE_PRECISION,\n\tQUOTE_PRECISION,\n\tWallet,\n\tPerpMarkets,\n\tBASE_PRECISION,\n\tgetMarketOrderParams,\n\tBulkAccountLoader,\n\tgetMarketsAndOraclesForSubscription\n} from '../sdk';\n\nexport const getTokenAddress = (\n\tmintAddress: string,\n\tuserPubKey: string\n): Promise<PublicKey> => {\n\treturn Token.getAssociatedTokenAddress(\n\t\tnew PublicKey(`ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL`),\n\t\tTOKEN_PROGRAM_ID,\n\t\tnew PublicKey(mintAddress),\n\t\tnew PublicKey(userPubKey)\n\t);\n};\n\nconst main = async () => {\n\tconst env = 'devnet';\n\t// Initialize Drift SDK\n\tconst sdkConfig = initialize({ env });\n\n\t// Set up the Wallet and Provider\n\tconst privateKey = process.env.BOT_PRIVATE_KEY; // stored as an array string\n\tconst keypair = Keypair.fromSecretKey(\n\t\tUint8Array.from(JSON.parse(privateKey))\n\t);\n\tconst wallet = new Wallet(keypair);\n\n\t// Set up the Connection\n\tconst rpcAddress = process.env.RPC_ADDRESS; // can use: https://api.devnet.solana.com for devnet; https://api.mainnet-beta.solana.com for mainnet;\n\tconst connection = new Connection(rpcAddress);\n\n\t// Set up the Provider\n\tconst provider = new AnchorProvider(\n\t\tconnection,\n\t\twallet,\n\t\tAnchorProvider.defaultOptions()\n\t);\n\n\t// Check SOL Balance\n\tconst lamportsBalance = await connection.getBalance(wallet.publicKey);\n\tconsole.log('SOL balance:', lamportsBalance / 10 ** 9);\n\n\t// Misc. other things to set up\n\tconst usdcTokenAddress = await getTokenAddress(\n\t\tsdkConfig.USDC_MINT_ADDRESS,\n\t\twallet.publicKey.toString()\n\t);\n\n\t// Set up the Drift Client\n\tconst driftPublicKey = new PublicKey(sdkConfig.DRIFT_PROGRAM_ID);\n\tconst bulkAccountLoader = new BulkAccountLoader(\n\t\tconnection,\n\t\t'confirmed',\n\t\t1000\n\t);\n\tconst driftClient = new DriftClient({\n\t\tconnection,\n\t\twallet: provider.wallet,\n\t\tprogramID: driftPublicKey,\n\t\t...getMarketsAndOraclesForSubscription(env),\n\t\taccountSubscription: {\n\t\t\ttype: 'polling',\n\t\t\taccountLoader: bulkAccountLoader,\n\t\t},\n\t});\n\tawait driftClient.subscribe();\n\n\t// Set up user client\n\tconst user = new User({\n\t\tdriftClient: driftClient,\n\t\tuserAccountPublicKey: await driftClient.getUserAccountPublicKey(),\n\t\taccountSubscription: {\n\t\t\ttype: 'polling',\n\t\t\taccountLoader: bulkAccountLoader,\n\t\t},\n\t});\n\n\t//// Check if user account exists for the current wallet\n\tconst userAccountExists = await user.exists();\n\n\tif (!userAccountExists) {\n\t\t//// Create a Clearing House account by Depositing some USDC ($10,000 in this case)\n\t\tconst depositAmount = new BN(10000).mul(QUOTE_PRECISION);\n\t\tawait driftClient.initializeUserAccountAndDepositCollateral(\n\t\t\tdepositAmount,\n\t\t\tawait getTokenAddress(\n\t\t\t\tusdcTokenAddress.toString(),\n\t\t\t\twallet.publicKey.toString()\n\t\t\t)\n\t\t);\n\t}\n\n\tawait user.subscribe();\n\n\t// Get current price\n\tconst solMarketInfo = PerpMarkets[env].find(\n\t\t(market) => market.baseAssetSymbol === 'SOL'\n\t);\n\n\tconst [bid, ask] = calculateBidAskPrice(\n\t\tdriftClient.getPerpMarketAccount(marketIndex).amm,\n\t\tdriftClient.getOracleDataForPerpMarket(marketIndex)\n\t);\n\n\tconst formattedBidPrice = convertToNumber(bid, PRICE_PRECISION);\n\tconst formattedAskPrice = convertToNumber(ask, PRICE_PRECISION);\n\n\tconsole.log(\n\t\t`Current amm bid and ask price are $${formattedBidPrice} and $${formattedAskPrice}`\n\t);\n\n\t// Estimate the slippage for a $5000 LONG trade\n\tconst solMarketAccount = driftClient.getPerpMarketAccount(\n\t\tsolMarketInfo.marketIndex\n\t);\n\n\tconst slippage = convertToNumber(\n\t\tcalculateTradeSlippage(\n\t\t\tPositionDirection.LONG,\n\t\t\tnew BN(1).mul(BASE_PRECISION),\n\t\t\tsolMarketAccount,\n\t\t\t'base',\n\t\t\tdriftClient.getOracleDataForPerpMarket(solMarketInfo.marketIndex)\n\t\t)[0],\n\t\tPRICE_PRECISION\n\t);\n\n\tconsole.log(`Slippage for a 1 SOL-PERP would be $${slippage}`);\n\n\tawait driftClient.placePerpOrder(\n\t\tgetMarketOrderParams({\n\t\t\tbaseAssetAmount: new BN(1).mul(BASE_PRECISION),\n\t\t\tdirection: PositionDirection.LONG,\n\t\t\tmarketIndex: solMarketAccount.marketIndex,\n\t\t})\n\t);\n\tconsole.log(`Placed a 1 SOL-PERP LONG order`);\n};\n\nmain();\n```\n\n## License\n\nDrift Protocol v2 is licensed under [Apache 2.0](./LICENSE).\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in Drift SDK by you, as defined in the Apache-2.0 license, shall be\nlicensed as above, without any additional terms or conditions.\n\n","readmeFilename":"README.md"}