Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@iqprotocol/energy

Package Overview
Dependencies
Maintainers
7
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iqprotocol/energy

This package is part of [IQ Protocol JS SDK.](https://github.com/iqalliance/iq-sdk-js)

  • 0.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
7
Weekly downloads
 
Created
Source

Energy Utils

This package is part of IQ Protocol JS SDK.

The package provided various utility functions for energy calculation.

Installation

yarn add @iqprotocol/energy

Usage

import { calculateEnergyCap } from '@iqprotocol/energy';

const params = {
  power: 100n,
  initialValue: 50n, // power at t0
  gapHalvingPeriod: 86400,
  t0: 1629906900,
  t1: 1629906900 + 86400
};

const energyCap = calculateEnergyCap(params); // 75n 

Energy & Power

In IQ protocol Power is the reinterpreted pTokens balance that is responsible for Energy generation. Simply 1 pToken = 1 Unit of Power. Whereas the Energy is a spendable asset that is generated over time by the Power.

Linear Energy the actual energy value at the specific time. As the name implies, it changes linearly over time.

Energy Cap is the potential maximum possible energy value at specific time. It corresponds to the IQ protocol Proof Of Hold.

Effective Energy is the current available energy. It is the lowest value between the current linear energy value and energy cap.

FAQs

Package last updated on 06 Sep 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc