@varla/sdk 2.10.0 → 2.11.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 +63 -5
- package/CHANGELOG.md +9 -0
- package/README.md +73 -0
- package/dist/abi/full/VarlaOracle.d.ts +151 -1
- package/dist/abi/full/VarlaOracle.d.ts.map +1 -1
- package/dist/abi/full/VarlaOracle.js +195 -1
- package/dist/abi/full/VarlaOracle.js.map +1 -1
- package/dist/abi/subsets/VarlaOracle.registry.d.ts +66 -0
- package/dist/abi/subsets/VarlaOracle.registry.d.ts.map +1 -1
- package/dist/abi/subsets/VarlaOracle.registry.js +83 -0
- package/dist/abi/subsets/VarlaOracle.registry.js.map +1 -1
- package/dist/generated.d.ts +217 -1
- package/dist/generated.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/safe.d.ts +108 -0
- package/dist/safe.d.ts.map +1 -0
- package/dist/safe.js +148 -0
- package/dist/safe.js.map +1 -0
- package/package.json +5 -1
- package/src/abi/full/VarlaOracle.ts +195 -1
- package/src/abi/subsets/VarlaOracle.registry.ts +83 -0
- package/src/index.ts +2 -0
- package/src/safe.ts +226 -0
package/AGENTS.md
CHANGED
|
@@ -21,6 +21,7 @@ Published package: **@varla/sdk**
|
|
|
21
21
|
- Errors: `@varla/sdk/errors`
|
|
22
22
|
- Utilities: `@varla/sdk/batch`, `@varla/sdk/format`
|
|
23
23
|
- Leverage: `@varla/sdk/leverage`
|
|
24
|
+
- Safe/proxy wallet: `@varla/sdk/safe`
|
|
24
25
|
|
|
25
26
|
---
|
|
26
27
|
|
|
@@ -89,6 +90,55 @@ if (decoded) console.log(formatVarlaError(decoded));
|
|
|
89
90
|
|
|
90
91
|
---
|
|
91
92
|
|
|
93
|
+
## Proxy wallet / Safe integration (`@varla/sdk/safe`)
|
|
94
|
+
|
|
95
|
+
Polymarket users hold ERC-1155 positions inside Gnosis Safe proxy wallets.
|
|
96
|
+
The `@varla/sdk/safe` subpath encodes multiple SDK `prepare*()` results into a single
|
|
97
|
+
Safe MultiSend transaction — enabling atomic approve → deposit → borrow flows.
|
|
98
|
+
|
|
99
|
+
### Why no contract changes are needed
|
|
100
|
+
|
|
101
|
+
VarlaCore's `deposit()`, `borrow()`, etc. accept any `msg.sender`. When a Gnosis Safe
|
|
102
|
+
calls VarlaCore, positions and debt are tracked under the Safe's address.
|
|
103
|
+
|
|
104
|
+
### Key functions
|
|
105
|
+
|
|
106
|
+
- `encodeSafeMultiSend(inputs, options?)` — Encodes an array of txs into Safe MultiSend format.
|
|
107
|
+
Accepts both raw `{ to, data, value }` and `prepare*()` simulation results.
|
|
108
|
+
Returns `{ to, data, value, count }` ready for Safe SDK submission.
|
|
109
|
+
- `encodeSafeMultiSendCallOnly(inputs)` — Same but uses the "call only" MultiSend contract.
|
|
110
|
+
|
|
111
|
+
### Usage pattern
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import { encodeSafeMultiSend } from "@varla/sdk/safe";
|
|
115
|
+
import * as actions from "@varla/sdk/actions";
|
|
116
|
+
|
|
117
|
+
// Always use the Safe address as `account` in prepare*() calls
|
|
118
|
+
const approve = await actions.prepareErc1155SetApprovalForAll({
|
|
119
|
+
publicClient, tokenAddress: ctfAddress, account: safeAddress,
|
|
120
|
+
operator: coreAddress, approved: true,
|
|
121
|
+
});
|
|
122
|
+
const deposit = await actions.prepareCoreDeposit({
|
|
123
|
+
publicClient, coreAddress, account: safeAddress,
|
|
124
|
+
positionIds: [posId], amounts: [amt],
|
|
125
|
+
});
|
|
126
|
+
const borrow = await actions.prepareCoreBorrow({
|
|
127
|
+
publicClient, coreAddress, account: safeAddress, amount: borrowAmt,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
const batch = encodeSafeMultiSend([approve, deposit, borrow]);
|
|
131
|
+
// Submit via Safe SDK with operation: 1 (DELEGATECALL to MultiSend)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Important notes
|
|
135
|
+
|
|
136
|
+
- **Single-tx optimization**: When given 1 input, returns it directly (no MultiSend wrapper).
|
|
137
|
+
- **`account` must be the Safe address**: Contracts track state under `msg.sender`, which is the Safe.
|
|
138
|
+
- **Constants**: `SAFE_MULTISEND_ADDRESS` (`0x3886…`) and `SAFE_MULTISEND_CALL_ONLY_ADDRESS` (`0x9641…`) are exported — same addresses on all EVM chains.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
92
142
|
## Not provided by the SDK (by design)
|
|
93
143
|
|
|
94
144
|
- **"Interest accrued / lender earnings" for a user**
|
|
@@ -112,16 +162,16 @@ if (decoded) console.log(formatVarlaError(decoded));
|
|
|
112
162
|
<!-- BEGIN GENERATED:EXPORTS -->
|
|
113
163
|
<!--
|
|
114
164
|
Auto-generated by scripts/sdk/generate-docs.ts — DO NOT EDIT MANUALLY.
|
|
115
|
-
|
|
165
|
+
368 functions, 189 types across 11 subpaths.
|
|
116
166
|
-->
|
|
117
167
|
|
|
118
|
-
### `@varla/sdk` (
|
|
168
|
+
### `@varla/sdk` (182 functions, 96 types, 10 constants)
|
|
119
169
|
|
|
120
|
-
**Functions:** `prepareCoreSetDefaultLtvConfig`, `prepareCoreSetLiquidationConfig`, `prepareCoreSetTierLiquidationConfig`, `prepareCoreSetMaxPositions`, `prepareCoreSetMaxPositionsBounds`, `prepareCoreSetOracle`, `prepareCoreSetPositionLtvOverride`, `prepareCoreClearPositionLtvOverride`, `prepareCoreSetPositionLiquidationConfigOverride`, `prepareCoreClearPositionLiquidationConfigOverride`, `preparePoolSetDepositCap`, `preparePoolSetBorrowCap`, `preparePoolWithdrawReserve`, `preparePoolSetInterestRateStrategy`, `prepareOracleSetMaxStaleness`, `prepareOracleSetLiquidationGracePeriod`, `prepareOracleSetDefaultEarlyClosureWindow`, `prepareStrategySetPool`, `prepareStrategySetRateParams`, `prepareOracleUpdaterRouterSetPublisher`, `prepareCoreDeposit`, `prepareCoreWithdraw`, `prepareCoreBorrow`, `prepareCoreRepay`, `prepareErc20Approve`, `prepareErc1155SetApprovalForAll`, `prepareLiquidatorLiquidate`, `prepareLiquidatorLiquidateMulti`, `prepareLiquidatorLiquidateBadDebt`, `prepareLiquidatorResolveBadDebtWithReserve`, `prepareOracleConfigurePositionsBatch`, `prepareOracleConfigurePosition`, `prepareOracleSetUpdater`, `prepareOracleSetPositionEarlyClosureWindowOverride`, `prepareOracleClearPositionEarlyClosureWindowOverride`, `prepareOracleInvalidatePosition`, `prepareOracleValidatePosition`, `prepareOracleRegisterNegRiskMarketPositions`, `prepareOracleOverrideNegRiskMarketPositions`, `prepareOracleConfigureOppositePositions`, `prepareOracleConfigureOppositePositionsBatch`, `prepareOracleConfigureNegRiskPositionsBatch`, `prepareOracleUpdatePrices`, `prepareOracleUpdatePrice`, `prepareOracleFinalizePosition`, `prepareOracleUnfinalizePosition`, `prepareOracleResolvePositionEarly`, `prepareOracleBatchFinalizePositions`, `prepareOracleBatchResolvePositionsEarly`, `prepareOracleSetResolutionPrice`, `planOracleSeed`, `seedOracleFromJson`, `seedOracleFromJsonFiles`, `prepareOracleSeedPlan`, `executeOracleSeedPlan`, `buildNonce`, `splitNonce`, `readOracleUpdaterRouterLaneSeq`, `readOracleUpdaterRouterNonce`, `toOracleUpdaterRouterTypedMessage`, `computeOracleUpdaterDigest`, `signOracleUpdaterRouterUpdate`, `prepareOracleUpdaterRouterUpdatePricesWithSig`, `preparePoolDeposit`, `preparePoolMint`, `preparePoolWithdraw`, `preparePoolRedeem`, `readCanCall`, `assertCanCallImmediate`, `sendTx`, `selectorFromSignature`, `chunk`, `multicallChunks`, `getAddressBook`, `getVarlaContracts`, `getRequiredVarlaContracts`, `getErc20`, `getErc1155`, `getErc4626`, `decodeEventLogs`, `getEventLogsChunked`, `syncOracleRegistryViaEvents`, `getRecentEvents`, `formatWad`, `formatBps`, `formatPriceE8`, `parseUnits`, `parseWad`, `isSupportedChain`, `assertSupportedChain`, `getChainMeta`, `readAccessManagerBasics`, `readRoleSummary`, `readTargetConfig`, `readHasRole`, `readManyHasRole`, `readManyTargetFunctionRoles`, `readManyTargetConfigs`, `readAdapterInfo`, `readInterestRateStrategyBasics`, `getInterestRateStrategyFromPool`, `readProxyAdminPaused`, `previewCoreDeposit`, `readRepayTiming`, `readPositionCount`, `readOracleGuardsStatus`, `readAccountSnapshot`, `readCoreAddresses`, `readMaxPositionsConfig`, `readAccountPositionsFull`, `readPositionBalances`, `readBorrowerState`, `readPortfolioValue`, `readBorrowers`, `readCoreGlobalDebt`, `readPositionLiquidationConfigOverride`, `readPositionBalance`, `readAccountPositions`, `readBorrowersPage`, `readManyAccountSnapshots`, `readHealthFactor`, `readLiquidationConfig`, `readDefaultLtvConfig`, `readTieredLtvConfig`, `readTierLiquidationConfig`, `readLiquidationParamsForPosition`, `readPositionLtvOverride`, `readLtvForPosition`, `readLiquidationBonusBps`, `readManyLiquidationBonusBps`, `readWalletPositionIds`, `previewBorrow`, `previewRepay`, `readBorrowLimits`, `readManyBorrowLimits`, `readHypotheticalBorrowCapacity`, `computeLiquidationPrice`, `readLiquidationPrice`, `readLenderSnapshot`, `readMaxWithdraw`, `readMaxRedeem`, `readLiquidatorBasics`, `readCanLiquidate`, `readPreviewLiquidation`, `readCalculateLiquidationBonus`, `readBadDebtStatus`, `readMergeLiquidatorBasics`, `readConvertLiquidatorBasics`, `rankPositionsForLiquidation`, `readLiquidationCandidates`, `readOracleRegistry`, `readOracleRegistryPage`, `readOracleFinalizationStatus`, `readOracleConfig`, `readOracleCollateralStatus`, `readTryGetPrice`, `readOraclePriceData`, `readOracleBasics`, `readOracleTiming`, `readConfiguredPositionIds`, `readNegRiskMarketPositionIds`, `readRiskTier`, `readSpotPrice`, `readTwap`, `readPrice`, `readLiquidity`, `readPositionSnapshot`, `readManyPositionSnapshots`, `readOraclePositionMeta`, `readManyOraclePositionMeta`, `hydrateOraclePositionIds`, `readPoolSnapshot`, `readPoolCaps`, `readPoolAccounting`, `readPoolRates`, `readPoolSharePrice`, `readPoolHealthScore`, `readPoolDebtState`, `readPoolCoreAddress`, `readSystemSnapshot`
|
|
170
|
+
**Functions:** `prepareCoreSetDefaultLtvConfig`, `prepareCoreSetLiquidationConfig`, `prepareCoreSetTierLiquidationConfig`, `prepareCoreSetMaxPositions`, `prepareCoreSetMaxPositionsBounds`, `prepareCoreSetOracle`, `prepareCoreSetPositionLtvOverride`, `prepareCoreClearPositionLtvOverride`, `prepareCoreSetPositionLiquidationConfigOverride`, `prepareCoreClearPositionLiquidationConfigOverride`, `preparePoolSetDepositCap`, `preparePoolSetBorrowCap`, `preparePoolWithdrawReserve`, `preparePoolSetInterestRateStrategy`, `prepareOracleSetMaxStaleness`, `prepareOracleSetLiquidationGracePeriod`, `prepareOracleSetDefaultEarlyClosureWindow`, `prepareStrategySetPool`, `prepareStrategySetRateParams`, `prepareOracleUpdaterRouterSetPublisher`, `prepareCoreDeposit`, `prepareCoreWithdraw`, `prepareCoreBorrow`, `prepareCoreRepay`, `prepareErc20Approve`, `prepareErc1155SetApprovalForAll`, `prepareLiquidatorLiquidate`, `prepareLiquidatorLiquidateMulti`, `prepareLiquidatorLiquidateBadDebt`, `prepareLiquidatorResolveBadDebtWithReserve`, `prepareOracleConfigurePositionsBatch`, `prepareOracleConfigurePosition`, `prepareOracleSetUpdater`, `prepareOracleSetPositionEarlyClosureWindowOverride`, `prepareOracleClearPositionEarlyClosureWindowOverride`, `prepareOracleInvalidatePosition`, `prepareOracleValidatePosition`, `prepareOracleRegisterNegRiskMarketPositions`, `prepareOracleOverrideNegRiskMarketPositions`, `prepareOracleConfigureOppositePositions`, `prepareOracleConfigureOppositePositionsBatch`, `prepareOracleConfigureNegRiskPositionsBatch`, `prepareOracleUpdatePrices`, `prepareOracleUpdatePrice`, `prepareOracleFinalizePosition`, `prepareOracleUnfinalizePosition`, `prepareOracleResolvePositionEarly`, `prepareOracleBatchFinalizePositions`, `prepareOracleBatchResolvePositionsEarly`, `prepareOracleSetResolutionPrice`, `planOracleSeed`, `seedOracleFromJson`, `seedOracleFromJsonFiles`, `prepareOracleSeedPlan`, `executeOracleSeedPlan`, `buildNonce`, `splitNonce`, `readOracleUpdaterRouterLaneSeq`, `readOracleUpdaterRouterNonce`, `toOracleUpdaterRouterTypedMessage`, `computeOracleUpdaterDigest`, `signOracleUpdaterRouterUpdate`, `prepareOracleUpdaterRouterUpdatePricesWithSig`, `preparePoolDeposit`, `preparePoolMint`, `preparePoolWithdraw`, `preparePoolRedeem`, `readCanCall`, `assertCanCallImmediate`, `sendTx`, `selectorFromSignature`, `chunk`, `multicallChunks`, `getAddressBook`, `getVarlaContracts`, `getRequiredVarlaContracts`, `getErc20`, `getErc1155`, `getErc4626`, `decodeEventLogs`, `getEventLogsChunked`, `syncOracleRegistryViaEvents`, `getRecentEvents`, `formatWad`, `formatBps`, `formatPriceE8`, `parseUnits`, `parseWad`, `isSupportedChain`, `assertSupportedChain`, `getChainMeta`, `encodeSafeMultiSend`, `encodeSafeMultiSendCallOnly`, `readAccessManagerBasics`, `readRoleSummary`, `readTargetConfig`, `readHasRole`, `readManyHasRole`, `readManyTargetFunctionRoles`, `readManyTargetConfigs`, `readAdapterInfo`, `readInterestRateStrategyBasics`, `getInterestRateStrategyFromPool`, `readProxyAdminPaused`, `previewCoreDeposit`, `readRepayTiming`, `readPositionCount`, `readOracleGuardsStatus`, `readAccountSnapshot`, `readCoreAddresses`, `readMaxPositionsConfig`, `readAccountPositionsFull`, `readPositionBalances`, `readBorrowerState`, `readPortfolioValue`, `readBorrowers`, `readCoreGlobalDebt`, `readPositionLiquidationConfigOverride`, `readPositionBalance`, `readAccountPositions`, `readBorrowersPage`, `readManyAccountSnapshots`, `readHealthFactor`, `readLiquidationConfig`, `readDefaultLtvConfig`, `readTieredLtvConfig`, `readTierLiquidationConfig`, `readLiquidationParamsForPosition`, `readPositionLtvOverride`, `readLtvForPosition`, `readLiquidationBonusBps`, `readManyLiquidationBonusBps`, `readWalletPositionIds`, `previewBorrow`, `previewRepay`, `readBorrowLimits`, `readManyBorrowLimits`, `readHypotheticalBorrowCapacity`, `computeLiquidationPrice`, `readLiquidationPrice`, `readLenderSnapshot`, `readMaxWithdraw`, `readMaxRedeem`, `readLiquidatorBasics`, `readCanLiquidate`, `readPreviewLiquidation`, `readCalculateLiquidationBonus`, `readBadDebtStatus`, `readMergeLiquidatorBasics`, `readConvertLiquidatorBasics`, `rankPositionsForLiquidation`, `readLiquidationCandidates`, `readOracleRegistry`, `readOracleRegistryPage`, `readOracleFinalizationStatus`, `readOracleConfig`, `readOracleCollateralStatus`, `readTryGetPrice`, `readOraclePriceData`, `readOracleBasics`, `readOracleTiming`, `readConfiguredPositionIds`, `readNegRiskMarketPositionIds`, `readRiskTier`, `readSpotPrice`, `readTwap`, `readPrice`, `readLiquidity`, `readPositionSnapshot`, `readManyPositionSnapshots`, `readOraclePositionMeta`, `readManyOraclePositionMeta`, `hydrateOraclePositionIds`, `readPoolSnapshot`, `readPoolCaps`, `readPoolAccounting`, `readPoolRates`, `readPoolSharePrice`, `readPoolHealthScore`, `readPoolDebtState`, `readPoolCoreAddress`, `readSystemSnapshot`
|
|
121
171
|
|
|
122
|
-
**Types:** `StrategyRateParams`, `SimulatedTx`, `MarketConfigItem`, `OraclePriceUpdateItem`, `OracleLikeForSeeding`, `OracleSeedPlan`, `OracleSeedExecResult`, `MarketConfigItemJson`, `OppositePairItemJson`, `NegRiskMarketItemJson`, `SeedOracleFromJsonResult`, `OracleUpdaterRouterUpdate`, `AccessManagerCanCallLike`, `CanCallResult`, `MulticallChunkOptions`, `ReadonlyContract`, `VarlaContracts`, `GetVarlaContractsParams`, `DecodedEvent`, `GetEventLogsChunkedParams`, `OracleRegistryEntry`, `SyncOracleRegistryViaEventsParams`, `GetRecentEventsParams`, `VarlaChainKey`, `StablecoinKind`, `CollateralMeta`, `ChainMeta`, `ChainKey`, `AddressBook`, `ReadAccessManagerBasics`, `ReadManyHasRoleResult`, `ReadManyTargetFunctionRolesResult`, `ReadManyTargetConfigsResult`, `ReadAdapterInfo`, `InterestRateParams`, `DepositBlockReason`, `PreviewCoreDepositItem`, `PreviewCoreDeposit`, `ReadAccountSnapshot`, `ReadRepayTiming`, `ReadPositionCount`, `ReadOracleGuardsStatus`, `ReadCoreAddresses`, `ReadMaxPositionsConfig`, `ReadAccountPositionsFull`, `ReadPositionBalances`, `ReadBorrowerState`, `ReadPortfolioValue`, `ReadCoreGlobalDebt`, `ReadPositionLiquidationConfigOverride`, `ReadBorrowersPage`, `ReadHealthFactor`, `ReadLiquidationConfig`, `ReadDefaultLtvConfig`, `ReadTieredLtvConfig`, `ReadTierLiquidationConfig`, `ReadLiquidationParamsForPosition`, `ReadPositionLtvOverride`, `ReadManyLiquidationBonusBpsRow`, `ReadBorrowLimits`, `ReadWalletPositionIds`, `ReadHypotheticalBorrowCapacity`, `PreviewBorrow`, `PreviewRepay`, `ComputeLiquidationPriceResult`, `ReadLiquidationPrice`, `ReadLenderSnapshot`, `ReadLiquidatorBasics`, `ReadCanLiquidate`, `ReadPreviewLiquidation`, `ReadBadDebtStatus`, `LiquidationCandidate`, `ReadLiquidationCandidates`, `ReadOracleRegistryParams`, `ReadOracleRegistryPage`, `ReadOracleConfig`, `ReadOracleFinalizationStatus`, `ReadOracleCollateralStatus`, `ReadTryGetPrice`, `ReadOraclePriceData`, `ReadOracleBasics`, `ReadOracleTiming`, `ReadPositionSnapshot`, `ReadOraclePositionMeta`, `ReadPoolSnapshot`, `ReadPoolDebtState`, `ReadPoolCaps`, `ReadPoolAccounting`, `ReadPoolRates`, `ReadPoolSharePrice`, `ReadPoolHealthScore`, `ReadSystemSnapshot`
|
|
172
|
+
**Types:** `StrategyRateParams`, `SimulatedTx`, `MarketConfigItem`, `OraclePriceUpdateItem`, `OracleLikeForSeeding`, `OracleSeedPlan`, `OracleSeedExecResult`, `MarketConfigItemJson`, `OppositePairItemJson`, `NegRiskMarketItemJson`, `SeedOracleFromJsonResult`, `OracleUpdaterRouterUpdate`, `AccessManagerCanCallLike`, `CanCallResult`, `MulticallChunkOptions`, `ReadonlyContract`, `VarlaContracts`, `GetVarlaContractsParams`, `DecodedEvent`, `GetEventLogsChunkedParams`, `OracleRegistryEntry`, `SyncOracleRegistryViaEventsParams`, `GetRecentEventsParams`, `VarlaChainKey`, `StablecoinKind`, `CollateralMeta`, `ChainMeta`, `SafeOperation`, `SafeMultiSendTx`, `SafeMultiSendInput`, `SafeMultiSendResult`, `ChainKey`, `AddressBook`, `ReadAccessManagerBasics`, `ReadManyHasRoleResult`, `ReadManyTargetFunctionRolesResult`, `ReadManyTargetConfigsResult`, `ReadAdapterInfo`, `InterestRateParams`, `DepositBlockReason`, `PreviewCoreDepositItem`, `PreviewCoreDeposit`, `ReadAccountSnapshot`, `ReadRepayTiming`, `ReadPositionCount`, `ReadOracleGuardsStatus`, `ReadCoreAddresses`, `ReadMaxPositionsConfig`, `ReadAccountPositionsFull`, `ReadPositionBalances`, `ReadBorrowerState`, `ReadPortfolioValue`, `ReadCoreGlobalDebt`, `ReadPositionLiquidationConfigOverride`, `ReadBorrowersPage`, `ReadHealthFactor`, `ReadLiquidationConfig`, `ReadDefaultLtvConfig`, `ReadTieredLtvConfig`, `ReadTierLiquidationConfig`, `ReadLiquidationParamsForPosition`, `ReadPositionLtvOverride`, `ReadManyLiquidationBonusBpsRow`, `ReadBorrowLimits`, `ReadWalletPositionIds`, `ReadHypotheticalBorrowCapacity`, `PreviewBorrow`, `PreviewRepay`, `ComputeLiquidationPriceResult`, `ReadLiquidationPrice`, `ReadLenderSnapshot`, `ReadLiquidatorBasics`, `ReadCanLiquidate`, `ReadPreviewLiquidation`, `ReadBadDebtStatus`, `LiquidationCandidate`, `ReadLiquidationCandidates`, `ReadOracleRegistryParams`, `ReadOracleRegistryPage`, `ReadOracleConfig`, `ReadOracleFinalizationStatus`, `ReadOracleCollateralStatus`, `ReadTryGetPrice`, `ReadOraclePriceData`, `ReadOracleBasics`, `ReadOracleTiming`, `ReadPositionSnapshot`, `ReadOraclePositionMeta`, `ReadPoolSnapshot`, `ReadPoolDebtState`, `ReadPoolCaps`, `ReadPoolAccounting`, `ReadPoolRates`, `ReadPoolSharePrice`, `ReadPoolHealthScore`, `ReadSystemSnapshot`
|
|
123
173
|
|
|
124
|
-
**Constants:** `ORACLE_UPDATER_ROUTER_EIP712`, `ORACLE_UPDATER_ROUTER_TYPES`, `UPDATE_TYPEHASH`, `ORACLE_SIGS`, `ORACLE_EVENTS`, `CORE_EVENTS`, `POOL_EVENTS`, `SUPPORTED_CHAINS`
|
|
174
|
+
**Constants:** `ORACLE_UPDATER_ROUTER_EIP712`, `ORACLE_UPDATER_ROUTER_TYPES`, `UPDATE_TYPEHASH`, `ORACLE_SIGS`, `ORACLE_EVENTS`, `CORE_EVENTS`, `POOL_EVENTS`, `SUPPORTED_CHAINS`, `SAFE_MULTISEND_ADDRESS`, `SAFE_MULTISEND_CALL_ONLY_ADDRESS`
|
|
125
175
|
|
|
126
176
|
### `@varla/sdk/contracts` (6 functions, 3 types)
|
|
127
177
|
|
|
@@ -174,4 +224,12 @@ if (decoded) console.log(formatVarlaError(decoded));
|
|
|
174
224
|
**Functions:** `extractRevertData`, `decodeVarlaError`, `isVarlaError`, `formatVarlaError`, `tryFormatVarlaError`, `getAllVarlaErrorNames`, `getVarlaErrorSelectors`
|
|
175
225
|
|
|
176
226
|
**Types:** `DecodedVarlaError`
|
|
227
|
+
|
|
228
|
+
### `@varla/sdk/safe` (2 functions, 4 types, 2 constants)
|
|
229
|
+
|
|
230
|
+
**Functions:** `encodeSafeMultiSend`, `encodeSafeMultiSendCallOnly`
|
|
231
|
+
|
|
232
|
+
**Types:** `SafeOperation`, `SafeMultiSendTx`, `SafeMultiSendInput`, `SafeMultiSendResult`
|
|
233
|
+
|
|
234
|
+
**Constants:** `SAFE_MULTISEND_ADDRESS`, `SAFE_MULTISEND_CALL_ONLY_ADDRESS`
|
|
177
235
|
<!-- END GENERATED:EXPORTS -->
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @varla-xyz/protocol
|
|
2
2
|
|
|
3
|
+
## 2.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f3a722e: Add Safe MultiSend utilities and exports to build batched transactions for Gnosis Safe workflows.
|
|
8
|
+
|
|
9
|
+
- Export new Safe MultiSend module with encoder functions, types, and constants for canonical MultiSend addresses
|
|
10
|
+
- Provide helpers to encode standard and call-only MultiSend batches from prepared requests or raw transactions
|
|
11
|
+
|
|
3
12
|
## 2.10.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@ npm i @varla/sdk
|
|
|
34
34
|
| `@varla/sdk/errors` | Custom error decoding across all Varla contracts |
|
|
35
35
|
| `@varla/sdk/leverage` | Leverage loop planning, execution, and deleverage |
|
|
36
36
|
| `@varla/sdk/batch` | Multicall chunking utilities for RPC-efficient reads |
|
|
37
|
+
| `@varla/sdk/safe` | Gnosis Safe MultiSend encoding for proxy wallet users |
|
|
37
38
|
| `@varla/sdk/format` | Number formatting (`formatWad`, `formatBps`, `parseUnits`) |
|
|
38
39
|
| `@varla/sdk/types` | Shared types (`ChainKey`, `AddressBook`) |
|
|
39
40
|
|
|
@@ -254,6 +255,78 @@ console.log(plan.steps); // ordered steps: buy → deposit → borrow → buy
|
|
|
254
255
|
|
|
255
256
|
---
|
|
256
257
|
|
|
258
|
+
## Safe / proxy wallet integration
|
|
259
|
+
|
|
260
|
+
Polymarket users hold ERC-1155 positions inside Gnosis Safe proxy wallets. The `@varla/sdk/safe` subpath provides helpers to batch multiple Varla operations into a single Safe transaction — matching the UX of competitors like Gondor.
|
|
261
|
+
|
|
262
|
+
**Key insight:** Varla contracts already accept calls from any `msg.sender` (EOA or Safe). No contract changes are needed. The SDK helper simply packs multiple `prepare*()` results into the Safe [MultiSend](https://github.com/safe-global/safe-smart-account/blob/main/contracts/libraries/MultiSend.sol) format.
|
|
263
|
+
|
|
264
|
+
### Full example: approve → deposit → borrow in one Safe tx
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
import { encodeSafeMultiSend } from "@varla/sdk/safe";
|
|
268
|
+
import * as actions from "@varla/sdk/actions";
|
|
269
|
+
|
|
270
|
+
const safeAddress = "0x..."; // user's Gnosis Safe address
|
|
271
|
+
|
|
272
|
+
// 1. Prepare each step (simulate against the Safe as msg.sender)
|
|
273
|
+
const approve = await actions.prepareErc1155SetApprovalForAll({
|
|
274
|
+
publicClient: client,
|
|
275
|
+
tokenAddress: ctfAddress,
|
|
276
|
+
account: safeAddress,
|
|
277
|
+
operator: coreAddress,
|
|
278
|
+
approved: true,
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
const deposit = await actions.prepareCoreDeposit({
|
|
282
|
+
publicClient: client,
|
|
283
|
+
coreAddress: c.core.address,
|
|
284
|
+
account: safeAddress,
|
|
285
|
+
positionIds: [positionId],
|
|
286
|
+
amounts: [amount],
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
const borrow = await actions.prepareCoreBorrow({
|
|
290
|
+
publicClient: client,
|
|
291
|
+
coreAddress: c.core.address,
|
|
292
|
+
account: safeAddress,
|
|
293
|
+
amount: borrowAmount,
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
// 2. Encode as a single Safe MultiSend batch
|
|
297
|
+
const batch = encodeSafeMultiSend([approve, deposit, borrow]);
|
|
298
|
+
// batch.to → Safe MultiSend contract address
|
|
299
|
+
// batch.data → encoded multiSend(bytes) calldata
|
|
300
|
+
// batch.value → total ETH value (usually 0n)
|
|
301
|
+
// batch.count → 3
|
|
302
|
+
|
|
303
|
+
// 3. Submit via Safe SDK (or Safe Apps SDK in a dApp)
|
|
304
|
+
const safeTx = await safeSdk.createTransaction({
|
|
305
|
+
transactions: [{
|
|
306
|
+
to: batch.to,
|
|
307
|
+
data: batch.data,
|
|
308
|
+
value: batch.value.toString(),
|
|
309
|
+
operation: 1, // DELEGATECALL to MultiSend
|
|
310
|
+
}],
|
|
311
|
+
});
|
|
312
|
+
await safeSdk.executeTransaction(safeTx);
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### API
|
|
316
|
+
|
|
317
|
+
| Function | Description |
|
|
318
|
+
| --- | --- |
|
|
319
|
+
| `encodeSafeMultiSend(inputs, options?)` | Encode transactions into MultiSend format. Accepts raw `{ to, data, value }` or `prepare*()` results. |
|
|
320
|
+
| `encodeSafeMultiSendCallOnly(inputs)` | Same but uses the "call only" MultiSend (no DELEGATECALL in sub-txs). |
|
|
321
|
+
| `SAFE_MULTISEND_ADDRESS` | Canonical MultiSend address (`0x3886…`) — same on all EVM chains. |
|
|
322
|
+
| `SAFE_MULTISEND_CALL_ONLY_ADDRESS` | Canonical MultiSend "call only" address (`0x9641…`). |
|
|
323
|
+
|
|
324
|
+
**Optimization:** When the batch contains a single transaction, `encodeSafeMultiSend` returns it directly without a MultiSend wrapper.
|
|
325
|
+
|
|
326
|
+
**Important:** Always pass `account: safeAddress` (not the EOA signer) to `prepare*()` helpers. The contracts track positions and debt under `msg.sender`, which will be the Safe address.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
257
330
|
## Error decoding
|
|
258
331
|
|
|
259
332
|
Automatically decode custom Solidity errors from any Varla contract.
|
|
@@ -98,6 +98,22 @@ export declare const VARLAORACLE_ABI: readonly [{
|
|
|
98
98
|
}];
|
|
99
99
|
readonly name: "InvalidLiquidationGracePeriod";
|
|
100
100
|
readonly type: "error";
|
|
101
|
+
}, {
|
|
102
|
+
readonly inputs: readonly [{
|
|
103
|
+
readonly internalType: "uint8";
|
|
104
|
+
readonly name: "tier";
|
|
105
|
+
readonly type: "uint8";
|
|
106
|
+
}, {
|
|
107
|
+
readonly internalType: "uint256";
|
|
108
|
+
readonly name: "gracePeriod";
|
|
109
|
+
readonly type: "uint256";
|
|
110
|
+
}, {
|
|
111
|
+
readonly internalType: "uint256";
|
|
112
|
+
readonly name: "decayPeriod";
|
|
113
|
+
readonly type: "uint256";
|
|
114
|
+
}];
|
|
115
|
+
readonly name: "InvalidLowLiquidityConfig";
|
|
116
|
+
readonly type: "error";
|
|
101
117
|
}, {
|
|
102
118
|
readonly inputs: readonly [{
|
|
103
119
|
readonly internalType: "uint256";
|
|
@@ -249,6 +265,56 @@ export declare const VARLAORACLE_ABI: readonly [{
|
|
|
249
265
|
}];
|
|
250
266
|
readonly name: "LiquidationGracePeriodUpdated";
|
|
251
267
|
readonly type: "event";
|
|
268
|
+
}, {
|
|
269
|
+
readonly anonymous: false;
|
|
270
|
+
readonly inputs: readonly [{
|
|
271
|
+
readonly indexed: true;
|
|
272
|
+
readonly internalType: "uint8";
|
|
273
|
+
readonly name: "tier";
|
|
274
|
+
readonly type: "uint8";
|
|
275
|
+
}, {
|
|
276
|
+
readonly indexed: false;
|
|
277
|
+
readonly internalType: "uint256";
|
|
278
|
+
readonly name: "oldGracePeriod";
|
|
279
|
+
readonly type: "uint256";
|
|
280
|
+
}, {
|
|
281
|
+
readonly indexed: false;
|
|
282
|
+
readonly internalType: "uint256";
|
|
283
|
+
readonly name: "oldDecayPeriod";
|
|
284
|
+
readonly type: "uint256";
|
|
285
|
+
}, {
|
|
286
|
+
readonly indexed: false;
|
|
287
|
+
readonly internalType: "uint256";
|
|
288
|
+
readonly name: "newGracePeriod";
|
|
289
|
+
readonly type: "uint256";
|
|
290
|
+
}, {
|
|
291
|
+
readonly indexed: false;
|
|
292
|
+
readonly internalType: "uint256";
|
|
293
|
+
readonly name: "newDecayPeriod";
|
|
294
|
+
readonly type: "uint256";
|
|
295
|
+
}];
|
|
296
|
+
readonly name: "LowLiquidityConfigUpdated";
|
|
297
|
+
readonly type: "event";
|
|
298
|
+
}, {
|
|
299
|
+
readonly anonymous: false;
|
|
300
|
+
readonly inputs: readonly [{
|
|
301
|
+
readonly indexed: true;
|
|
302
|
+
readonly internalType: "uint256";
|
|
303
|
+
readonly name: "positionId";
|
|
304
|
+
readonly type: "uint256";
|
|
305
|
+
}, {
|
|
306
|
+
readonly indexed: false;
|
|
307
|
+
readonly internalType: "uint256";
|
|
308
|
+
readonly name: "oldLowLiquiditySince";
|
|
309
|
+
readonly type: "uint256";
|
|
310
|
+
}, {
|
|
311
|
+
readonly indexed: false;
|
|
312
|
+
readonly internalType: "uint256";
|
|
313
|
+
readonly name: "newLowLiquiditySince";
|
|
314
|
+
readonly type: "uint256";
|
|
315
|
+
}];
|
|
316
|
+
readonly name: "LowLiquiditySinceUpdated";
|
|
317
|
+
readonly type: "event";
|
|
252
318
|
}, {
|
|
253
319
|
readonly anonymous: false;
|
|
254
320
|
readonly inputs: readonly [{
|
|
@@ -549,6 +615,26 @@ export declare const VARLAORACLE_ABI: readonly [{
|
|
|
549
615
|
}];
|
|
550
616
|
readonly stateMutability: "view";
|
|
551
617
|
readonly type: "function";
|
|
618
|
+
}, {
|
|
619
|
+
readonly inputs: readonly [];
|
|
620
|
+
readonly name: "MAX_LOW_LIQUIDITY_DECAY_PERIOD";
|
|
621
|
+
readonly outputs: readonly [{
|
|
622
|
+
readonly internalType: "uint256";
|
|
623
|
+
readonly name: "";
|
|
624
|
+
readonly type: "uint256";
|
|
625
|
+
}];
|
|
626
|
+
readonly stateMutability: "view";
|
|
627
|
+
readonly type: "function";
|
|
628
|
+
}, {
|
|
629
|
+
readonly inputs: readonly [];
|
|
630
|
+
readonly name: "MAX_LOW_LIQUIDITY_GRACE_PERIOD";
|
|
631
|
+
readonly outputs: readonly [{
|
|
632
|
+
readonly internalType: "uint256";
|
|
633
|
+
readonly name: "";
|
|
634
|
+
readonly type: "uint256";
|
|
635
|
+
}];
|
|
636
|
+
readonly stateMutability: "view";
|
|
637
|
+
readonly type: "function";
|
|
552
638
|
}, {
|
|
553
639
|
readonly inputs: readonly [];
|
|
554
640
|
readonly name: "MAX_MAX_STALENESS";
|
|
@@ -893,6 +979,34 @@ export declare const VARLAORACLE_ABI: readonly [{
|
|
|
893
979
|
}];
|
|
894
980
|
readonly stateMutability: "view";
|
|
895
981
|
readonly type: "function";
|
|
982
|
+
}, {
|
|
983
|
+
readonly inputs: readonly [{
|
|
984
|
+
readonly internalType: "uint256";
|
|
985
|
+
readonly name: "positionId";
|
|
986
|
+
readonly type: "uint256";
|
|
987
|
+
}];
|
|
988
|
+
readonly name: "getLowLiquidityFactor";
|
|
989
|
+
readonly outputs: readonly [{
|
|
990
|
+
readonly internalType: "uint256";
|
|
991
|
+
readonly name: "";
|
|
992
|
+
readonly type: "uint256";
|
|
993
|
+
}];
|
|
994
|
+
readonly stateMutability: "view";
|
|
995
|
+
readonly type: "function";
|
|
996
|
+
}, {
|
|
997
|
+
readonly inputs: readonly [{
|
|
998
|
+
readonly internalType: "uint256";
|
|
999
|
+
readonly name: "positionId";
|
|
1000
|
+
readonly type: "uint256";
|
|
1001
|
+
}];
|
|
1002
|
+
readonly name: "getLowLiquiditySince";
|
|
1003
|
+
readonly outputs: readonly [{
|
|
1004
|
+
readonly internalType: "uint256";
|
|
1005
|
+
readonly name: "";
|
|
1006
|
+
readonly type: "uint256";
|
|
1007
|
+
}];
|
|
1008
|
+
readonly stateMutability: "view";
|
|
1009
|
+
readonly type: "function";
|
|
896
1010
|
}, {
|
|
897
1011
|
readonly inputs: readonly [{
|
|
898
1012
|
readonly internalType: "uint256";
|
|
@@ -960,7 +1074,7 @@ export declare const VARLAORACLE_ABI: readonly [{
|
|
|
960
1074
|
readonly type: "uint8";
|
|
961
1075
|
}, {
|
|
962
1076
|
readonly internalType: "uint256";
|
|
963
|
-
readonly name: "
|
|
1077
|
+
readonly name: "ltvAdjustmentFactorWad";
|
|
964
1078
|
readonly type: "uint256";
|
|
965
1079
|
}, {
|
|
966
1080
|
readonly internalType: "uint256";
|
|
@@ -1237,6 +1351,24 @@ export declare const VARLAORACLE_ABI: readonly [{
|
|
|
1237
1351
|
}];
|
|
1238
1352
|
readonly stateMutability: "view";
|
|
1239
1353
|
readonly type: "function";
|
|
1354
|
+
}, {
|
|
1355
|
+
readonly inputs: readonly [{
|
|
1356
|
+
readonly internalType: "uint256";
|
|
1357
|
+
readonly name: "";
|
|
1358
|
+
readonly type: "uint256";
|
|
1359
|
+
}];
|
|
1360
|
+
readonly name: "lowLiquidityConfig";
|
|
1361
|
+
readonly outputs: readonly [{
|
|
1362
|
+
readonly internalType: "uint256";
|
|
1363
|
+
readonly name: "gracePeriod";
|
|
1364
|
+
readonly type: "uint256";
|
|
1365
|
+
}, {
|
|
1366
|
+
readonly internalType: "uint256";
|
|
1367
|
+
readonly name: "decayPeriod";
|
|
1368
|
+
readonly type: "uint256";
|
|
1369
|
+
}];
|
|
1370
|
+
readonly stateMutability: "view";
|
|
1371
|
+
readonly type: "function";
|
|
1240
1372
|
}, {
|
|
1241
1373
|
readonly inputs: readonly [];
|
|
1242
1374
|
readonly name: "maxStaleness";
|
|
@@ -1319,6 +1451,24 @@ export declare const VARLAORACLE_ABI: readonly [{
|
|
|
1319
1451
|
readonly outputs: readonly [];
|
|
1320
1452
|
readonly stateMutability: "nonpayable";
|
|
1321
1453
|
readonly type: "function";
|
|
1454
|
+
}, {
|
|
1455
|
+
readonly inputs: readonly [{
|
|
1456
|
+
readonly internalType: "uint8";
|
|
1457
|
+
readonly name: "tier";
|
|
1458
|
+
readonly type: "uint8";
|
|
1459
|
+
}, {
|
|
1460
|
+
readonly internalType: "uint256";
|
|
1461
|
+
readonly name: "gracePeriod";
|
|
1462
|
+
readonly type: "uint256";
|
|
1463
|
+
}, {
|
|
1464
|
+
readonly internalType: "uint256";
|
|
1465
|
+
readonly name: "decayPeriod";
|
|
1466
|
+
readonly type: "uint256";
|
|
1467
|
+
}];
|
|
1468
|
+
readonly name: "setLowLiquidityConfig";
|
|
1469
|
+
readonly outputs: readonly [];
|
|
1470
|
+
readonly stateMutability: "nonpayable";
|
|
1471
|
+
readonly type: "function";
|
|
1322
1472
|
}, {
|
|
1323
1473
|
readonly inputs: readonly [{
|
|
1324
1474
|
readonly internalType: "uint256";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VarlaOracle.d.ts","sourceRoot":"","sources":["../../../src/abi/full/VarlaOracle.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"VarlaOracle.d.ts","sourceRoot":"","sources":["../../../src/abi/full/VarlaOracle.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4jEJ,CAAC"}
|
|
@@ -134,6 +134,27 @@ export const VARLAORACLE_ABI = [
|
|
|
134
134
|
"name": "InvalidLiquidationGracePeriod",
|
|
135
135
|
"type": "error"
|
|
136
136
|
},
|
|
137
|
+
{
|
|
138
|
+
"inputs": [
|
|
139
|
+
{
|
|
140
|
+
"internalType": "uint8",
|
|
141
|
+
"name": "tier",
|
|
142
|
+
"type": "uint8"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"internalType": "uint256",
|
|
146
|
+
"name": "gracePeriod",
|
|
147
|
+
"type": "uint256"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"internalType": "uint256",
|
|
151
|
+
"name": "decayPeriod",
|
|
152
|
+
"type": "uint256"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"name": "InvalidLowLiquidityConfig",
|
|
156
|
+
"type": "error"
|
|
157
|
+
},
|
|
137
158
|
{
|
|
138
159
|
"inputs": [
|
|
139
160
|
{
|
|
@@ -334,6 +355,68 @@ export const VARLAORACLE_ABI = [
|
|
|
334
355
|
"name": "LiquidationGracePeriodUpdated",
|
|
335
356
|
"type": "event"
|
|
336
357
|
},
|
|
358
|
+
{
|
|
359
|
+
"anonymous": false,
|
|
360
|
+
"inputs": [
|
|
361
|
+
{
|
|
362
|
+
"indexed": true,
|
|
363
|
+
"internalType": "uint8",
|
|
364
|
+
"name": "tier",
|
|
365
|
+
"type": "uint8"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"indexed": false,
|
|
369
|
+
"internalType": "uint256",
|
|
370
|
+
"name": "oldGracePeriod",
|
|
371
|
+
"type": "uint256"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"indexed": false,
|
|
375
|
+
"internalType": "uint256",
|
|
376
|
+
"name": "oldDecayPeriod",
|
|
377
|
+
"type": "uint256"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"indexed": false,
|
|
381
|
+
"internalType": "uint256",
|
|
382
|
+
"name": "newGracePeriod",
|
|
383
|
+
"type": "uint256"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"indexed": false,
|
|
387
|
+
"internalType": "uint256",
|
|
388
|
+
"name": "newDecayPeriod",
|
|
389
|
+
"type": "uint256"
|
|
390
|
+
}
|
|
391
|
+
],
|
|
392
|
+
"name": "LowLiquidityConfigUpdated",
|
|
393
|
+
"type": "event"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"anonymous": false,
|
|
397
|
+
"inputs": [
|
|
398
|
+
{
|
|
399
|
+
"indexed": true,
|
|
400
|
+
"internalType": "uint256",
|
|
401
|
+
"name": "positionId",
|
|
402
|
+
"type": "uint256"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
"indexed": false,
|
|
406
|
+
"internalType": "uint256",
|
|
407
|
+
"name": "oldLowLiquiditySince",
|
|
408
|
+
"type": "uint256"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"indexed": false,
|
|
412
|
+
"internalType": "uint256",
|
|
413
|
+
"name": "newLowLiquiditySince",
|
|
414
|
+
"type": "uint256"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"name": "LowLiquiditySinceUpdated",
|
|
418
|
+
"type": "event"
|
|
419
|
+
},
|
|
337
420
|
{
|
|
338
421
|
"anonymous": false,
|
|
339
422
|
"inputs": [
|
|
@@ -714,6 +797,32 @@ export const VARLAORACLE_ABI = [
|
|
|
714
797
|
"stateMutability": "view",
|
|
715
798
|
"type": "function"
|
|
716
799
|
},
|
|
800
|
+
{
|
|
801
|
+
"inputs": [],
|
|
802
|
+
"name": "MAX_LOW_LIQUIDITY_DECAY_PERIOD",
|
|
803
|
+
"outputs": [
|
|
804
|
+
{
|
|
805
|
+
"internalType": "uint256",
|
|
806
|
+
"name": "",
|
|
807
|
+
"type": "uint256"
|
|
808
|
+
}
|
|
809
|
+
],
|
|
810
|
+
"stateMutability": "view",
|
|
811
|
+
"type": "function"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"inputs": [],
|
|
815
|
+
"name": "MAX_LOW_LIQUIDITY_GRACE_PERIOD",
|
|
816
|
+
"outputs": [
|
|
817
|
+
{
|
|
818
|
+
"internalType": "uint256",
|
|
819
|
+
"name": "",
|
|
820
|
+
"type": "uint256"
|
|
821
|
+
}
|
|
822
|
+
],
|
|
823
|
+
"stateMutability": "view",
|
|
824
|
+
"type": "function"
|
|
825
|
+
},
|
|
717
826
|
{
|
|
718
827
|
"inputs": [],
|
|
719
828
|
"name": "MAX_MAX_STALENESS",
|
|
@@ -1165,6 +1274,44 @@ export const VARLAORACLE_ABI = [
|
|
|
1165
1274
|
"stateMutability": "view",
|
|
1166
1275
|
"type": "function"
|
|
1167
1276
|
},
|
|
1277
|
+
{
|
|
1278
|
+
"inputs": [
|
|
1279
|
+
{
|
|
1280
|
+
"internalType": "uint256",
|
|
1281
|
+
"name": "positionId",
|
|
1282
|
+
"type": "uint256"
|
|
1283
|
+
}
|
|
1284
|
+
],
|
|
1285
|
+
"name": "getLowLiquidityFactor",
|
|
1286
|
+
"outputs": [
|
|
1287
|
+
{
|
|
1288
|
+
"internalType": "uint256",
|
|
1289
|
+
"name": "",
|
|
1290
|
+
"type": "uint256"
|
|
1291
|
+
}
|
|
1292
|
+
],
|
|
1293
|
+
"stateMutability": "view",
|
|
1294
|
+
"type": "function"
|
|
1295
|
+
},
|
|
1296
|
+
{
|
|
1297
|
+
"inputs": [
|
|
1298
|
+
{
|
|
1299
|
+
"internalType": "uint256",
|
|
1300
|
+
"name": "positionId",
|
|
1301
|
+
"type": "uint256"
|
|
1302
|
+
}
|
|
1303
|
+
],
|
|
1304
|
+
"name": "getLowLiquiditySince",
|
|
1305
|
+
"outputs": [
|
|
1306
|
+
{
|
|
1307
|
+
"internalType": "uint256",
|
|
1308
|
+
"name": "",
|
|
1309
|
+
"type": "uint256"
|
|
1310
|
+
}
|
|
1311
|
+
],
|
|
1312
|
+
"stateMutability": "view",
|
|
1313
|
+
"type": "function"
|
|
1314
|
+
},
|
|
1168
1315
|
{
|
|
1169
1316
|
"inputs": [
|
|
1170
1317
|
{
|
|
@@ -1254,7 +1401,7 @@ export const VARLAORACLE_ABI = [
|
|
|
1254
1401
|
},
|
|
1255
1402
|
{
|
|
1256
1403
|
"internalType": "uint256",
|
|
1257
|
-
"name": "
|
|
1404
|
+
"name": "ltvAdjustmentFactorWad",
|
|
1258
1405
|
"type": "uint256"
|
|
1259
1406
|
},
|
|
1260
1407
|
{
|
|
@@ -1625,6 +1772,30 @@ export const VARLAORACLE_ABI = [
|
|
|
1625
1772
|
"stateMutability": "view",
|
|
1626
1773
|
"type": "function"
|
|
1627
1774
|
},
|
|
1775
|
+
{
|
|
1776
|
+
"inputs": [
|
|
1777
|
+
{
|
|
1778
|
+
"internalType": "uint256",
|
|
1779
|
+
"name": "",
|
|
1780
|
+
"type": "uint256"
|
|
1781
|
+
}
|
|
1782
|
+
],
|
|
1783
|
+
"name": "lowLiquidityConfig",
|
|
1784
|
+
"outputs": [
|
|
1785
|
+
{
|
|
1786
|
+
"internalType": "uint256",
|
|
1787
|
+
"name": "gracePeriod",
|
|
1788
|
+
"type": "uint256"
|
|
1789
|
+
},
|
|
1790
|
+
{
|
|
1791
|
+
"internalType": "uint256",
|
|
1792
|
+
"name": "decayPeriod",
|
|
1793
|
+
"type": "uint256"
|
|
1794
|
+
}
|
|
1795
|
+
],
|
|
1796
|
+
"stateMutability": "view",
|
|
1797
|
+
"type": "function"
|
|
1798
|
+
},
|
|
1628
1799
|
{
|
|
1629
1800
|
"inputs": [],
|
|
1630
1801
|
"name": "maxStaleness",
|
|
@@ -1731,6 +1902,29 @@ export const VARLAORACLE_ABI = [
|
|
|
1731
1902
|
"stateMutability": "nonpayable",
|
|
1732
1903
|
"type": "function"
|
|
1733
1904
|
},
|
|
1905
|
+
{
|
|
1906
|
+
"inputs": [
|
|
1907
|
+
{
|
|
1908
|
+
"internalType": "uint8",
|
|
1909
|
+
"name": "tier",
|
|
1910
|
+
"type": "uint8"
|
|
1911
|
+
},
|
|
1912
|
+
{
|
|
1913
|
+
"internalType": "uint256",
|
|
1914
|
+
"name": "gracePeriod",
|
|
1915
|
+
"type": "uint256"
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
"internalType": "uint256",
|
|
1919
|
+
"name": "decayPeriod",
|
|
1920
|
+
"type": "uint256"
|
|
1921
|
+
}
|
|
1922
|
+
],
|
|
1923
|
+
"name": "setLowLiquidityConfig",
|
|
1924
|
+
"outputs": [],
|
|
1925
|
+
"stateMutability": "nonpayable",
|
|
1926
|
+
"type": "function"
|
|
1927
|
+
},
|
|
1734
1928
|
{
|
|
1735
1929
|
"inputs": [
|
|
1736
1930
|
{
|