
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@storm-trade/dex-math
Advanced tools
Those methods are used to calculate different position and amm properties offchain based on current state.
Those methods are used to calculate different position and amm properties offchain based on current state.
AmmState
, AmmSettings
, FundingSettings
you can get in https://api5.storm.tg/api/markets or https://api5.storm.tg/api/markets/{address}
Position
you can get in https://api5.storm.tg/api/positions/{wallet_address}/active
For full API reference see https://api5.storm.tg/api/api-docs
calculateFundingRate(settings: AmmSettings, amm: AmmState, fundingSettings: FundingSettings | null): BN
calculateQuoteAssetWeight(amm: AmmState, terminalPrice: BN): { quoteAssetWeight: BN }
getAdjustedAmmState(amm: AmmState, terminalPrice: BN): AmmState
getCloseFee(positionNotional: Numeric, feeRate: Numeric, realizedRatio = 1): BN
getEntryPrice(position: Position): BN
getFee(params: GetFeeParams): BN
getFundingPremium(position: Position, amm: AmmState): BN
getIndexPrice(amm: AmmState): BN
getLeverage(position: Position, settlementOraclePrice: Numeric = 1): BN
getLiquidationPrice(position: Position, amm: AmmState, settings: AmmSettings, settlementOraclePrice: Numeric = 1, params: GetPriceByMarginRatioParams = {}): BN
getMarginRatio(position: Position, amm: AmmState, settings: AmmSettings, settlementOraclePrice: Numeric = 1, params: GetMarginRatioParams = {}): BN
getMarketPrice(amm: AmmState): BN
getMaximumLeverage(settings: AmmSettings): number
getMinimumLeverage(settings: AmmSettings): number
getPriceByProfitRate(profitRate: number, position: Position, amm: AmmState, settings: AmmSettings, settlementOraclePrice: Numeric = 1, params: GetPriceByMarginRatioParams = {}): BN
getPriceImpact(before: Numeric, after: Numeric): BN
getPriceSpread(amm: AmmState): Numeric
getQuoteAssetWeight(amm: AmmState, terminalPrice: BN): BN
getQuoteAssetWeight(amm: AmmState, terminalPrice: BN): BN
getRemainMarginWithFundingPayment(position: Position, amm: AmmState, settings: AmmSettings, settlementOraclePrice: Numeric = 1, params: GetRemainMarginWithFundingPaymentParams = {}): RemainMarginOutput
getRolloverFee(position: Position, settings: AmmSettings, params: GetRolloverFeeParams = {}): BN
swapInput(amm: AmmState, quoteAssetIn: Numeric, isShort: boolean): SwapInputResult
swapOutput(amm: AmmState, baseAssetIn: Numeric): SwapOutputResult
All BN's are intergers with 9 decimal places
FAQs
Those methods are used to calculate different position and amm properties offchain based on current state.
We found that @storm-trade/dex-math demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.