@reyaxyz/common 0.310.2 → 0.311.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,5 +6,5 @@
6
6
 
7
7
  | Statements | Branches | Functions | Lines |
8
8
  | --------------------------- | ----------------------- | ------------------------- | ----------------- |
9
- | ![Statements](https://img.shields.io/badge/statements-20.39%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-18%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-10.26%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-22.11%25-red.svg?style=flat) |
9
+ | ![Statements](https://img.shields.io/badge/statements-20.49%25-red.svg?style=flat) | ![Branches](https://img.shields.io/badge/branches-18.18%25-red.svg?style=flat) | ![Functions](https://img.shields.io/badge/functions-10.31%25-red.svg?style=flat) | ![Lines](https://img.shields.io/badge/lines-22.23%25-red.svg?style=flat) |
10
10
 
@@ -1,28 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.calculateMaxPriceLimit = exports.calculatePriceLimitForTrade = void 0;
7
- var bignumber_js_1 = __importDefault(require("bignumber.js"));
3
+ exports.calculateMaxPriceLimit = void 0;
8
4
  var ethers_1 = require("ethers");
9
- // todo: need the ability to supply custom slippage or use a more conservative default for the slippage tolerance
10
- function calculatePriceLimitForTrade(orderPrice, amount, factor) {
11
- if (factor === void 0) { factor = 100; }
12
- // Ensure orderPrice is BigInt
13
- var orderPriceBigInt = (0, bignumber_js_1.default)(orderPrice);
14
- // Calculate 1% (or provided factor) of the order price
15
- var offset = orderPriceBigInt.div(factor);
16
- // Determine if the amount is positive or negative and adjust the price accordingly
17
- if (amount > 0) {
18
- // Trade is long, so add
19
- return BigInt((0, bignumber_js_1.default)(orderPriceBigInt).plus(offset).times(1e18).toFixed(0));
20
- }
21
- else {
22
- return BigInt((0, bignumber_js_1.default)(orderPriceBigInt).minus(offset).times(1e18).toFixed(0));
23
- }
24
- }
25
- exports.calculatePriceLimitForTrade = calculatePriceLimitForTrade;
26
5
  function calculateMaxPriceLimit(isLong) {
27
6
  // Determine if the amount is positive or negative and adjust the price accordingly
28
7
  if (isLong) {
@@ -1 +1 @@
1
- {"version":3,"file":"trade.js","sourceRoot":"/","sources":["transactions/trade.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAqC;AACrC,iCAAoC;AAEpC,iHAAiH;AACjH,SAAgB,2BAA2B,CACzC,UAAkB,EAClB,MAAc,EACd,MAAY;IAAZ,uBAAA,EAAA,YAAY;IAEZ,8BAA8B;IAC9B,IAAM,gBAAgB,GAAG,IAAA,sBAAS,EAAC,UAAU,CAAC,CAAC;IAE/C,uDAAuD;IACvD,IAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE5C,mFAAmF;IACnF,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACf,wBAAwB;QACxB,OAAO,MAAM,CACX,IAAA,sBAAS,EAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAChE,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CACX,IAAA,sBAAS,EAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACjE,CAAC;IACJ,CAAC;AACH,CAAC;AAtBD,kEAsBC;AAED,SAAgB,sBAAsB,CAAC,MAAe;IACpD,mFAAmF;IACnF,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,mBAAU,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAPD,wDAOC","sourcesContent":["import BigNumber from 'bignumber.js';\nimport { MaxUint256 } from 'ethers';\n\n// todo: need the ability to supply custom slippage or use a more conservative default for the slippage tolerance\nexport function calculatePriceLimitForTrade(\n orderPrice: number,\n amount: number,\n factor = 100,\n): bigint {\n // Ensure orderPrice is BigInt\n const orderPriceBigInt = BigNumber(orderPrice);\n\n // Calculate 1% (or provided factor) of the order price\n const offset = orderPriceBigInt.div(factor);\n\n // Determine if the amount is positive or negative and adjust the price accordingly\n if (amount > 0) {\n // Trade is long, so add\n return BigInt(\n BigNumber(orderPriceBigInt).plus(offset).times(1e18).toFixed(0),\n );\n } else {\n return BigInt(\n BigNumber(orderPriceBigInt).minus(offset).times(1e18).toFixed(0),\n );\n }\n}\n\nexport function calculateMaxPriceLimit(isLong: boolean): bigint {\n // Determine if the amount is positive or negative and adjust the price accordingly\n if (isLong) {\n return MaxUint256;\n } else {\n return BigInt(0);\n }\n}\n"]}
1
+ {"version":3,"file":"trade.js","sourceRoot":"/","sources":["transactions/trade.ts"],"names":[],"mappings":";;;AAAA,iCAAoC;AAEpC,SAAgB,sBAAsB,CAAC,MAAe;IACpD,mFAAmF;IACnF,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,mBAAU,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;AACH,CAAC;AAPD,wDAOC","sourcesContent":["import { MaxUint256 } from 'ethers';\n\nexport function calculateMaxPriceLimit(isLong: boolean): bigint {\n // Determine if the amount is positive or negative and adjust the price accordingly\n if (isLong) {\n return MaxUint256;\n } else {\n return BigInt(0);\n }\n}\n"]}
@@ -1,3 +1,2 @@
1
- export declare function calculatePriceLimitForTrade(orderPrice: number, amount: number, factor?: number): bigint;
2
1
  export declare function calculateMaxPriceLimit(isLong: boolean): bigint;
3
2
  //# sourceMappingURL=trade.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trade.d.ts","sourceRoot":"/","sources":["transactions/trade.ts"],"names":[],"mappings":"AAIA,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,SAAM,GACX,MAAM,CAkBR;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAO9D"}
1
+ {"version":3,"file":"trade.d.ts","sourceRoot":"/","sources":["transactions/trade.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAO9D"}
@@ -5,6 +5,7 @@ export type VltzRoundInfo = {
5
5
  mintedAmount: number;
6
6
  totalAllocation: number;
7
7
  totalRealizedPnl: number;
8
+ leaderboardCachedTimestampMs: number;
8
9
  leaderboard: {
9
10
  data: {
10
11
  walletAddress: string;
@@ -19,6 +20,7 @@ export type VltzWalletInfo = {
19
20
  allocationInfo: VltzAllocationInfo;
20
21
  merkleRoot: string;
21
22
  merkleProof: string[];
23
+ contractAddress: string;
22
24
  realizedPnl: number;
23
25
  positionInLeaderboard: number | null;
24
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"vltz-api-types.d.ts","sourceRoot":"/","sources":["vltz-api-types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,WAAW,EACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE;QACX,IAAI,EAAE;YACJ,aAAa,EAAE,MAAM,CAAC;YACtB,WAAW,EAAE,MAAM,CAAC;SACrB,EAAE,CAAC;QACJ,IAAI,EAAE,kBAAkB,CAAC;KAC1B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: 1759140000,
24
+ mintDeadline: 1761742800,
25
+ mintStart: 1760529600,
26
26
  totalAllocation: 1000000000, // 1 Billion
27
- root: '0x4590ea963a1b2450d5f80616ccb909be6ffb1cbf5ed99cbdd1ec07b185073acb',
27
+ root: '0x2055f18a8e96ea548a78552f33632989ab0afa5706e530b10bd24c8bfcdafe71',
28
28
  },
29
29
  },
30
30
  },
@@ -1 +1 @@
1
- {"version":3,"file":"minting-helpers.js","sourceRoot":"/","sources":["utils/minting-helpers.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAChC,kCAA6C;AAM7C,6CAA6C;AAChC,QAAA,oBAAoB;IAe/B,GAAC,yBAAiB,CAAC,eAAe,IAAG;QACnC,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE;YACN,CAAC,EAAE;gBACD,YAAY,EAAE,UAAU;gBACxB,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,UAAU,EAAE,YAAY;gBACzC,IAAI,EAAE,oEAAoE;aAC3E;SACF;KACF;IACD,GAAC,yBAAiB,CAAC,eAAe,IAAG;QACnC,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE;YACN,CAAC,EAAE;gBACD,YAAY,EAAE,UAAU;gBACxB,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,UAAU,EAAE,YAAY;gBACzC,IAAI,EAAE,oEAAoE;aAC3E;SACF;KACF;QACD;AAEF,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACzB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,6BAAc,CAAA;IACd,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAaM,IAAM,WAAW,GAAG,UACzB,aAAqB,EACrB,UAAkB;IAElB,IAAM,WAAW,GAAG,eAAM,CAAC,SAAS,CAClC,eAAM,CAAC,cAAc,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAC3E,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB","sourcesContent":["import { ethers } from 'ethers';\nimport { MoneyInOutChainId } from '../types';\n\ntype VltzMintingChainIds =\n | MoneyInOutChainId.ethereumMainnet\n | MoneyInOutChainId.ethereumSepolia;\n\n// mapping from round, to network, to details\nexport const VLTZ_MINTING_DETAILS: Record<\n VltzMintingChainIds,\n {\n contractAddress: string;\n rounds: Record<\n number,\n {\n mintDeadline: number;\n mintStart: number;\n totalAllocation: number;\n root: string;\n }\n >;\n }\n> = {\n [MoneyInOutChainId.ethereumSepolia]: {\n contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',\n rounds: {\n 1: {\n mintDeadline: 1761742800,\n mintStart: 1760529600,\n totalAllocation: 1000000000, // 1 Billion\n root: '0x1aaeed7e414b0946dee1e5ddb2eb8bd63953c2f4f4a0f413998a1070a30b06d8',\n },\n },\n },\n [MoneyInOutChainId.ethereumMainnet]: {\n contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',\n rounds: {\n 1: {\n mintDeadline: 1759226400,\n mintStart: 1759140000,\n totalAllocation: 1000000000, // 1 Billion\n root: '0x4590ea963a1b2450d5f80616ccb909be6ffb1cbf5ed99cbdd1ec07b185073acb',\n },\n },\n },\n};\n\nexport enum VltzTierName {\n tier1 = 'tier1',\n tier2 = 'tier2',\n tier3 = 'tier3',\n legendary = 'legendary',\n easterEgg = 'easterEgg',\n}\n\nexport enum VltzSeasons {\n seasonOg = '0',\n season1 = '1',\n season2 = '2',\n season3 = '3',\n season4 = '4',\n}\n\nexport type VltzAllocationInfo = {\n walletAddress: string;\n totalAllocation: number;\n allocationPerSeasonBadge: Record<VltzSeasons, Record<VltzTierName, number>>;\n};\n\nexport type VltzLeafInfo = {\n walletAddress: string;\n allocation: string;\n};\n\nexport const getVltzLeaf = (\n walletAddress: string,\n allocation: string,\n): Buffer => {\n const messageHash = ethers.keccak256(\n ethers.solidityPacked(['address', 'uint256'], [walletAddress, allocation]),\n );\n return Buffer.from(messageHash.slice(2), 'hex');\n};\n"]}
1
+ {"version":3,"file":"minting-helpers.js","sourceRoot":"/","sources":["utils/minting-helpers.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAChC,kCAA6C;AAM7C,6CAA6C;AAChC,QAAA,oBAAoB;IAe/B,GAAC,yBAAiB,CAAC,eAAe,IAAG;QACnC,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE;YACN,CAAC,EAAE;gBACD,YAAY,EAAE,UAAU;gBACxB,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,UAAU,EAAE,YAAY;gBACzC,IAAI,EAAE,oEAAoE;aAC3E;SACF;KACF;IACD,GAAC,yBAAiB,CAAC,eAAe,IAAG;QACnC,eAAe,EAAE,4CAA4C;QAC7D,MAAM,EAAE;YACN,CAAC,EAAE;gBACD,YAAY,EAAE,UAAU;gBACxB,SAAS,EAAE,UAAU;gBACrB,eAAe,EAAE,UAAU,EAAE,YAAY;gBACzC,IAAI,EAAE,oEAAoE;aAC3E;SACF;KACF;QACD;AAEF,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,+BAAe,CAAA;IACf,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;AACzB,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB;AAED,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,6BAAc,CAAA;IACd,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,4BAAa,CAAA;AACf,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAaM,IAAM,WAAW,GAAG,UACzB,aAAqB,EACrB,UAAkB;IAElB,IAAM,WAAW,GAAG,eAAM,CAAC,SAAS,CAClC,eAAM,CAAC,cAAc,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC,CAC3E,CAAC;IACF,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB","sourcesContent":["import { ethers } from 'ethers';\nimport { MoneyInOutChainId } from '../types';\n\ntype VltzMintingChainIds =\n | MoneyInOutChainId.ethereumMainnet\n | MoneyInOutChainId.ethereumSepolia;\n\n// mapping from round, to network, to details\nexport const VLTZ_MINTING_DETAILS: Record<\n VltzMintingChainIds,\n {\n contractAddress: string;\n rounds: Record<\n number,\n {\n mintDeadline: number;\n mintStart: number;\n totalAllocation: number;\n root: string;\n }\n >;\n }\n> = {\n [MoneyInOutChainId.ethereumSepolia]: {\n contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',\n rounds: {\n 1: {\n mintDeadline: 1761742800,\n mintStart: 1760529600,\n totalAllocation: 1000000000, // 1 Billion\n root: '0x1aaeed7e414b0946dee1e5ddb2eb8bd63953c2f4f4a0f413998a1070a30b06d8',\n },\n },\n },\n [MoneyInOutChainId.ethereumMainnet]: {\n contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',\n rounds: {\n 1: {\n mintDeadline: 1761742800,\n mintStart: 1760529600,\n totalAllocation: 1000000000, // 1 Billion\n root: '0x2055f18a8e96ea548a78552f33632989ab0afa5706e530b10bd24c8bfcdafe71',\n },\n },\n },\n};\n\nexport enum VltzTierName {\n tier1 = 'tier1',\n tier2 = 'tier2',\n tier3 = 'tier3',\n legendary = 'legendary',\n easterEgg = 'easterEgg',\n}\n\nexport enum VltzSeasons {\n seasonOg = '0',\n season1 = '1',\n season2 = '2',\n season3 = '3',\n season4 = '4',\n}\n\nexport type VltzAllocationInfo = {\n walletAddress: string;\n totalAllocation: number;\n allocationPerSeasonBadge: Record<VltzSeasons, Record<VltzTierName, number>>;\n};\n\nexport type VltzLeafInfo = {\n walletAddress: string;\n allocation: string;\n};\n\nexport const getVltzLeaf = (\n walletAddress: string,\n allocation: string,\n): Buffer => {\n const messageHash = ethers.keccak256(\n ethers.solidityPacked(['address', 'uint256'], [walletAddress, allocation]),\n );\n return Buffer.from(messageHash.slice(2), 'hex');\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"vltz-api-types.js","sourceRoot":"/","sources":["vltz-api-types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AddressParam,\n ApiEndpoint,\n PaginatedQueryMeta,\n PaginatedQueryParams,\n Stringified,\n} from './api-types';\nimport { VltzAllocationInfo } from './utils';\n\nexport type VltzRoundInfo = {\n deadlineMs: number;\n mintedAmount: number;\n totalAllocation: number;\n totalRealizedPnl: number;\n leaderboard: {\n data: {\n walletAddress: string;\n realizedPnl: number;\n }[];\n meta: PaginatedQueryMeta;\n };\n};\n\nexport type VltzWalletInfo = {\n minted: boolean;\n mintedAmountSoFar: number;\n allocationInfo: VltzAllocationInfo;\n merkleRoot: string;\n merkleProof: string[];\n realizedPnl: number;\n positionInLeaderboard: number | null;\n};\n\nexport type VltzApiSource = {\n 'vltz/round/:id': ApiEndpoint<\n VltzRoundInfo,\n {\n id: string;\n } & PaginatedQueryParams\n >;\n\n 'vltz/wallet/:address/:roundId': ApiEndpoint<\n VltzWalletInfo,\n AddressParam & { roundId: string }\n >;\n};\n\nexport type VltzApi = {\n [K in keyof VltzApiSource]: {\n params: VltzApiSource[K]['params'];\n query: VltzApiSource[K]['query'];\n response: Stringified<VltzApiSource[K]['response']>;\n };\n};\n"]}
1
+ {"version":3,"file":"vltz-api-types.js","sourceRoot":"/","sources":["vltz-api-types.ts"],"names":[],"mappings":"","sourcesContent":["import {\n AddressParam,\n ApiEndpoint,\n PaginatedQueryMeta,\n PaginatedQueryParams,\n Stringified,\n} from './api-types';\nimport { VltzAllocationInfo } from './utils';\n\nexport type VltzRoundInfo = {\n deadlineMs: number;\n mintedAmount: number;\n totalAllocation: number;\n totalRealizedPnl: number;\n leaderboardCachedTimestampMs: number;\n leaderboard: {\n data: {\n walletAddress: string;\n realizedPnl: number;\n }[];\n meta: PaginatedQueryMeta;\n };\n};\n\nexport type VltzWalletInfo = {\n minted: boolean;\n mintedAmountSoFar: number;\n allocationInfo: VltzAllocationInfo;\n merkleRoot: string;\n merkleProof: string[];\n contractAddress: string;\n realizedPnl: number;\n positionInLeaderboard: number | null;\n};\n\nexport type VltzApiSource = {\n 'vltz/round/:id': ApiEndpoint<\n VltzRoundInfo,\n {\n id: string;\n } & PaginatedQueryParams\n >;\n\n 'vltz/wallet/:address/:roundId': ApiEndpoint<\n VltzWalletInfo,\n AddressParam & { roundId: string }\n >;\n};\n\nexport type VltzApi = {\n [K in keyof VltzApiSource]: {\n params: VltzApiSource[K]['params'];\n query: VltzApiSource[K]['query'];\n response: Stringified<VltzApiSource[K]['response']>;\n };\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reyaxyz/common",
3
- "version": "0.310.2",
3
+ "version": "0.311.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -44,5 +44,5 @@
44
44
  "generate:coverage-badges": "npx istanbul-badges-readme --silent"
45
45
  },
46
46
  "packageManager": "pnpm@8.3.1",
47
- "gitHead": "c6554e66718a0400279826cf07ab82b85ad7979c"
47
+ "gitHead": "820bf1d931672522440894ba3b13568bc7ea753e"
48
48
  }
@@ -1,31 +1,5 @@
1
- import BigNumber from 'bignumber.js';
2
1
  import { MaxUint256 } from 'ethers';
3
2
 
4
- // todo: need the ability to supply custom slippage or use a more conservative default for the slippage tolerance
5
- export function calculatePriceLimitForTrade(
6
- orderPrice: number,
7
- amount: number,
8
- factor = 100,
9
- ): bigint {
10
- // Ensure orderPrice is BigInt
11
- const orderPriceBigInt = BigNumber(orderPrice);
12
-
13
- // Calculate 1% (or provided factor) of the order price
14
- const offset = orderPriceBigInt.div(factor);
15
-
16
- // Determine if the amount is positive or negative and adjust the price accordingly
17
- if (amount > 0) {
18
- // Trade is long, so add
19
- return BigInt(
20
- BigNumber(orderPriceBigInt).plus(offset).times(1e18).toFixed(0),
21
- );
22
- } else {
23
- return BigInt(
24
- BigNumber(orderPriceBigInt).minus(offset).times(1e18).toFixed(0),
25
- );
26
- }
27
- }
28
-
29
3
  export function calculateMaxPriceLimit(isLong: boolean): bigint {
30
4
  // Determine if the amount is positive or negative and adjust the price accordingly
31
5
  if (isLong) {
@@ -36,10 +36,10 @@ export const VLTZ_MINTING_DETAILS: Record<
36
36
  contractAddress: '0x7A00255ebcBE36FbF469e0A6265A271749560aE4',
37
37
  rounds: {
38
38
  1: {
39
- mintDeadline: 1759226400,
40
- mintStart: 1759140000,
39
+ mintDeadline: 1761742800,
40
+ mintStart: 1760529600,
41
41
  totalAllocation: 1000000000, // 1 Billion
42
- root: '0x4590ea963a1b2450d5f80616ccb909be6ffb1cbf5ed99cbdd1ec07b185073acb',
42
+ root: '0x2055f18a8e96ea548a78552f33632989ab0afa5706e530b10bd24c8bfcdafe71',
43
43
  },
44
44
  },
45
45
  },
@@ -12,6 +12,7 @@ export type VltzRoundInfo = {
12
12
  mintedAmount: number;
13
13
  totalAllocation: number;
14
14
  totalRealizedPnl: number;
15
+ leaderboardCachedTimestampMs: number;
15
16
  leaderboard: {
16
17
  data: {
17
18
  walletAddress: string;
@@ -27,6 +28,7 @@ export type VltzWalletInfo = {
27
28
  allocationInfo: VltzAllocationInfo;
28
29
  merkleRoot: string;
29
30
  merkleProof: string[];
31
+ contractAddress: string;
30
32
  realizedPnl: number;
31
33
  positionInLeaderboard: number | null;
32
34
  };