@ichidao/ichi-vaults-sdk 0.0.39 → 0.0.40

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -183,6 +183,7 @@ const txnDetails = await depositNativeToken(
183
183
  | overrides | [Overrides](https://github.com/ethers-io/ethers.js/blob/f97b92bbb1bde22fcc44100af78d7f31602863ab/packages/contracts/lib/index.d.ts#L7) | undefined | false
184
184
 
185
185
  <br/>
186
+ The approveVaultToken() function facilitates the approval of vault tokens for the withdrawWithSlipage() and withdrawNativeToken functions. The 'shares' parameter can be either a string or a number, representing the number of vault tokens in major units. For example, if 'shares' is equal to 0.5 or '0.5', it signifies 0.5 vault token. If the 'shares' parameter is not specified, the token will be approved for the maximum allowable amount.
186
187
 
187
188
  ```typescript
188
189
  import { Web3Provider } from '@ethersproject/providers';
@@ -219,10 +220,13 @@ await txnDetails.wait();
219
220
  | dex | SupportedDex | - | true |
220
221
 
221
222
  <br/>
223
+ This function returns true if the vault token allowance is non-zero and greater than or equal to the specified amount.
224
+ The 'shares' parameter can be either a string or a number, representing the number of vault tokens in major units. For example, if 'shares' is equal to 0.5 or '0.5', it signifies 0.5 vault token.
225
+
222
226
 
223
227
  ```typescript
224
228
  import { Web3Provider } from '@ethersproject/providers';
225
- import { isDepositTokenApproved, SupportedDex } from '@ichidao/ichi-vaults-sdk';
229
+ import { isVaultTokenApproved, SupportedDex } from '@ichidao/ichi-vaults-sdk';
226
230
 
227
231
  const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER);
228
232
  const vaultAddress = "0x3ac9...a5f132"
@@ -230,7 +234,7 @@ const accountAddress = "0xaaaa...aaaaaa"
230
234
  const amount = 100
231
235
  const dex = SupportedDex.UniswapV3
232
236
 
233
- const isToken0Approved: boolean = await isDepositTokenApproved(
237
+ const isApproved: boolean = await isVaultTokenApproved(
234
238
  accountAddress,
235
239
  amount,
236
240
  vaultAddress,
@@ -251,7 +255,7 @@ const isToken0Approved: boolean = await isDepositTokenApproved(
251
255
  | overrides | [Overrides](https://github.com/ethers-io/ethers.js/blob/f97b92bbb1bde22fcc44100af78d7f31602863ab/packages/contracts/lib/index.d.ts#L7) | undefined | false
252
256
 
253
257
  <br/>
254
- This function facilitates the withdrawal of the specified amount of shares from the vault. Consequently, both tokens are added to the user's account.
258
+ This function facilitates the withdrawal of the specified amount of shares from the vault. As a result, both vault tokens are added to the user's account. The 'shares' parameter can be either a string or a number, representing the number of vault tokens to be withdrawn from the vault, specified in major units. For instance, if 'shares' is equal to 0.5 or '0.5', it signifies 0.5 vault token.
255
259
 
256
260
  ```typescript
257
261
  import { Web3Provider } from '@ethersproject/providers';
@@ -293,7 +297,7 @@ const txnDetails = await withdraw(
293
297
  | overrides | [Overrides](https://github.com/ethers-io/ethers.js/blob/f97b92bbb1bde22fcc44100af78d7f31602863ab/packages/contracts/lib/index.d.ts#L7) | undefined | false
294
298
 
295
299
  <br/>
296
- Similar to the withdraw() function, this function facilitates the withdrawal of the specified amount of shares from the vault. Furthermore, it enables the setting of the slippage for the withdrawal transaction. By default, the slippage is set to 1%. If the slippage exceeds the specified amount, the transaction will not be executed.
300
+ Similar to the withdraw() function, this function facilitates the withdrawal of the specified amount of shares from the vault. Furthermore, it enables the setting of the slippage for the withdrawal transaction. By default, the slippage is set to 1%. If the slippage exceeds the specified amount, the transaction will not be executed. Ensure to use the approveVaultToken() function before invoking withdrawWithSlippage().
297
301
 
298
302
  ```typescript
299
303
  import { Web3Provider } from '@ethersproject/providers';
@@ -335,7 +339,7 @@ const txnDetails = await withdraw(
335
339
  | overrides | [Overrides](https://github.com/ethers-io/ethers.js/blob/f97b92bbb1bde22fcc44100af78d7f31602863ab/packages/contracts/lib/index.d.ts#L7) | undefined | false
336
340
 
337
341
  <br/>
338
- Similar to the withdraw() function, this function facilitates the withdrawal of the specified amount of shares from the vault. This function could be used for vaults in which one of the tokens is a wrapped native token of the chain. Both vault tokens are added to the user's account after the withdrawal. Additionally, the wrapped token is converted to the native token.
342
+ Similar to the withdraw() function, this function facilitates the withdrawal of the specified amount of shares from the vault. This function could be used for vaults in which one of the tokens is a wrapped native token of the chain. Both vault tokens are added to the user's account after the withdrawal. Additionally, the wrapped token is converted to the native token. Ensure to use the approveVaultToken() function before invoking withdrawNativeToken().
339
343
 
340
344
  ```typescript
341
345
  import { Web3Provider } from '@ethersproject/providers';
@@ -409,6 +413,7 @@ const isToken0Approved: boolean = await isDepositTokenApproved(
409
413
  | dex | SupportedDex | - | true |
410
414
 
411
415
  <br/>
416
+ Returns true if deposits of the specified token are allowed.
412
417
 
413
418
  ```typescript
414
419
  import { Web3Provider } from '@ethersproject/providers';
@@ -437,6 +442,7 @@ const isAllowed = await isTokenAllowed(
437
442
  | dex | SupportedDex | - | true |
438
443
 
439
444
  <br/>
445
+ Returns a BigNumber representing the maximum allowed deposit amount.
440
446
 
441
447
  ```typescript
442
448
  import { Web3Provider } from '@ethersproject/providers';
@@ -466,6 +472,7 @@ const maxAmount = await getMaxDepositAmount(
466
472
  | raw | true | undefined | false |
467
473
 
468
474
  <br/>
475
+ This function returns the number of user shares in the vault. If the 'raw' parameter is included, it returns a BigNumber.
469
476
 
470
477
  ```typescript
471
478
  import { Web3Provider } from '@ethersproject/providers';
@@ -505,6 +512,7 @@ const sharesBN: BigNumber = await getUserBalance(
505
512
  | raw | true | undefined | false |
506
513
 
507
514
  <br/>
515
+ The getUserAmounts() function returns the amounts of tokens in the vault owned by the user. If 'raw' is specified, it returns BigNumber's.
508
516
 
509
517
  ```typescript
510
518
  import { Web3Provider } from '@ethersproject/providers';
@@ -543,6 +551,7 @@ const amountsBN: [BigNumber, BigNumber] & {amount0: BigNumber, amount1: BigNumbe
543
551
  | raw | true | undefined | false |
544
552
 
545
553
  <br/>
554
+ This function returns user balances for all vaults on the specified decentralized exchange (DEX).
546
555
 
547
556
  ```typescript
548
557
  import { Web3Provider } from '@ethersproject/providers';
@@ -578,6 +587,7 @@ const userBalancesInVaultsBN: UserBalanceInVaultBN[] = await getAllUserBalances(
578
587
  | raw | true | undefined | false |
579
588
 
580
589
  <br/>
590
+ This function returns user token amounts in all vaults on the specified decentralized exchange (DEX).
581
591
 
582
592
  ```typescript
583
593
  import { Web3Provider } from '@ethersproject/providers';
@@ -613,6 +623,7 @@ const amountsBN: UserAmountsInVaultBN[] = await getAllUserAmounts(
613
623
  | raw | true | undefined | false |
614
624
 
615
625
  <br/>
626
+ This function returns the total number of shares in the vault.
616
627
 
617
628
  ```typescript
618
629
  import { Web3Provider } from '@ethersproject/providers';
@@ -650,6 +661,7 @@ const sharesBN: BigNumber = await getTotalSupply(
650
661
  | raw | true | undefined | false |
651
662
 
652
663
  <br/>
664
+ This function returns the total number of tokens in the vault.
653
665
 
654
666
  ```typescript
655
667
  import { Web3Provider } from '@ethersproject/providers';
@@ -689,6 +701,7 @@ const amountsBN: [BigNumber, BigNumber] & {total0: BigNumber, total1: BigNumber}
689
701
  | days | number | undefined | false |
690
702
 
691
703
  <br/>
704
+ The getFeesCollected() function returns the number of fees collected for the specified number of days. If the 'days' parameter is not included, it returns the number of fees collected since the vault's inception.
692
705
 
693
706
  ```typescript
694
707
  import { Web3Provider } from '@ethersproject/providers';
@@ -744,7 +757,8 @@ const amountsBN: [BigNumber, BigNumber] & {total0: BigNumber, total1: BigNumber}
744
757
  | forDays | number[] | undefined | false |
745
758
 
746
759
  <br/>
747
- If forDays is not specified, returns FeesInfo for time periods of 1, 7, and 30 days.
760
+ The getFeesCollectedInfo() function returns an array of FeesInfo objects representing the number of fees collected for the periods of time specified by the 'forDays' parameter, along with the fee Annual Percentage Rate (APR) for those periods.
761
+ If 'forDays' is not specified, it returns FeesInfo for time periods of 1, 7, and 30 days.
748
762
  <br/>
749
763
 
750
764
  ```typescript
@@ -782,6 +796,8 @@ const feesInfo: FeesInfo[] = await getFeesCollectedInfo(
782
796
  | timeIntervals | number[] | [1, 7, 30] | false |
783
797
 
784
798
  <br/>
799
+ The getAverageDepositTokenRatios() function returns an array of DepositTokenRatio objects representing the average deposit token ratio for the periods of time specified by the 'timeIntervals' parameter.
800
+ If 'timeIntervals' is not specified, it returns DepositTokenRatio objects for time periods of 1, 7, and 30 days.
785
801
 
786
802
  ```typescript
787
803
  import { Web3Provider } from '@ethersproject/providers';
@@ -818,6 +834,8 @@ const averageDtr: AverageDepositTokenRatio[] = await getAverageDepositTokenRatio
818
834
  | timeIntervals | number[] | [1, 7, 30] | false |
819
835
 
820
836
  <br/>
837
+ The getLpApr() function returns an array of VaultApr objects representing the Annual Percentage Rate (APR) for the periods of time specified by the 'timeIntervals' parameter.
838
+ If 'timeIntervals' is not specified, it returns VaultApr objects for time periods of 1, 7, and 30 days.
821
839
 
822
840
  ```typescript
823
841
  import { Web3Provider } from '@ethersproject/providers';
@@ -854,6 +872,8 @@ const averageDtr: VaultApr[] = await getLpApr(
854
872
  | timeIntervals | number[] | [1, 7, 30] | false |
855
873
 
856
874
  <br/>
875
+ The getLpPriceChange() function returns an array of PriceChange objects representing the relative LP (vault token) price change in percentages for the periods of time specified by the 'timeIntervals' parameter.
876
+ If 'timeIntervals' is not specified, it returns PriceChange objects for time periods of 1, 7, and 30 days.
857
877
 
858
878
  ```typescript
859
879
  import { Web3Provider } from '@ethersproject/providers';
@@ -890,6 +910,8 @@ const lpPriceChange: PriceChange[] = await getLpPriceChange(
890
910
  | timeIntervals | number[] | [1, 7, 30] | false |
891
911
 
892
912
  <br/>
913
+ The getVaultMetrics() function returns an array of VaultMetrics objects for the periods of time specified by the 'timeIntervals' parameter.
914
+ If 'timeIntervals' is not specified, it returns VaultMetrics objects for time periods of 1, 7, and 30 days.
893
915
 
894
916
  ```typescript
895
917
  import { Web3Provider } from '@ethersproject/providers';
@@ -926,6 +948,7 @@ const vaultMetrics: VaultMetrics[] = await getVaultMetrics(
926
948
  | jsonProvider | JsonRpcProvider | - | false |
927
949
 
928
950
  <br/>
951
+ This function returns IchiVault object.
929
952
 
930
953
  ```typescript
931
954
  import { Web3Provider } from '@ethersproject/providers';
@@ -951,6 +974,7 @@ if (vaultInfo) {
951
974
  | pairedTokenAddress | string | - | true |
952
975
 
953
976
  <br/>
977
+ This function returns an array of all vaults on the specified DEX that contain two tokens defined by the 'depositTokenAddress' and 'pairedTokenAddress' parameters.
954
978
 
955
979
  ```typescript
956
980
  import { Web3Provider } from '@ethersproject/providers';
@@ -41,6 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.getLpPriceChange = exports.getLpApr = exports.getLpPriceAt = void 0;
43
43
  var ethers_1 = require("ethers");
44
+ var types_1 = require("../types");
44
45
  // eslint-disable-next-line import/no-cycle
45
46
  var vault_1 = require("./vault");
46
47
  var totalBalances_1 = require("./totalBalances");
@@ -49,6 +50,7 @@ var vaultEvents_1 = require("./vaultEvents");
49
50
  var timestamps_1 = require("../utils/timestamps");
50
51
  var getPrice_1 = __importDefault(require("../utils/getPrice"));
51
52
  var constants_1 = require("../graphql/constants");
53
+ var formatBigInt_1 = __importDefault(require("../utils/formatBigInt"));
52
54
  function getLpPriceAt(vaultEvents, daysAgo, isVaultInverted, token0decimals, token1decimals) {
53
55
  var e = (0, vaultEvents_1.getVaultStateAt)(vaultEvents, daysAgo);
54
56
  if (!e) {
@@ -57,14 +59,14 @@ function getLpPriceAt(vaultEvents, daysAgo, isVaultInverted, token0decimals, tok
57
59
  else {
58
60
  var depositTokenDecimals = isVaultInverted ? token1decimals : token0decimals;
59
61
  var scarseTokenDecimals = isVaultInverted ? token0decimals : token1decimals;
60
- var totalAmount0 = e.totalAmount0;
61
- var totalAmount1 = e.totalAmount1;
62
- var sqrtPrice = e.sqrtPrice;
62
+ var totalAmount0 = e.totalAmount0, totalAmount1 = e.totalAmount1, sqrtPrice = e.sqrtPrice;
63
+ var formattedTotalAmount0 = (0, formatBigInt_1.default)(totalAmount0, token0decimals);
64
+ var formattedTotalAmount1 = (0, formatBigInt_1.default)(totalAmount1, token1decimals);
63
65
  var price = (0, getPrice_1.default)(isVaultInverted, ethers_1.BigNumber.from(sqrtPrice), depositTokenDecimals, scarseTokenDecimals, 15);
64
66
  var tvl = !isVaultInverted
65
- ? Number(totalAmount0) + Number(totalAmount1) * price
66
- : Number(totalAmount1) + Number(totalAmount0) * price;
67
- var totalSupply = Number(e.totalSupply);
67
+ ? Number(formattedTotalAmount0) + Number(formattedTotalAmount1) * price
68
+ : Number(formattedTotalAmount1) + Number(formattedTotalAmount0) * price;
69
+ var totalSupply = Number((0, formatBigInt_1.default)(e.totalSupply, types_1.ichiVaultDecimals));
68
70
  var days = (0, timestamps_1.millisecondsToDays)(Date.now() - Number(e.createdAtTimestamp) * 1000);
69
71
  if (totalSupply === 0) {
70
72
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"calculateApr.js","sourceRoot":"","sources":["../../../src/functions/calculateApr.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,iCAAmC;AAEnC,2CAA2C;AAC3C,iCAA4C;AAC5C,iDAAmD;AACnD,iDAAiD;AACjD,6CAAmE;AACnE,kDAAyD;AACzD,+DAAyC;AACzC,kDAAiD;AAEjD,SAAgB,YAAY,CAC1B,WAAyB,EACzB,OAAe,EACf,eAAwB,EACxB,cAAsB,EACtB,cAAsB;IAEtB,IAAM,CAAC,GAAG,IAAA,6BAAe,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAChD,IAAI,CAAC,CAAC,EAAE;QACN,OAAO,IAAI,CAAC;KACb;SAAM;QACL,IAAM,oBAAoB,GAAG,eAAe,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;QAC/E,IAAM,mBAAmB,GAAG,eAAe,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;QAEtE,IAAA,YAAY,GAAK,CAAC,aAAN,CAAO;QACnB,IAAA,YAAY,GAAK,CAAC,aAAN,CAAO;QACnB,IAAA,SAAS,GAAK,CAAC,UAAN,CAAO;QACxB,IAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,eAA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AAW,GAAG,WAAW,CAAC,GAAG,WAAW,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;yBAClG;oBACH,CAAC,CAAC,CAAC;oBACH,sBAAO,MAAM,EAAC;;;;CACf;AA/BD,4CA+BC"}
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * @license
4
4
  * author: ICHI DAO <core@ichi.org>
5
- * ichi-vaults-sdk.js v0.0.39
5
+ * ichi-vaults-sdk.js v0.0.40
6
6
  * Released under the MIT license.
7
7
  */
8
8
 
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * @license
4
4
  * author: ICHI DAO <core@ichi.org>
5
- * ichi-vaults-sdk.js v0.0.39
5
+ * ichi-vaults-sdk.js v0.0.40
6
6
  * Released under the MIT license.
7
7
  */
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ichidao/ichi-vaults-sdk",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "The ICHI Vaults SDK",
5
5
  "main": "dist/src/index.cjs.js",
6
6
  "module": "dist/src/index.esm.js",