Socket
Socket
Sign inDemoInstall

@iqprotocol/energy

Package Overview
Dependencies
Maintainers
10
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/iqlabsorg/iq-sdk-js)


Version published
Weekly downloads
4
Maintainers
10
Weekly downloads
 
Created
Source

Energy Utils

This package is part of IQ Protocol JS SDK.

:exclamation: The package is in development and breaking changes should be expected. Use at your own risk!

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 20 Jul 2022

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