npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@solace-fi/hydrate

v0.1.3

Published

This **alpha** library is intended to do three things:

Downloads

10

Readme

hydrate

This alpha library is intended to do three things:

1 - Generate n Monte Carlo simulation trials
2 - Return a quantile value for any give probability (0-1)
3 - Return a probability for any given quantile value.

Each of the following functions takes as input a SIPMath Library or Metalog* aCoefficients and boundaries. The SIPmath 3.0 standard is expected as the input format. See ProbabilityManagement.org for specifications.

The following functions are supported:

import { hydrateLibrary, metalog, simulateSIP, listSIPs, p ,q } from "@solace-fi/hydrate"

// Generate n Monte Carlo Trials for each distribution found in the input SIPMath 'library'
hydrateLibrary(example_tokens, 10) // first 10 trials for all SIPs in the library

// Return an array of the names for the SIPs found in a SIPMath Library
listSIPs(example_tokens) // eg ['AAVE', 'SOLACE', 'ETH']

// Generate n Monte Carlo Trials for a distribution found in the input SIPMath 'library'
simulateSIP(example_tokens, 'AAVE', 10)

// Returns the value at the probability of y (0 - 1) 
const y = 0.9 // the probability that a value will be occur
const a = example_bounded.sips[3].arguments.aCoefficients // array of Metalog aCoefficients 
const bu = example_bounded.sips[3].arguments.upperBound // may be empty string
const bl = example_bounded.sips[3].arguments.lowerBound // may be empty string
metalog(y, a, bl, bu)

// Returns the qualtile values at the probabiliies of p[] (0 - 1)  
const p = [0.9, 0.5, 0.1] // variable represents the probability values to find quantiles for
const a = example_tokens.sips[0].arguments.aCoefficients // see src/json folder for example_xyz
q(p, a, undefined, undefined)

// Returns the probabilities at the quantile values []
const q = [1.01, 1.0, 0.98] // variable represents the quantile values to find probabilities for
const a = example_tokens.sips[0].arguments.aCoefficients // see src/json folder for example_xyz
p(q, a, 3) 

Hydrate works with the output from Solace /volatility endpoint https://risk-data-docs.solace.fi/ and any SIPMath 3.0 compliant libraries. Example libraries can be found in the Hydrate repository
TODO Update swagger with /volatility and /price-history

*Metalog package can be found at https://pypi.org/project/metalog/