@morpho-org/bundler-sdk-viem 3.2.3 → 3.2.5
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/lib/actions.js +6 -6
- package/package.json +8 -8
package/lib/actions.js
CHANGED
|
@@ -427,7 +427,7 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
|
|
|
427
427
|
.getMarket(id)
|
|
428
428
|
.accrueInterest(dataBefore.block.timestamp);
|
|
429
429
|
const { assets: withdrawnAssets, shares: withdrawnShares } = market.withdraw(assets, shares);
|
|
430
|
-
const minSharePrice = blue_sdk_1.MathLib.
|
|
430
|
+
const minSharePrice = blue_sdk_1.MathLib.mulDivDown(withdrawnAssets, blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD - slippage), withdrawnShares);
|
|
431
431
|
actions.push({
|
|
432
432
|
type: "morphoWithdraw",
|
|
433
433
|
args: [
|
|
@@ -448,7 +448,7 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
|
|
|
448
448
|
.getMarket(id)
|
|
449
449
|
.accrueInterest(dataBefore.block.timestamp);
|
|
450
450
|
const { assets: borrowedAssets, shares: borrowedShares } = market.borrow(assets, shares);
|
|
451
|
-
const minSharePrice = blue_sdk_1.MathLib.
|
|
451
|
+
const minSharePrice = blue_sdk_1.MathLib.mulDivDown(borrowedAssets, blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD - slippage), borrowedShares);
|
|
452
452
|
actions.push({
|
|
453
453
|
type: "morphoBorrow",
|
|
454
454
|
args: [
|
|
@@ -530,7 +530,7 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
|
|
|
530
530
|
.getAccrualVault(operation.address)
|
|
531
531
|
.accrueInterest(dataBefore.block.timestamp);
|
|
532
532
|
if (shares === 0n) {
|
|
533
|
-
const maxSharePrice = blue_sdk_1.MathLib.mulDivUp(assets, blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD + slippage), vault.toShares(assets));
|
|
533
|
+
const maxSharePrice = blue_sdk_1.MathLib.mulDivUp(assets, blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD + slippage), vault.toShares(assets, "Down"));
|
|
534
534
|
actions.push({
|
|
535
535
|
type: "erc4626Deposit",
|
|
536
536
|
args: [
|
|
@@ -543,7 +543,7 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
|
|
|
543
543
|
});
|
|
544
544
|
}
|
|
545
545
|
else {
|
|
546
|
-
const maxSharePrice = blue_sdk_1.MathLib.mulDivUp(vault.toAssets(shares), blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD + slippage), shares);
|
|
546
|
+
const maxSharePrice = blue_sdk_1.MathLib.mulDivUp(vault.toAssets(shares, "Up"), blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD + slippage), shares);
|
|
547
547
|
actions.push({
|
|
548
548
|
type: "erc4626Mint",
|
|
549
549
|
args: [
|
|
@@ -564,7 +564,7 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
|
|
|
564
564
|
.getAccrualVault(operation.address)
|
|
565
565
|
.accrueInterest(dataBefore.block.timestamp);
|
|
566
566
|
if (shares === 0n) {
|
|
567
|
-
const minSharePrice = blue_sdk_1.MathLib.
|
|
567
|
+
const minSharePrice = blue_sdk_1.MathLib.mulDivDown(assets, blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD - slippage), vault.toShares(assets, "Up"));
|
|
568
568
|
actions.push({
|
|
569
569
|
type: "erc4626Withdraw",
|
|
570
570
|
args: [
|
|
@@ -578,7 +578,7 @@ const encodeOperation = (operation, dataBefore, supportsSignature = true, index
|
|
|
578
578
|
});
|
|
579
579
|
}
|
|
580
580
|
else {
|
|
581
|
-
const minSharePrice = blue_sdk_1.MathLib.
|
|
581
|
+
const minSharePrice = blue_sdk_1.MathLib.mulDivDown(vault.toAssets(shares, "Down"), blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD - slippage), shares);
|
|
582
582
|
actions.push({
|
|
583
583
|
type: "erc4626Redeem",
|
|
584
584
|
args: [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/bundler-sdk-viem",
|
|
3
3
|
"description": "Viem-based extension of `@morpho-org/simulation-sdk` that exports utilities to transform simple interactions on Morpho (such as `Blue_Borrow`) and Morpho Vaults (such as `MetaMorpho_Deposit`) into the required bundles (with ERC20 approvals, transfers, etc) to submit to the bundler onchain.",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.5",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Rubilmax <rmilon@gmail.com>"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
],
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"viem": "^2.0.0",
|
|
22
|
-
"@morpho-org/blue-sdk": "^4.
|
|
23
|
-
"@morpho-org/
|
|
22
|
+
"@morpho-org/blue-sdk": "^4.4.0",
|
|
23
|
+
"@morpho-org/simulation-sdk": "^3.1.2",
|
|
24
24
|
"@morpho-org/blue-sdk-viem": "^3.1.1",
|
|
25
|
-
"@morpho-org/
|
|
25
|
+
"@morpho-org/morpho-ts": "^2.4.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tanstack/query-core": "^5.62.16",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"typescript": "^5.7.2",
|
|
35
35
|
"viem": "^2.23.0",
|
|
36
36
|
"vitest": "^3.0.5",
|
|
37
|
-
"@morpho-org/blue-sdk": "^4.0.0",
|
|
38
37
|
"@morpho-org/blue-sdk-viem": "^3.1.1",
|
|
39
|
-
"@morpho-org/morpho-ts": "^2.4.0",
|
|
40
|
-
"@morpho-org/simulation-sdk": "^3.1.1",
|
|
41
38
|
"@morpho-org/morpho-test": "^2.3.0",
|
|
42
|
-
"@morpho-org/
|
|
39
|
+
"@morpho-org/blue-sdk": "^4.4.0",
|
|
40
|
+
"@morpho-org/morpho-ts": "^2.4.1",
|
|
41
|
+
"@morpho-org/simulation-sdk": "^3.1.2",
|
|
43
42
|
"@morpho-org/test": "^2.1.4",
|
|
43
|
+
"@morpho-org/simulation-sdk-wagmi": "^3.0.2",
|
|
44
44
|
"@morpho-org/test-wagmi": "^2.0.4"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|