mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-16 16:21:32 +03:00
change getAmountByORN formula
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.10-rc30",
|
||||
"version": "0.20.10-rc31",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.10-rc30",
|
||||
"version": "0.20.10-rc31",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.10-rc30",
|
||||
"version": "0.20.10-rc31",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from './schemas';
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { DAY, WEEK_DAYS, YEAR } from '../../constants';
|
||||
import { WEEK_DAYS, YEAR } from '../../constants';
|
||||
import { LOCK_START_TIME } from './constants';
|
||||
|
||||
type BasePayload = {
|
||||
@@ -124,11 +124,10 @@ class IndexerService {
|
||||
return BigNumber(amount).dividedBy(this.getK(timestamp));
|
||||
};
|
||||
|
||||
readonly getAmountByORN = (amountToken: string, timeLock: number) => {
|
||||
readonly getAmountByORN = (amountToken: string, lockingDays: number) => {
|
||||
const alpha = 730 / (30 - Math.sqrt(730 / 7)) ** (1 / 3);
|
||||
const timestamp = Date.now() / 1000;
|
||||
|
||||
const deltaDaysBN = BigNumber(timeLock).minus(timestamp).dividedBy(DAY);
|
||||
const deltaDaysBN = BigNumber(lockingDays);
|
||||
|
||||
if (deltaDaysBN.lte(0)) return BigNumber(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user