@varla/sdk 3.2.0 → 4.1.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/AGENTS.md +9 -9
- package/CHANGELOG.md +35 -0
- package/dist/abi/full/VarlaCore.d.ts +44 -60
- package/dist/abi/full/VarlaCore.d.ts.map +1 -1
- package/dist/abi/full/VarlaCore.js +55 -77
- package/dist/abi/full/VarlaCore.js.map +1 -1
- package/dist/abi/full/VarlaLiquidator.d.ts +1 -1
- package/dist/abi/full/VarlaLiquidator.js +1 -1
- package/dist/abi/full/VarlaLiquidator.js.map +1 -1
- package/dist/actions/core.d.ts +35 -0
- package/dist/actions/core.d.ts.map +1 -1
- package/dist/actions/core.js +36 -5
- package/dist/actions/core.js.map +1 -1
- package/dist/actions/erc1155.d.ts +73 -0
- package/dist/actions/erc1155.d.ts.map +1 -1
- package/dist/actions/erc1155.js +74 -0
- package/dist/actions/erc1155.js.map +1 -1
- package/dist/addresses/polygon.js +11 -11
- package/dist/addresses/polygonProxy.js +6 -6
- package/dist/generated.d.ts +45 -61
- package/dist/generated.d.ts.map +1 -1
- package/dist/leverage/deleverageExecute.d.ts +7 -1
- package/dist/leverage/deleverageExecute.d.ts.map +1 -1
- package/dist/leverage/deleverageExecute.js +11 -16
- package/dist/leverage/deleverageExecute.js.map +1 -1
- package/dist/leverage/execute.d.ts +7 -1
- package/dist/leverage/execute.d.ts.map +1 -1
- package/dist/leverage/execute.js +11 -16
- package/dist/leverage/execute.js.map +1 -1
- package/dist/views/core.d.ts +81 -1
- package/dist/views/core.d.ts.map +1 -1
- package/dist/views/core.js +81 -2
- package/dist/views/core.js.map +1 -1
- package/package.json +1 -1
- package/src/abi/full/VarlaCore.ts +55 -77
- package/src/abi/full/VarlaLiquidator.ts +1 -1
- package/src/actions/core.ts +51 -5
- package/src/actions/erc1155.ts +96 -0
- package/src/addresses/polygon.json +11 -11
- package/src/addresses/polygon.ts +11 -11
- package/src/addresses/polygonProxy.json +6 -6
- package/src/addresses/polygonProxy.ts +6 -6
- package/src/leverage/deleverageExecute.ts +19 -20
- package/src/leverage/execute.ts +19 -20
- package/src/views/core.ts +153 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export const polygon = {
|
|
2
|
-
accessManager: "
|
|
3
|
-
oracle: "
|
|
4
|
-
core: "
|
|
5
|
-
pool: "
|
|
6
|
-
oracleUpdaterRouter: "
|
|
7
|
-
interestRateStrategy: "
|
|
8
|
-
proxyAdmin: "
|
|
9
|
-
liquidator: "
|
|
10
|
-
mergeLiquidator: "
|
|
11
|
-
convertLiquidator: "
|
|
12
|
-
polymarketCtfAdapter: "
|
|
2
|
+
accessManager: "0xEC4CBe73cFA6846B6772341e199289F7A4f20e7e",
|
|
3
|
+
oracle: "0xA63c6ebD3a0C6990D16Ea94D957c2Ad8D3c7Dd10",
|
|
4
|
+
core: "0xc1c7720Eb3563630aA77be561cD0B58F1Fa280F6",
|
|
5
|
+
pool: "0xc939CC89340E22bDf33df82A55118b19d4A11Bc2",
|
|
6
|
+
oracleUpdaterRouter: "0x59389217DEB847b3747767b2D7f56ffec43E9c72",
|
|
7
|
+
interestRateStrategy: "0x62cf2ab7346b5bA86faaa302d1E39908525166dB",
|
|
8
|
+
proxyAdmin: "0xf06B99237d2A53c6026ff5E3723417E6dEDcA651",
|
|
9
|
+
liquidator: "0xd7760D42661b8A559A61351873E0e006985F0d75",
|
|
10
|
+
mergeLiquidator: "0x5fA44Ba97470ADaDc97cb7F3ce64baceeE37f97a",
|
|
11
|
+
convertLiquidator: "0xBA802DF5e8258636738A28d27573203B32D2120A",
|
|
12
|
+
polymarketCtfAdapter: "0x66Ed3cf23719eb9111966AF6D6842F6548165313",
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=polygon.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export const polygonProxy = {
|
|
2
2
|
accessManager: "0x5069d899bA3EBC4e12aB357F44B1DA3b0D0395f4",
|
|
3
3
|
oracle: "0x14e102a52474f569eB6C536a1bb15b9F69c5ba8f",
|
|
4
|
-
core: "
|
|
5
|
-
pool: "
|
|
4
|
+
core: "0xB7e45923a4B21793Bae7Bd445fdd7318B0fF1409",
|
|
5
|
+
pool: "0x0845B5b2cF295C77eBB23347706A30448bEf9aF2",
|
|
6
6
|
oracleUpdaterRouter: "0x3E1e6B54626D486b844C94e2385773b018fEB891",
|
|
7
|
-
interestRateStrategy: "
|
|
7
|
+
interestRateStrategy: "0x3Ae3a0B358a53aF835A924F4799c91943206e3d1",
|
|
8
8
|
proxyAdmin: "0x084aBfA2f32A53741DDd12D3166dA1318e7d73f7",
|
|
9
|
-
liquidator: "
|
|
10
|
-
mergeLiquidator: "
|
|
11
|
-
convertLiquidator: "
|
|
9
|
+
liquidator: "0x0f031BFbfFB08C3f844b8e59BAd9975CBec194b5",
|
|
10
|
+
mergeLiquidator: "0x573A7bD3117c9D8EA1913c2Ccbdbf29E86EE4621",
|
|
11
|
+
convertLiquidator: "0xc1ba05218Fb56b5e31D34b3bb772fa57F1eDC7e4",
|
|
12
12
|
polymarketCtfAdapter: "0x86B39800540D2C42eF1E34DF69117CB34F35a341",
|
|
13
13
|
};
|
|
14
14
|
//# sourceMappingURL=polygonProxy.js.map
|
package/dist/generated.d.ts
CHANGED
|
@@ -3391,6 +3391,14 @@ export declare const abis: {
|
|
|
3391
3391
|
}];
|
|
3392
3392
|
readonly name: "TooManyPositions";
|
|
3393
3393
|
readonly type: "error";
|
|
3394
|
+
}, {
|
|
3395
|
+
readonly inputs: readonly [{
|
|
3396
|
+
readonly internalType: "address";
|
|
3397
|
+
readonly name: "token";
|
|
3398
|
+
readonly type: "address";
|
|
3399
|
+
}];
|
|
3400
|
+
readonly name: "UnsupportedPositionsToken";
|
|
3401
|
+
readonly type: "error";
|
|
3394
3402
|
}, {
|
|
3395
3403
|
readonly inputs: readonly [];
|
|
3396
3404
|
readonly name: "WouldBeUndercollateralized";
|
|
@@ -3849,10 +3857,6 @@ export declare const abis: {
|
|
|
3849
3857
|
readonly internalType: "uint256";
|
|
3850
3858
|
readonly name: "amount";
|
|
3851
3859
|
readonly type: "uint256";
|
|
3852
|
-
}, {
|
|
3853
|
-
readonly internalType: "address";
|
|
3854
|
-
readonly name: "outputAsset";
|
|
3855
|
-
readonly type: "address";
|
|
3856
3860
|
}];
|
|
3857
3861
|
readonly name: "borrow";
|
|
3858
3862
|
readonly outputs: readonly [];
|
|
@@ -3863,6 +3867,14 @@ export declare const abis: {
|
|
|
3863
3867
|
readonly internalType: "uint256";
|
|
3864
3868
|
readonly name: "amount";
|
|
3865
3869
|
readonly type: "uint256";
|
|
3870
|
+
}, {
|
|
3871
|
+
readonly internalType: "address";
|
|
3872
|
+
readonly name: "outputAsset";
|
|
3873
|
+
readonly type: "address";
|
|
3874
|
+
}, {
|
|
3875
|
+
readonly internalType: "address";
|
|
3876
|
+
readonly name: "recipient";
|
|
3877
|
+
readonly type: "address";
|
|
3866
3878
|
}];
|
|
3867
3879
|
readonly name: "borrow";
|
|
3868
3880
|
readonly outputs: readonly [];
|
|
@@ -3922,28 +3934,6 @@ export declare const abis: {
|
|
|
3922
3934
|
readonly outputs: readonly [];
|
|
3923
3935
|
readonly stateMutability: "nonpayable";
|
|
3924
3936
|
readonly type: "function";
|
|
3925
|
-
}, {
|
|
3926
|
-
readonly inputs: readonly [{
|
|
3927
|
-
readonly internalType: "uint256[]";
|
|
3928
|
-
readonly name: "positionIds";
|
|
3929
|
-
readonly type: "uint256[]";
|
|
3930
|
-
}, {
|
|
3931
|
-
readonly internalType: "uint256[]";
|
|
3932
|
-
readonly name: "amounts";
|
|
3933
|
-
readonly type: "uint256[]";
|
|
3934
|
-
}, {
|
|
3935
|
-
readonly internalType: "uint256";
|
|
3936
|
-
readonly name: "borrowAmount";
|
|
3937
|
-
readonly type: "uint256";
|
|
3938
|
-
}, {
|
|
3939
|
-
readonly internalType: "address";
|
|
3940
|
-
readonly name: "outputAsset";
|
|
3941
|
-
readonly type: "address";
|
|
3942
|
-
}];
|
|
3943
|
-
readonly name: "depositAndBorrow";
|
|
3944
|
-
readonly outputs: readonly [];
|
|
3945
|
-
readonly stateMutability: "nonpayable";
|
|
3946
|
-
readonly type: "function";
|
|
3947
3937
|
}, {
|
|
3948
3938
|
readonly inputs: readonly [{
|
|
3949
3939
|
readonly internalType: "address";
|
|
@@ -4008,20 +3998,6 @@ export declare const abis: {
|
|
|
4008
3998
|
}];
|
|
4009
3999
|
readonly stateMutability: "view";
|
|
4010
4000
|
readonly type: "function";
|
|
4011
|
-
}, {
|
|
4012
|
-
readonly inputs: readonly [{
|
|
4013
|
-
readonly internalType: "address";
|
|
4014
|
-
readonly name: "user";
|
|
4015
|
-
readonly type: "address";
|
|
4016
|
-
}];
|
|
4017
|
-
readonly name: "getCollateralValue";
|
|
4018
|
-
readonly outputs: readonly [{
|
|
4019
|
-
readonly internalType: "uint256";
|
|
4020
|
-
readonly name: "";
|
|
4021
|
-
readonly type: "uint256";
|
|
4022
|
-
}];
|
|
4023
|
-
readonly stateMutability: "view";
|
|
4024
|
-
readonly type: "function";
|
|
4025
4001
|
}, {
|
|
4026
4002
|
readonly inputs: readonly [{
|
|
4027
4003
|
readonly internalType: "address";
|
|
@@ -4208,20 +4184,6 @@ export declare const abis: {
|
|
|
4208
4184
|
}];
|
|
4209
4185
|
readonly stateMutability: "view";
|
|
4210
4186
|
readonly type: "function";
|
|
4211
|
-
}, {
|
|
4212
|
-
readonly inputs: readonly [{
|
|
4213
|
-
readonly internalType: "address";
|
|
4214
|
-
readonly name: "user";
|
|
4215
|
-
readonly type: "address";
|
|
4216
|
-
}];
|
|
4217
|
-
readonly name: "getPortfolioValue";
|
|
4218
|
-
readonly outputs: readonly [{
|
|
4219
|
-
readonly internalType: "uint256";
|
|
4220
|
-
readonly name: "";
|
|
4221
|
-
readonly type: "uint256";
|
|
4222
|
-
}];
|
|
4223
|
-
readonly stateMutability: "view";
|
|
4224
|
-
readonly type: "function";
|
|
4225
4187
|
}, {
|
|
4226
4188
|
readonly inputs: readonly [{
|
|
4227
4189
|
readonly internalType: "address";
|
|
@@ -4492,15 +4454,15 @@ export declare const abis: {
|
|
|
4492
4454
|
readonly type: "address";
|
|
4493
4455
|
}, {
|
|
4494
4456
|
readonly internalType: "address";
|
|
4495
|
-
readonly name: "";
|
|
4457
|
+
readonly name: "from";
|
|
4496
4458
|
readonly type: "address";
|
|
4497
4459
|
}, {
|
|
4498
4460
|
readonly internalType: "uint256[]";
|
|
4499
|
-
readonly name: "";
|
|
4461
|
+
readonly name: "ids";
|
|
4500
4462
|
readonly type: "uint256[]";
|
|
4501
4463
|
}, {
|
|
4502
4464
|
readonly internalType: "uint256[]";
|
|
4503
|
-
readonly name: "";
|
|
4465
|
+
readonly name: "values";
|
|
4504
4466
|
readonly type: "uint256[]";
|
|
4505
4467
|
}, {
|
|
4506
4468
|
readonly internalType: "bytes";
|
|
@@ -4522,15 +4484,15 @@ export declare const abis: {
|
|
|
4522
4484
|
readonly type: "address";
|
|
4523
4485
|
}, {
|
|
4524
4486
|
readonly internalType: "address";
|
|
4525
|
-
readonly name: "";
|
|
4487
|
+
readonly name: "from";
|
|
4526
4488
|
readonly type: "address";
|
|
4527
4489
|
}, {
|
|
4528
4490
|
readonly internalType: "uint256";
|
|
4529
|
-
readonly name: "";
|
|
4491
|
+
readonly name: "id";
|
|
4530
4492
|
readonly type: "uint256";
|
|
4531
4493
|
}, {
|
|
4532
4494
|
readonly internalType: "uint256";
|
|
4533
|
-
readonly name: "";
|
|
4495
|
+
readonly name: "value";
|
|
4534
4496
|
readonly type: "uint256";
|
|
4535
4497
|
}, {
|
|
4536
4498
|
readonly internalType: "bytes";
|
|
@@ -4612,6 +4574,10 @@ export declare const abis: {
|
|
|
4612
4574
|
readonly internalType: "address";
|
|
4613
4575
|
readonly name: "inputAsset";
|
|
4614
4576
|
readonly type: "address";
|
|
4577
|
+
}, {
|
|
4578
|
+
readonly internalType: "address";
|
|
4579
|
+
readonly name: "onBehalfOf";
|
|
4580
|
+
readonly type: "address";
|
|
4615
4581
|
}];
|
|
4616
4582
|
readonly name: "repay";
|
|
4617
4583
|
readonly outputs: readonly [];
|
|
@@ -4833,6 +4799,24 @@ export declare const abis: {
|
|
|
4833
4799
|
}];
|
|
4834
4800
|
readonly stateMutability: "view";
|
|
4835
4801
|
readonly type: "function";
|
|
4802
|
+
}, {
|
|
4803
|
+
readonly inputs: readonly [{
|
|
4804
|
+
readonly internalType: "uint256[]";
|
|
4805
|
+
readonly name: "positionIds";
|
|
4806
|
+
readonly type: "uint256[]";
|
|
4807
|
+
}, {
|
|
4808
|
+
readonly internalType: "uint256[]";
|
|
4809
|
+
readonly name: "amounts";
|
|
4810
|
+
readonly type: "uint256[]";
|
|
4811
|
+
}, {
|
|
4812
|
+
readonly internalType: "address";
|
|
4813
|
+
readonly name: "destination";
|
|
4814
|
+
readonly type: "address";
|
|
4815
|
+
}];
|
|
4816
|
+
readonly name: "withdraw";
|
|
4817
|
+
readonly outputs: readonly [];
|
|
4818
|
+
readonly stateMutability: "nonpayable";
|
|
4819
|
+
readonly type: "function";
|
|
4836
4820
|
}, {
|
|
4837
4821
|
readonly inputs: readonly [{
|
|
4838
4822
|
readonly internalType: "uint256[]";
|
|
@@ -7380,7 +7364,7 @@ export declare const abis: {
|
|
|
7380
7364
|
readonly type: "bool";
|
|
7381
7365
|
}, {
|
|
7382
7366
|
readonly internalType: "uint256";
|
|
7383
|
-
readonly name: "
|
|
7367
|
+
readonly name: "portfolioValue";
|
|
7384
7368
|
readonly type: "uint256";
|
|
7385
7369
|
}, {
|
|
7386
7370
|
readonly internalType: "uint256";
|
package/dist/generated.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated.d.ts","sourceRoot":"","sources":["../src/generated.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAeP,CAAC;AAEX,eAAO,MAAM,SAAS;;;CAGZ,CAAC"}
|
|
@@ -24,10 +24,16 @@ export type RunDeleverageLoopParams = {
|
|
|
24
24
|
/**
|
|
25
25
|
* Optional repay settlement asset for core repay steps.
|
|
26
26
|
*
|
|
27
|
-
* When provided, repay steps call `VarlaCore.repay(amount, inputAsset)`.
|
|
27
|
+
* When provided, repay steps call `VarlaCore.repay(amount, inputAsset, onBehalfOf)`.
|
|
28
28
|
* When omitted, repay steps call the default `VarlaCore.repay(amount)`.
|
|
29
29
|
*/
|
|
30
30
|
inputAsset?: Address;
|
|
31
|
+
/**
|
|
32
|
+
* Optional borrower whose debt should be repaid by `account`.
|
|
33
|
+
*
|
|
34
|
+
* Defaults to `account`.
|
|
35
|
+
*/
|
|
36
|
+
repayOnBehalfOf?: Address;
|
|
31
37
|
/** Off-chain sell callback. */
|
|
32
38
|
onSellStep: (step: Extract<DeleverageStep, {
|
|
33
39
|
kind: "sell";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleverageExecute.d.ts","sourceRoot":"","sources":["../../src/leverage/deleverageExecute.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"deleverageExecute.d.ts","sourceRoot":"","sources":["../../src/leverage/deleverageExecute.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,EA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B,IAAI,EAAE,OAAO,CAAC,cAAc,EAAE;YAAE,IAAI,EAAE,UAAU,CAAA;SAAE,CAAC,CAAC;QACpD,IAAI,EAAE,IAAI,CAAC;KACZ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAcF;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAuGlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
-
import { prepareCoreRepay,
|
|
2
|
+
import { prepareCoreRepay, prepareCoreWithdraw } from "../actions/core.js";
|
|
3
3
|
import { sendTx } from "../actions/tx.js";
|
|
4
4
|
import { waitForReceiptWithRetry } from "./receipt.js";
|
|
5
5
|
import { SlippageExceededError } from "./types.js";
|
|
@@ -27,7 +27,7 @@ function sleep(ms) {
|
|
|
27
27
|
* - `startFromStep`: resume from a previously failed step index
|
|
28
28
|
*/
|
|
29
29
|
export async function runDeleverageLoop(params) {
|
|
30
|
-
const { plan, positionId, publicClient, walletClient, coreAddress, account, inputAsset, onSellStep, onProgress, confirmations = 1, maxSlippageBps, receiptRetry, onPostWithdraw, postWithdrawDelayMs = 0, startFromStep = 0, } = params;
|
|
30
|
+
const { plan, positionId, publicClient, walletClient, coreAddress, account, inputAsset, repayOnBehalfOf, onSellStep, onProgress, confirmations = 1, maxSlippageBps, receiptRetry, onPostWithdraw, postWithdrawDelayMs = 0, startFromStep = 0, } = params;
|
|
31
31
|
const total = plan.steps.length;
|
|
32
32
|
// Track actual collateral proceeds from the most recent sell step.
|
|
33
33
|
let lastSellActualCollateral;
|
|
@@ -76,20 +76,15 @@ export async function runDeleverageLoop(params) {
|
|
|
76
76
|
if (step.kind === "repay") {
|
|
77
77
|
const repayAmount = lastSellActualCollateral ?? step.collateralAmount;
|
|
78
78
|
lastSellActualCollateral = undefined;
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
publicClient: publicClient,
|
|
89
|
-
coreAddress,
|
|
90
|
-
account,
|
|
91
|
-
amount: repayAmount,
|
|
92
|
-
});
|
|
79
|
+
const onBehalfOf = repayOnBehalfOf ?? account;
|
|
80
|
+
const useOnBehalfPath = inputAsset !== undefined || onBehalfOf.toLowerCase() !== account.toLowerCase();
|
|
81
|
+
const sim = await prepareCoreRepay({
|
|
82
|
+
publicClient: publicClient,
|
|
83
|
+
coreAddress,
|
|
84
|
+
account,
|
|
85
|
+
amount: repayAmount,
|
|
86
|
+
...(useOnBehalfPath ? { inputAsset, onBehalfOf } : {}),
|
|
87
|
+
});
|
|
93
88
|
const hash = await sendTx({ walletClient: walletClient, request: sim.request });
|
|
94
89
|
await waitForReceiptWithRetry({ publicClient, hash, confirmations, retry: receiptRetry });
|
|
95
90
|
onProgress?.({ completed: i + 1, total, step, hash });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleverageExecute.js","sourceRoot":"","sources":["../../src/leverage/deleverageExecute.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAWpE,OAAO,
|
|
1
|
+
{"version":3,"file":"deleverageExecute.js","sourceRoot":"","sources":["../../src/leverage/deleverageExecute.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAWpE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,O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ACf,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;QACtD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -21,10 +21,16 @@ export type RunLeverageLoopParams = {
|
|
|
21
21
|
/**
|
|
22
22
|
* Optional borrow output asset for core borrow steps.
|
|
23
23
|
*
|
|
24
|
-
* When provided, borrow steps call `VarlaCore.borrow(amount, outputAsset)`.
|
|
24
|
+
* When provided, borrow steps call `VarlaCore.borrow(amount, outputAsset, recipient)`.
|
|
25
25
|
* When omitted, borrow steps call the default `VarlaCore.borrow(amount)`.
|
|
26
26
|
*/
|
|
27
27
|
outputAsset?: Address;
|
|
28
|
+
/**
|
|
29
|
+
* Optional recipient for borrow proceeds.
|
|
30
|
+
*
|
|
31
|
+
* Defaults to `account`. Debt remains on `account`.
|
|
32
|
+
*/
|
|
33
|
+
borrowRecipient?: Address;
|
|
28
34
|
/**
|
|
29
35
|
* Consumer-provided callback for off-chain token acquisition.
|
|
30
36
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/leverage/execute.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/leverage/execute.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAItE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,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AAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB,6FAA6F;IAC7F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAcF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CA4HhC"}
|
package/dist/leverage/execute.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Note: explicit .js extension is required for Node ESM resolution.
|
|
2
|
-
import { prepareCoreBorrow,
|
|
2
|
+
import { prepareCoreBorrow, prepareCoreDeposit } from "../actions/core.js";
|
|
3
3
|
import { sendTx } from "../actions/tx.js";
|
|
4
4
|
import { waitForReceiptWithRetry } from "./receipt.js";
|
|
5
5
|
import { SlippageExceededError } from "./types.js";
|
|
@@ -33,7 +33,7 @@ function sleep(ms) {
|
|
|
33
33
|
* - `startFromStep`: resume from a previously failed step index
|
|
34
34
|
*/
|
|
35
35
|
export async function runLeverageLoop(params) {
|
|
36
|
-
const { plan, positionId, publicClient, walletClient, coreAddress, account, outputAsset, onBuyStep, onProgress, confirmations = 1, maxSlippageBps, receiptRetry, onPostBorrow, postBorrowDelayMs = 0, startFromStep = 0, } = params;
|
|
36
|
+
const { plan, positionId, publicClient, walletClient, coreAddress, account, outputAsset, borrowRecipient, onBuyStep, onProgress, confirmations = 1, maxSlippageBps, receiptRetry, onPostBorrow, postBorrowDelayMs = 0, startFromStep = 0, } = params;
|
|
37
37
|
const results = [];
|
|
38
38
|
const totalSteps = plan.steps.length;
|
|
39
39
|
// Track actual tokens from the most recent buy (for slippage-aware deposits).
|
|
@@ -80,20 +80,15 @@ export async function runLeverageLoop(params) {
|
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
82
|
if (step.kind === "borrow") {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
publicClient: publicClient,
|
|
93
|
-
coreAddress,
|
|
94
|
-
account,
|
|
95
|
-
amount: step.collateralAmount,
|
|
96
|
-
});
|
|
83
|
+
const recipient = borrowRecipient ?? account;
|
|
84
|
+
const useRecipientPath = outputAsset !== undefined || recipient.toLowerCase() !== account.toLowerCase();
|
|
85
|
+
const sim = await prepareCoreBorrow({
|
|
86
|
+
publicClient: publicClient,
|
|
87
|
+
coreAddress,
|
|
88
|
+
account,
|
|
89
|
+
amount: step.collateralAmount,
|
|
90
|
+
...(useRecipientPath ? { outputAsset, recipient } : {}),
|
|
91
|
+
});
|
|
97
92
|
const hash = await sendTx({ walletClient: walletClient, request: sim.request });
|
|
98
93
|
await waitForReceiptWithRetry({ publicClient, hash, confirmations, retry: receiptRetry });
|
|
99
94
|
const result = { step, hash };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/leverage/execute.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAYpE,OAAO,
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/leverage/execute.ts"],"names":[],"mappings":"AAAA,oEAAoE;AAYpE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAQvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAwGnD,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC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,MAAM,IAAI,KAAK,CAAC,sBAAuB,IAAY,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO;gBACP,SAAS,EAAE,KAAK;gBAChB,YAAY,EAAE,CAAC;gBACf,KAAK;aACN,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACtC,CAAC"}
|
package/dist/views/core.d.ts
CHANGED
|
@@ -89,6 +89,86 @@ export declare function previewCoreDeposit(params: {
|
|
|
89
89
|
positionIds: readonly bigint[];
|
|
90
90
|
amounts: readonly bigint[];
|
|
91
91
|
}): Promise<PreviewCoreDeposit>;
|
|
92
|
+
/**
|
|
93
|
+
* Reason a collateral withdrawal would be rejected for a specific position.
|
|
94
|
+
*
|
|
95
|
+
* - `"zero-amount"` — caller passed `amount === 0n`.
|
|
96
|
+
* - `"insufficient-balance"` — user's deposited balance is below the requested amount.
|
|
97
|
+
*/
|
|
98
|
+
export type WithdrawBlockReason = "zero-amount" | "insufficient-balance";
|
|
99
|
+
export type PreviewCoreWithdrawItem = {
|
|
100
|
+
positionId: bigint;
|
|
101
|
+
amount: bigint;
|
|
102
|
+
/** Current deposited balance of the user for this position. */
|
|
103
|
+
balance: bigint;
|
|
104
|
+
/** `true` when this position passes the pre-flight balance check. */
|
|
105
|
+
ok: boolean;
|
|
106
|
+
/** Present only when `ok === false`. */
|
|
107
|
+
reason?: WithdrawBlockReason;
|
|
108
|
+
};
|
|
109
|
+
export type PreviewCoreWithdraw = {
|
|
110
|
+
/**
|
|
111
|
+
* `true` only when every position passes the balance check AND the user either
|
|
112
|
+
* has no outstanding debt or has sufficient health factor to absorb the withdrawal.
|
|
113
|
+
*
|
|
114
|
+
* When `hasDeb === true`, always simulate the on-chain call or check HF separately
|
|
115
|
+
* before submitting — this preview cannot compute the exact post-withdraw HF
|
|
116
|
+
* without oracle price data.
|
|
117
|
+
*/
|
|
118
|
+
canWithdraw: boolean;
|
|
119
|
+
/** Per-position results aligned to input order. */
|
|
120
|
+
items: PreviewCoreWithdrawItem[];
|
|
121
|
+
/** `true` when the user has any outstanding debt. Withdrawing while indebted
|
|
122
|
+
* may reduce the health factor below the liquidation threshold. */
|
|
123
|
+
hasDebt: boolean;
|
|
124
|
+
/** Current health factor (WAD). `0` when the user has no debt. */
|
|
125
|
+
healthFactor: bigint;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Pre-flight check that mirrors VarlaCore.withdraw() balance validation.
|
|
129
|
+
*
|
|
130
|
+
* Checks (per position):
|
|
131
|
+
* 1. `amount > 0`
|
|
132
|
+
* 2. `core.positionBalances(user, id) >= amount`
|
|
133
|
+
*
|
|
134
|
+
* Account-level:
|
|
135
|
+
* - Whether the user currently has debt (`debt > 0`).
|
|
136
|
+
*
|
|
137
|
+
* **Important**: this function cannot predict the post-withdraw health factor
|
|
138
|
+
* without live oracle prices. When `hasDebt === true`, always double-check
|
|
139
|
+
* the HF with `readHealthFactor` or simulate the transaction before submitting.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* import { previewCoreWithdraw } from "@varla/sdk/views";
|
|
144
|
+
*
|
|
145
|
+
* const preview = await previewCoreWithdraw({
|
|
146
|
+
* core,
|
|
147
|
+
* user: "0x...",
|
|
148
|
+
* positionIds: [yesId],
|
|
149
|
+
* amounts: [50_000_000n],
|
|
150
|
+
* });
|
|
151
|
+
*
|
|
152
|
+
* if (!preview.canWithdraw) {
|
|
153
|
+
* for (const item of preview.items) {
|
|
154
|
+
* if (!item.ok) console.log(`Position ${item.positionId}: ${item.reason}`);
|
|
155
|
+
* }
|
|
156
|
+
* if (preview.hasDebt) console.log("User has debt — check HF before withdrawing");
|
|
157
|
+
* }
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export declare function previewCoreWithdraw(params: {
|
|
161
|
+
core: {
|
|
162
|
+
read: {
|
|
163
|
+
positionBalances: (args: readonly [Address, bigint]) => Promise<bigint>;
|
|
164
|
+
getDebt: (args: readonly [Address]) => Promise<bigint>;
|
|
165
|
+
getHealthFactor: (args: readonly [Address]) => Promise<unknown>;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
user: Address;
|
|
169
|
+
positionIds: readonly bigint[];
|
|
170
|
+
amounts: readonly bigint[];
|
|
171
|
+
}): Promise<PreviewCoreWithdraw>;
|
|
92
172
|
export type ReadAccountSnapshot = {
|
|
93
173
|
portfolioValue: bigint;
|
|
94
174
|
collateralValue: bigint;
|
|
@@ -263,7 +343,7 @@ export declare function readBorrowerState(params: {
|
|
|
263
343
|
export declare function readPortfolioValue(params: {
|
|
264
344
|
core: {
|
|
265
345
|
read: {
|
|
266
|
-
|
|
346
|
+
getAccountSummary: (args: readonly [Address]) => Promise<readonly [bigint, bigint, bigint, bigint, bigint]>;
|
|
267
347
|
};
|
|
268
348
|
};
|
|
269
349
|
user: Address;
|