@dhedge/v2-sdk 1.4.2 → 1.4.3
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/dist/test/constants.d.ts +16 -4
- package/dist/v2-sdk.cjs.development.js +2 -2
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +2 -2
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/pool.ts +4 -4
- package/src/test/arrakis.test.ts +2 -2
- package/src/test/constants.ts +21 -19
package/package.json
CHANGED
package/src/entities/pool.ts
CHANGED
|
@@ -872,8 +872,8 @@ export class Pool {
|
|
|
872
872
|
dappAddress = nonfungiblePositionManagerAddress[this.network];
|
|
873
873
|
const abi = new ethers.utils.Interface(INonfungiblePositionManager.abi);
|
|
874
874
|
const liquidity = (await getUniswapV3Liquidity(tokenId, this))
|
|
875
|
-
.mul(amount)
|
|
876
|
-
.div(
|
|
875
|
+
.mul(Math.round(amount * 1e4))
|
|
876
|
+
.div(1e6);
|
|
877
877
|
const decreaseLiquidityTxData = abi.encodeFunctionData(
|
|
878
878
|
Transaction.DECREASE_LIQUIDITY,
|
|
879
879
|
[[tokenId, liquidity, 0, 0, deadline]]
|
|
@@ -895,8 +895,8 @@ export class Pool {
|
|
|
895
895
|
dappAddress = routerAddress[this.network][dapp];
|
|
896
896
|
const abi = new ethers.utils.Interface(IArrakisV1RouterStaking.abi);
|
|
897
897
|
const liquidity = (await this.utils.getBalance(tokenId, this.address))
|
|
898
|
-
.mul(amount)
|
|
899
|
-
.div(
|
|
898
|
+
.mul(Math.round(amount * 1e4))
|
|
899
|
+
.div(1e6);
|
|
900
900
|
txData = abi.encodeFunctionData(Transaction.REMOVE_LIQUIDITY_UNSTAKE, [
|
|
901
901
|
tokenId,
|
|
902
902
|
liquidity,
|
package/src/test/arrakis.test.ts
CHANGED
|
@@ -14,7 +14,7 @@ jest.setTimeout(100000);
|
|
|
14
14
|
describe("pool", () => {
|
|
15
15
|
beforeAll(async () => {
|
|
16
16
|
dhedge = new Dhedge(wallet, Network.POLYGON);
|
|
17
|
-
options = await getTxOptions();
|
|
17
|
+
options = await getTxOptions(Network.POLYGON);
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
// it("approves unlimited WETH on Arrakis", async () => {
|
|
@@ -69,7 +69,7 @@ describe("pool", () => {
|
|
|
69
69
|
const result = await pool.decreaseLiquidity(
|
|
70
70
|
Dapp.ARRAKIS,
|
|
71
71
|
ARRAKIS_USDC_WETH_GAUGE,
|
|
72
|
-
|
|
72
|
+
50.6576575755,
|
|
73
73
|
options
|
|
74
74
|
);
|
|
75
75
|
console.log("result", result);
|
package/src/test/constants.ts
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
//Polygon
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
export const USDC = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
|
|
3
|
+
export const WETH = "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619";
|
|
4
|
+
export const USDT = "0xc2132D05D31c914a87C6611C10748AEb04B58e8F";
|
|
5
|
+
export const DAI = "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063";
|
|
6
|
+
export const TUSD = "0x2e1ad108ff1d8c782fcbbb89aad783ac49586756";
|
|
7
|
+
export const WBTC = "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6";
|
|
8
|
+
export const SUSHI = "0x0b3f868e0be5597d5db7feb59e1cadbb0fdda50a";
|
|
9
|
+
export const WMATIC = "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270";
|
|
10
|
+
export const BAL = "0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3";
|
|
11
|
+
export const AMUSDC = "0x1a13f4ca1d028320a707d99520abfefca3998b7f";
|
|
12
|
+
export const VDEBTWETH = "0xede17e9d79fc6f9ff9250d9eefbdb88cc18038b5";
|
|
13
|
+
export const ARRAKIS_USDC_WETH_GAUGE =
|
|
14
|
+
"0x33d1ad9Cd88A509397CD924C2d7613C285602C20";
|
|
15
|
+
export const STMATIC = "0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4";
|
|
16
|
+
export const WMATIC_STMATIC_LP = "0xaF5E0B5425dE1F5a630A8cB5AA9D97B8141C908D";
|
|
17
|
+
export const AARAKIS_WNATIC_STMATIC_GAUGE =
|
|
18
|
+
"0x9928340f9E1aaAd7dF1D95E27bd9A5c715202a56";
|
|
17
19
|
|
|
18
20
|
//Optimism
|
|
19
|
-
export const WETH = "0x4200000000000000000000000000000000000006";
|
|
20
|
-
export const USDC = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
|
|
21
|
-
export const DAI = "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1";
|
|
21
|
+
// export const WETH = "0x4200000000000000000000000000000000000006";
|
|
22
|
+
// export const USDC = "0x7F5c764cBc14f9669B88837ca1490cCa17c31607";
|
|
23
|
+
// export const DAI = "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1";
|
|
22
24
|
|
|
23
|
-
export const TEST_POOL = "
|
|
25
|
+
export const TEST_POOL = "TEST_POOL";
|