@ichidao/ichi-vaults-sdk
Advanced tools
Comparing version
@@ -168,2 +168,7 @@ "use strict"; | ||
}, | ||
_l[types_1.SupportedDex.ThenaV3Fees] = { | ||
url: 'https://api.studio.thegraph.com/query/88584/bsc-v3-thena-fees/version/latest', | ||
publishedUrl: 'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/CUDHBLjeeqpprHGZeesTi9kxtjsZTQnJrvuT4Sm8nyx5', | ||
supportsCollectFees: true, | ||
}, | ||
_l), | ||
@@ -170,0 +175,0 @@ _a[types_1.SupportedChainId.celo] = (_m = {}, |
@@ -5,3 +5,3 @@ | ||
* author: ICHI DAO <core@ichi.org> | ||
* ichi-vaults-sdk.js v0.0.101 | ||
* ichi-vaults-sdk.js v0.0.102 | ||
* Released under the MIT license. | ||
@@ -8,0 +8,0 @@ */ |
@@ -5,3 +5,3 @@ | ||
* author: ICHI DAO <core@ichi.org> | ||
* ichi-vaults-sdk.js v0.0.101 | ||
* ichi-vaults-sdk.js v0.0.102 | ||
* Released under the MIT license. | ||
@@ -8,0 +8,0 @@ */ |
@@ -79,2 +79,3 @@ import { Signer } from '@ethersproject/abstract-signer'; | ||
Thena = "Thena", | ||
ThenaV3Fees = "ThenaV3Fees", | ||
Thirdfy = "Thirdfy", | ||
@@ -81,0 +82,0 @@ Thruster = "Thruster", |
@@ -79,2 +79,3 @@ import { Signer } from '@ethersproject/abstract-signer'; | ||
Thena = "Thena", | ||
ThenaV3Fees = "ThenaV3Fees", | ||
Thirdfy = "Thirdfy", | ||
@@ -81,0 +82,0 @@ Thruster = "Thruster", |
@@ -80,2 +80,3 @@ "use strict"; | ||
SupportedDex["Thena"] = "Thena"; | ||
SupportedDex["ThenaV3Fees"] = "ThenaV3Fees"; | ||
SupportedDex["Thirdfy"] = "Thirdfy"; | ||
@@ -82,0 +83,0 @@ SupportedDex["Thruster"] = "Thruster"; |
@@ -287,2 +287,12 @@ "use strict"; | ||
}, | ||
_l[types_1.SupportedDex.ThenaV3Fees] = { | ||
factoryAddress: '0x7ca1Fe9087c264518a6420ADC41841DeA9c86BDb', | ||
depositGuard: { | ||
address: '0xfac2f9E2c03185d34982B99198765955b56b6933', | ||
version: 1, | ||
}, | ||
vaultDeployerAddress: '0x05cC3CA6E768a68A7f86b09e3ceE754437bd5f12', | ||
isAlgebra: true, | ||
ammVersion: 'algebraIntegral', | ||
}, | ||
_l), | ||
@@ -289,0 +299,0 @@ _a[types_1.SupportedChainId.celo] = (_m = {}, |
{ | ||
"name": "@ichidao/ichi-vaults-sdk", | ||
"version": "0.0.101", | ||
"version": "0.0.102", | ||
"description": "The ICHI Vaults SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.cjs.js", |
106
README.md
@@ -33,11 +33,9 @@  | ||
* [`getAverageDepositTokenRatios()`](#20-getAverageDepositTokenRatios) | ||
* [`getLpApr()`](#21-getLpApr) | ||
* [`getLpPriceChange()`](#22-getLpPriceChange) | ||
* [`getVaultMetrics()`](#23-getVaultMetrics) | ||
* [`getIchiVaultInfo()`](#24-getIchiVaultInfo) | ||
* [`getVaultsByTokens()`](#25-getVaultsByTokens) | ||
* [`getVaultsByPool()`](#26-getVaultsByPool) | ||
* [`getVaultPositions()`](#27-getVaultPositions) | ||
* [`getSupportedDexes()`](#28-getSupportedDexes) | ||
* [`getChainsForDex()`](#29-getChainsForDex) | ||
* [`getVaultMetrics()`](#21-getVaultMetrics) | ||
* [`getIchiVaultInfo()`](#22-getIchiVaultInfo) | ||
* [`getVaultsByTokens()`](#23-getVaultsByTokens) | ||
* [`getVaultsByPool()`](#24-getVaultsByPool) | ||
* [`getVaultPositions()`](#25-getVaultPositions) | ||
* [`getSupportedDexes()`](#26-getSupportedDexes) | ||
* [`getChainsForDex()`](#27-getChainsForDex) | ||
@@ -836,3 +834,3 @@ ## Installation | ||
#### 21. `getLpApr()` | ||
#### 21. `getVaultMetrics()` | ||
@@ -847,78 +845,2 @@ | param | type | default | required | ||
<br/> | ||
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. | ||
If 'timeIntervals' is not specified, it returns VaultApr objects for time periods of 1, 7, and 30 days. | ||
```typescript | ||
import { Web3Provider } from '@ethersproject/providers'; | ||
import { getLpApr, SupportedDex, VaultApr } from '@ichidao/ichi-vaults-sdk'; | ||
const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER); | ||
const vaultAddress = "0x3ac9...a5f132"; | ||
const dex = SupportedDex.UniswapV3; | ||
const days = [2, 5, 14, 60]; | ||
const averageDtr: VaultApr[] = await getLpApr( | ||
vaultAddress, | ||
web3Provider, | ||
dex | ||
) | ||
// - or - | ||
const averageDtr: VaultApr[] = await getLpApr( | ||
vaultAddress, | ||
web3Provider, | ||
dex, | ||
days | ||
) | ||
``` | ||
#### 22. `getLpPriceChange()` | ||
| param | type | default | required | ||
| -------- | -------- | -------- | -------- | ||
| vaultAddress | string | - | true | | ||
| jsonProvider | [JsonRpcProvider](https://github.com/ethers-io/ethers.js/blob/f97b92bbb1bde22fcc44100af78d7f31602863ab/packages/providers/src.ts/json-rpc-provider.ts#L393) | - | true | ||
| dex | SupportedDex | - | true | ||
| timeIntervals | number[] | [1, 7, 30] | false | | ||
<br/> | ||
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. | ||
If 'timeIntervals' is not specified, it returns PriceChange objects for time periods of 1, 7, and 30 days. | ||
```typescript | ||
import { Web3Provider } from '@ethersproject/providers'; | ||
import { getLpPriceChange, SupportedDex } from '@ichidao/ichi-vaults-sdk'; | ||
const web3Provider = new Web3Provider(YOUR_WEB3_PROVIDER); | ||
const vaultAddress = "0x3ac9...a5f132"; | ||
const dex = SupportedDex.UniswapV3; | ||
const days = [2, 5, 14, 60]; | ||
const lpPriceChange: PriceChange[] = await getLpPriceChange( | ||
vaultAddress, | ||
web3Provider, | ||
dex | ||
) | ||
// - or - | ||
const lpPriceChange: PriceChange[] = await getLpPriceChange( | ||
vaultAddress, | ||
web3Provider, | ||
dex, | ||
days | ||
) | ||
``` | ||
#### 23. `getVaultMetrics()` | ||
| param | type | default | required | ||
| -------- | -------- | -------- | -------- | ||
| vaultAddress | string | - | true | | ||
| jsonProvider | [JsonRpcProvider](https://github.com/ethers-io/ethers.js/blob/f97b92bbb1bde22fcc44100af78d7f31602863ab/packages/providers/src.ts/json-rpc-provider.ts#L393) | - | true | ||
| dex | SupportedDex | - | true | ||
| timeIntervals | number[] | [1, 7, 30] | false | | ||
<br/> | ||
The getVaultMetrics() function returns an array of VaultMetrics objects for the periods of time specified by the 'timeIntervals' parameter. | ||
@@ -952,3 +874,3 @@ If 'timeIntervals' is not specified, it returns VaultMetrics objects for time periods of 1, 7, and 30 days. | ||
#### 24. `getIchiVaultInfo()` | ||
#### 22. `getIchiVaultInfo()` | ||
@@ -979,3 +901,3 @@ | param | type | default | required | ||
#### 25. `getVaultsByTokens()` | ||
#### 23. `getVaultsByTokens()` | ||
@@ -1010,3 +932,3 @@ | param | type | default | required | ||
#### 26. `getVaultsByPool()` | ||
#### 24. `getVaultsByPool()` | ||
@@ -1038,3 +960,3 @@ | param | type | default | required | ||
#### 27. `getVaultPositions()` | ||
#### 25. `getVaultPositions()` | ||
@@ -1066,3 +988,3 @@ | param | type | default | required | ||
#### 28. `getSupportedDexes()` | ||
#### 26. `getSupportedDexes()` | ||
@@ -1084,3 +1006,3 @@ | param | type | default | required | ||
#### 29. `getChainsForDex()` | ||
#### 27. `getChainsForDex()` | ||
@@ -1087,0 +1009,0 @@ | param | type | default | required |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29325
0.06%1543304
-0.09%1241
-5.91%