Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@jup-ag/crema-sdk
Advanced tools
npm i @cremafinance/crema-sdk
npm run build
import { TokenSwap } from '@cremafinance/crema-sdk'
const swap = await new TokenSwap(conn, swapProgramId, swapKey, null).load()
const amountOut: any = await swap.preSwapA(amountIn) // a->b
const amountOut: any = await swap.preSwapB(amountIn) // b->a
amountIn: Decimal (using decimal.js repo)
Assuming the current price is $P_{c}$,the price range that users add liquidity in is $[P_{a},P_{b}]$
$
\LARGE
L = \begin {cases}
¦ {Δx} \over {1 \over {\sqrt{P_{a}}}} - {1 \over {\sqrt{P_{b}}}} &, \text P_{c} < P_{a} \
¦ {Δy} \over {\sqrt{P_{b}} - \sqrt{P_{a}}} &, \text P_{c} > P_{b}\
¦ {{Δx} \over {1 \over {\sqrt{P_{c}}}} - {1 \over {\sqrt{P_{b}}}}} = {{Δy} \over {\sqrt{P_{c}} - \sqrt{P_{a}}}} &, \text P_{c} \in [P_{a},P_{b}] \
\end {cases}
$
FAQs
the front sdk for crema swap
The npm package @jup-ag/crema-sdk receives a total of 2,382 weekly downloads. As such, @jup-ag/crema-sdk popularity was classified as popular.
We found that @jup-ag/crema-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.