{"id":22608926,"url":"https://github.com/bitfinexcom/lib-js-util-math","last_synced_at":"2025-04-11T06:14:04.936Z","repository":{"id":54963090,"uuid":"210589156","full_name":"bitfinexcom/lib-js-util-math","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-14T21:34:22.000Z","size":58,"stargazers_count":2,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T06:13:59.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfinexcom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-24T11:45:43.000Z","updated_at":"2023-08-14T21:34:27.000Z","dependencies_parsed_at":"2022-08-14T07:31:14.469Z","dependency_job_id":null,"html_url":"https://github.com/bitfinexcom/lib-js-util-math","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Flib-js-util-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Flib-js-util-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Flib-js-util-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Flib-js-util-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/lib-js-util-math/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248351393,"owners_count":21089270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T15:10:06.809Z","updated_at":"2025-04-11T06:14:04.910Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lib-js-util-math\n\nThe lib includes the utilities depicted below:\n- `BN` - BigNumber utilities\n- `Array utilites` - Array utilites like min, max, median and avg with big number manipulation\n- `VWAP` - Volume Weighted Average Price (VWAP) index utilities\n- `Standard Deviation` - Standard deviation utilities\n- `SMA` - Simple Moving Average \n- `EMA` - Exponential Moving Average \n- `TWAP` - Time Weighted Average Price utilities\n- `Impact mid price` - Mid price from bids and asks until specific book depth\n\n## Installing\n```console\nnpm install --save https://github.com/bitfinexcom/lib-js-util-math.git\n```\n\n## Testing\n```console\nnpm run test\n```\n\n## Usage\n```javascript\nconst data = [\n  { price: nBN(10500), y: 'jan', volume: '1' },\n  { price: nBN(10700), y: 'feb', volume: '0.33' },\n  { price: nBN(11500), y: 'mar', volume: '2.13' },\n  { price: nBN('12300'), y: 'apr', volume: '5.26' },\n  { price: nBN(5000), y: 'may', volume: '0.77' },\n  { price: nBN(5100), y: 'jun', volume: '1.52' }\n]\n\nconst vwap = VWAP(data)\nconsole.log(vwap) // 10429.24613987284287011807\n\nconst dev = stdDeviation(data, a =\u003e a.price)\nconsole.log(dev.toFixed()) // 2980.16591633568094682823\n\n```\n\n## Authors\n- prdn\n- robertkowalski\n- vigan-abd\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Flib-js-util-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Flib-js-util-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Flib-js-util-math/lists"}