@ember-finance/sdk 2.5.0 → 2.6.0-pre.1
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/src/abis/AtomicLiquidity.json +4050 -0
- package/dist/src/abis/ERC20Token.json +2 -2
- package/dist/src/abis/EmberETHVault.json +279 -5
- package/dist/src/abis/EmberProtocolConfig.json +170 -2
- package/dist/src/abis/EmberVault.json +2 -2
- package/dist/src/abis/EmberVaultMintBurnOFTAdapter.json +43 -2
- package/dist/src/api/v2/apis/accounts-api.d.ts +75 -0
- package/dist/src/api/v2/apis/accounts-api.js +134 -1
- package/dist/src/api/v2/apis/vaults-api.d.ts +16 -4
- package/dist/src/api/v2/apis/vaults-api.js +21 -7
- package/dist/src/api/v2/models/account-holdback.d.ts +103 -0
- package/dist/src/api/v2/models/account-holdback.js +17 -0
- package/dist/src/api/v2/models/account-transaction-transaction-data.d.ts +5 -1
- package/dist/src/api/v2/models/account-transaction.d.ts +5 -0
- package/dist/src/api/v2/models/account-transaction.js +6 -1
- package/dist/src/api/v2/models/chain-vault-details.d.ts +14 -0
- package/dist/src/api/v2/models/escrow-claim-transaction.d.ts +56 -0
- package/dist/src/api/v2/models/escrow-claim-transaction.js +14 -0
- package/dist/src/api/v2/models/evm-atomic-liquidity-lib.d.ts +48 -0
- package/dist/src/api/v2/models/evm-atomic-liquidity-lib.js +14 -0
- package/dist/src/api/v2/models/evm-atomic-vault.d.ts +102 -0
- package/dist/src/api/v2/models/evm-atomic-vault.js +14 -0
- package/dist/src/api/v2/models/evm-contracts.d.ts +16 -0
- package/dist/src/api/v2/models/fee-multiplier-tier.d.ts +30 -0
- package/dist/src/api/v2/models/fee-multiplier-tier.js +14 -0
- package/dist/src/api/v2/models/holdback-release-transaction.d.ts +56 -0
- package/dist/src/api/v2/models/holdback-release-transaction.js +14 -0
- package/dist/src/api/v2/models/index.d.ts +10 -0
- package/dist/src/api/v2/models/index.js +10 -0
- package/dist/src/api/v2/models/instant-withdraw-config.d.ts +109 -0
- package/dist/src/api/v2/models/instant-withdraw-config.js +14 -0
- package/dist/src/api/v2/models/instant-withdraw-transaction.d.ts +74 -0
- package/dist/src/api/v2/models/instant-withdraw-transaction.js +14 -0
- package/dist/src/api/v2/models/instant-withdraw-via-swap-transaction.d.ts +74 -0
- package/dist/src/api/v2/models/instant-withdraw-via-swap-transaction.js +14 -0
- package/dist/src/api/v2/models/supported-ember-vault.d.ts +42 -0
- package/dist/src/api/v2/models/supported-ember-vault.js +14 -0
- package/dist/src/api/v2/models/vault-detail.d.ts +11 -0
- package/dist/src/api/v2/models/vault-detail.js +4 -0
- package/dist/src/atomic/instant-withdraw.d.ts +125 -0
- package/dist/src/atomic/instant-withdraw.js +122 -0
- package/dist/src/ember-vaults.d.ts +2 -1
- package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.d.ts +98 -0
- package/dist/src/evm-vaults/on-chain-calls/atomic-liquidity.js +212 -0
- package/dist/src/evm-vaults/on-chain-calls/index.d.ts +1 -0
- package/dist/src/evm-vaults/on-chain-calls/index.js +1 -0
- package/dist/src/evm-vaults/on-chain-calls/operator.d.ts +10 -0
- package/dist/src/evm-vaults/on-chain-calls/operator.js +28 -0
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.d.ts +109 -0
- package/dist/src/evm-vaults/on-chain-calls/tx-builder.js +281 -0
- package/dist/src/evm-vaults/on-chain-calls/user.d.ts +50 -0
- package/dist/src/evm-vaults/on-chain-calls/user.js +75 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.d.ts +55 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-admin.js +122 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.d.ts +6 -0
- package/dist/src/evm-vaults/on-chain-calls/vault-reader.js +9 -0
- package/dist/src/evm-vaults/utils/deployment-parser.d.ts +8 -0
- package/dist/src/evm-vaults/utils/deployment-parser.js +11 -0
- package/dist/src/sui-vaults/interfaces/index.d.ts +15 -0
- package/dist/src/sui-vaults/on-chain-calls/admin.d.ts +37 -1
- package/dist/src/sui-vaults/on-chain-calls/admin.js +56 -0
- package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.d.ts +62 -0
- package/dist/src/sui-vaults/on-chain-calls/atomic-liquidity.js +174 -0
- package/dist/src/sui-vaults/on-chain-calls/index.d.ts +1 -0
- package/dist/src/sui-vaults/on-chain-calls/index.js +1 -0
- package/dist/src/sui-vaults/on-chain-calls/onchain-calls.d.ts +2 -1
- package/dist/src/sui-vaults/on-chain-calls/operator.d.ts +129 -1
- package/dist/src/sui-vaults/on-chain-calls/operator.js +210 -0
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.d.ts +482 -0
- package/dist/src/sui-vaults/on-chain-calls/tx-builder.js +1430 -0
- package/dist/src/sui-vaults/on-chain-calls/user.d.ts +107 -1
- package/dist/src/sui-vaults/on-chain-calls/user.js +190 -0
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.d.ts +229 -1
- package/dist/src/sui-vaults/on-chain-calls/vault-admin.js +391 -0
- package/dist/src/sui-vaults/on-chain-calls/vault.d.ts +2 -1
- package/dist/src/sui-vaults/utils/common.d.ts +2 -1
- package/dist/src/sui-vaults/utils/deployment-parser.d.ts +12 -0
- package/dist/src/sui-vaults/utils/deployment-parser.js +24 -0
- package/package.json +3 -2
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chain-agnostic Atomic Liquidity Vault (ALV) instant-withdraw quote core (BET-4111).
|
|
3
|
+
*
|
|
4
|
+
* There is NO on-chain preview/quote function on the ALV, so the SDK computes the
|
|
5
|
+
* quote client-side by mirroring the exact contract math. Both chains use the same
|
|
6
|
+
* formulas with a different fixed-point scale, so this module is parameterised by
|
|
7
|
+
* `scale` (EVM = 1e18, Sui = 1e9) and consumed by both the EVM and Sui readers, which
|
|
8
|
+
* supply the live on-chain inputs (rate/TVL/held-value/config) via RPC.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors:
|
|
11
|
+
* - swap-with-holdback: EVM `AtomicLiquidityLib.swapEmberShares`,
|
|
12
|
+
* Sui `atomic_liquidity_vault::swap_ember_shares`
|
|
13
|
+
* - plain instant withdraw: EVM `AtomicLiquidity.instantWithdraw`,
|
|
14
|
+
* Sui `do_instant_withdraw_core`
|
|
15
|
+
* - fixed point: `Math.mul = (a*b)/scale`, `Math.div = (a*scale)/b` (floor)
|
|
16
|
+
* - fee curve: `_lookupFeeMultiplier` (ascending tiers; highest threshold <= utilization wins; 1x default)
|
|
17
|
+
*/
|
|
18
|
+
/** Fixed-point multiply: `(a * b) / scale`, floor (matches Solidity/Move `Math.mul`). */
|
|
19
|
+
export function mulFp(a, b, scale) {
|
|
20
|
+
if (a === 0n || b === 0n)
|
|
21
|
+
return 0n;
|
|
22
|
+
return (a * b) / scale;
|
|
23
|
+
}
|
|
24
|
+
/** Fixed-point divide: `(a * scale) / b`, floor (matches Solidity/Move `Math.div`). */
|
|
25
|
+
export function divFp(a, b, scale) {
|
|
26
|
+
if (b === 0n)
|
|
27
|
+
return 0n;
|
|
28
|
+
return (a * scale) / b;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the fee multiplier from an ascending curve at a given utilization.
|
|
32
|
+
* Returns the multiplier of the highest tier whose `threshold <= utilization`, or `scale`
|
|
33
|
+
* (1x) when the curve is empty / no tier matches. Mirrors `_lookupFeeMultiplier`.
|
|
34
|
+
*/
|
|
35
|
+
export function lookupFeeMultiplier(curve, utilization, scale) {
|
|
36
|
+
let multiplier = scale; // 1x
|
|
37
|
+
for (const tier of curve) {
|
|
38
|
+
if (utilization >= tier.threshold) {
|
|
39
|
+
multiplier = tier.multiplier;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
break; // ascending: once utilization < threshold, all later tiers are higher
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return multiplier;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Quote the EmberShare swap-with-holdback path (source tokenized vault -> ALV).
|
|
49
|
+
* Mirrors `swapEmberShares` exactly: post-swap utilization drives the fee multiplier,
|
|
50
|
+
* `net = gross - fee - holdback` is paid now, the holdback is queued for later release.
|
|
51
|
+
*/
|
|
52
|
+
export function computeSwapQuote(inputs) {
|
|
53
|
+
const { scale, grossAmount, config, feeWaived, holdbackWaived } = inputs;
|
|
54
|
+
const newHeldValue = inputs.currentHeldValue + grossAmount;
|
|
55
|
+
const utilizationAtSwap = inputs.vaultTotalAssets === 0n
|
|
56
|
+
? 0n
|
|
57
|
+
: divFp(newHeldValue, inputs.vaultTotalAssets, scale);
|
|
58
|
+
const feeMultiplier = lookupFeeMultiplier(config.feeMultiplierCurve, utilizationAtSwap, scale);
|
|
59
|
+
const effectiveFeePercentage = mulFp(config.feePercentage, feeMultiplier, scale);
|
|
60
|
+
const feeAmount = feeWaived ? 0n : mulFp(grossAmount, effectiveFeePercentage, scale);
|
|
61
|
+
const holdbackAmount = holdbackWaived
|
|
62
|
+
? 0n
|
|
63
|
+
: mulFp(grossAmount, config.holdbackPercentage, scale);
|
|
64
|
+
// Mirror the contract's underflow guard.
|
|
65
|
+
const instantlyReceive = feeAmount + holdbackAmount > grossAmount
|
|
66
|
+
? 0n
|
|
67
|
+
: grossAmount - feeAmount - holdbackAmount;
|
|
68
|
+
const withinUtilization = utilizationAtSwap <= config.maxUtilizationPercentage;
|
|
69
|
+
const withinEpochCapacity = grossAmount <= inputs.availableCapacity;
|
|
70
|
+
// Absolute held-value cap (0/undefined disables it); mirrors EmberShareHeldValueCapExceeded.
|
|
71
|
+
const maxHeldValueAbsolute = config.maxHeldValueAbsolute ?? 0n;
|
|
72
|
+
const withinHeldValueCap = maxHeldValueAbsolute === 0n || newHeldValue <= maxHeldValueAbsolute;
|
|
73
|
+
// Per-swap dust floor (0/undefined disables it); mirrors SwapAmountTooSmall.
|
|
74
|
+
const minSwapGross = config.minSwapGross ?? 0n;
|
|
75
|
+
const belowMinSwap = minSwapGross > 0n && grossAmount < minSwapGross;
|
|
76
|
+
return {
|
|
77
|
+
grossAmount,
|
|
78
|
+
instantlyReceive,
|
|
79
|
+
lockedAmount: holdbackAmount,
|
|
80
|
+
feeAmount,
|
|
81
|
+
effectiveFeePercentage,
|
|
82
|
+
holdbackPercentage: holdbackWaived ? 0n : config.holdbackPercentage,
|
|
83
|
+
utilizationAtSwap,
|
|
84
|
+
resultingShares: inputs.userShareBalance >= inputs.shareAmount
|
|
85
|
+
? inputs.userShareBalance - inputs.shareAmount
|
|
86
|
+
: 0n,
|
|
87
|
+
belowMinSwap,
|
|
88
|
+
withinHeldValueCap,
|
|
89
|
+
withinCapacity: withinUtilization &&
|
|
90
|
+
withinEpochCapacity &&
|
|
91
|
+
withinHeldValueCap &&
|
|
92
|
+
!belowMinSwap &&
|
|
93
|
+
feeAmount + holdbackAmount <= grossAmount
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Quote the ALV's own plain `instantWithdraw` path (atomic-share holders).
|
|
98
|
+
* Mirrors the contract: `net = gross - fee`, no holdback; capped by
|
|
99
|
+
* `cumulative + shares <= maxInstantWithdrawShares`.
|
|
100
|
+
*/
|
|
101
|
+
export function computePlainInstantQuote(inputs) {
|
|
102
|
+
const { scale, grossAmount, shareAmount } = inputs;
|
|
103
|
+
const feeAmount = mulFp(grossAmount, inputs.instantWithdrawFeePercentage, scale);
|
|
104
|
+
const instantlyReceive = feeAmount > grossAmount ? 0n : grossAmount - feeAmount;
|
|
105
|
+
const withinCapacity = inputs.cumulativeInstantWithdrawShares + shareAmount <=
|
|
106
|
+
inputs.maxInstantWithdrawShares;
|
|
107
|
+
return {
|
|
108
|
+
grossAmount,
|
|
109
|
+
instantlyReceive,
|
|
110
|
+
lockedAmount: 0n,
|
|
111
|
+
feeAmount,
|
|
112
|
+
effectiveFeePercentage: inputs.instantWithdrawFeePercentage,
|
|
113
|
+
holdbackPercentage: 0n,
|
|
114
|
+
utilizationAtSwap: 0n,
|
|
115
|
+
resultingShares: inputs.userShareBalance >= shareAmount
|
|
116
|
+
? inputs.userShareBalance - shareAmount
|
|
117
|
+
: 0n,
|
|
118
|
+
belowMinSwap: false,
|
|
119
|
+
withinHeldValueCap: true,
|
|
120
|
+
withinCapacity
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Signer as SuiSigner
|
|
1
|
+
import { Signer as SuiSigner } from "@firefly-exchange/library-sui";
|
|
2
|
+
import { BaseClient as SuiClient } from "@mysten/sui/client";
|
|
2
3
|
import { Signer as EvmSigner, Provider as EvmProvider } from "ethers";
|
|
3
4
|
import { ISuiDeployment } from "./sui-vaults/interfaces/index.js";
|
|
4
5
|
import { TxBuilder as SuiTxBuilder } from "./sui-vaults/on-chain-calls/index.js";
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Provider } from "ethers";
|
|
2
|
+
import { FeeMultiplierTier, InstantWithdrawQuote } from "../../atomic/instant-withdraw.js";
|
|
3
|
+
/**
|
|
4
|
+
* Read-only views for the Atomic Liquidity Vault (BFE-817/818).
|
|
5
|
+
*
|
|
6
|
+
* Write calls live on the role classes (EVMUserCalls.instantWithdraw /
|
|
7
|
+
* swapEmberShares, EVMOperatorCalls.supplyToStrategy / withdrawFromStrategy /
|
|
8
|
+
* redeemCollectedEmberShares / releaseUsersHoldback, EVMVaultAdminCalls.setStrategy /
|
|
9
|
+
* setEmberShareWhitelist / setSwapWaiver / setMaxInstantWithdrawShares /
|
|
10
|
+
* setInstantWithdrawFeePercentage). Shared lifecycle calls (deposit, redeemShares,
|
|
11
|
+
* cancelPendingWithdrawalRequest, processWithdrawalRequests, collectPlatformFee,
|
|
12
|
+
* updateVaultRate, pause/role/cap setters) reuse the existing EmberVault methods on
|
|
13
|
+
* those same classes.
|
|
14
|
+
*
|
|
15
|
+
* This reader uses an ethers Contract against the bundled AtomicLiquidity ABI and
|
|
16
|
+
* provides typed convenience getters plus a generic `read` for any view not covered.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const reader = new EVMAtomicLiquidityReader(provider);
|
|
21
|
+
* const rate = await reader.rate(vault);
|
|
22
|
+
* const supplied = await reader.getStrategyAssets(vault);
|
|
23
|
+
* const cfg = await reader.read(vault, "emberShareConfigs", [sourceShare]);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class EVMAtomicLiquidityReader {
|
|
27
|
+
provider: Provider;
|
|
28
|
+
constructor(_provider: Provider);
|
|
29
|
+
private contract;
|
|
30
|
+
/** A source EmberShare vault (ERC-4626) for read-only convertToAssets/balanceOf/accounts. */
|
|
31
|
+
private shareContract;
|
|
32
|
+
/** Generic view call for any function on the AtomicLiquidity ABI. */
|
|
33
|
+
read(vaultAddress: string, functionName: string, args?: unknown[]): Promise<unknown>;
|
|
34
|
+
/** roles() -> { admin, operator, rateManager }. */
|
|
35
|
+
roles(vaultAddress: string): Promise<unknown>;
|
|
36
|
+
/** rate() -> { value, maxRateChangePerUpdate, rateUpdateInterval, lastUpdatedAt }. */
|
|
37
|
+
rate(vaultAddress: string): Promise<unknown>;
|
|
38
|
+
/** Current external strategy address (zero if none). */
|
|
39
|
+
strategy(vaultAddress: string): Promise<string>;
|
|
40
|
+
/** Assets currently supplied to the strategy. */
|
|
41
|
+
getStrategyAssets(vaultAddress: string): Promise<bigint>;
|
|
42
|
+
/** Total assets (idle + strategy + outstanding). */
|
|
43
|
+
totalAssets(vaultAddress: string): Promise<bigint>;
|
|
44
|
+
/**
|
|
45
|
+
* Solvency margin (collateral units, signed): `totalAssets - totalLiabilities`. Negative
|
|
46
|
+
* means the vault is under-collateralised. Monitoring view added with the audit fixes.
|
|
47
|
+
*/
|
|
48
|
+
solvencyMargin(vaultAddress: string): Promise<bigint>;
|
|
49
|
+
/** Total non-transferable shares in circulation. */
|
|
50
|
+
totalShares(vaultAddress: string): Promise<bigint>;
|
|
51
|
+
/** Non-transferable share balance of `account`. */
|
|
52
|
+
shareOf(vaultAddress: string, account: string): Promise<bigint>;
|
|
53
|
+
/** Cumulative instant-withdraw shares used. */
|
|
54
|
+
cumulativeInstantWithdrawShares(vaultAddress: string): Promise<bigint>;
|
|
55
|
+
/** Configured instant-withdraw cap (shares). */
|
|
56
|
+
maxInstantWithdrawShares(vaultAddress: string): Promise<bigint>;
|
|
57
|
+
/** Remaining instant-withdraw headroom (shares). */
|
|
58
|
+
availableInstantWithdrawShares(vaultAddress: string): Promise<bigint>;
|
|
59
|
+
/** Per-source-share swap config. */
|
|
60
|
+
emberShareConfigs(vaultAddress: string, share: string): Promise<unknown>;
|
|
61
|
+
/** Remaining swap capacity for a source share in the current epoch. */
|
|
62
|
+
availableEmberShareCapacity(vaultAddress: string, share: string): Promise<bigint>;
|
|
63
|
+
/** Length of the holdback FIFO for a source share. */
|
|
64
|
+
getHoldbackQueueLength(vaultAddress: string, share: string): Promise<bigint>;
|
|
65
|
+
/**
|
|
66
|
+
* Escrowed (deferred) holdback collateral claimable by `account` — accrued when a
|
|
67
|
+
* holdback payout couldn't be transferred to it during `releaseUsersHoldback` (e.g. a
|
|
68
|
+
* token-level blocklist). Claim via user `claimHoldback` / `claimHoldbackFor`. 0 if none.
|
|
69
|
+
*/
|
|
70
|
+
unclaimedHoldback(vaultAddress: string, account: string): Promise<bigint>;
|
|
71
|
+
/** Whether `operation` ("deposits" | "withdrawals" | "privilegedOperations") is paused. */
|
|
72
|
+
pauseStatus(vaultAddress: string, operation: string): Promise<boolean>;
|
|
73
|
+
/** Per-account state (shares + pending withdrawals). */
|
|
74
|
+
getAccountState(vaultAddress: string, account: string): Promise<unknown>;
|
|
75
|
+
/** Convert a share amount to assets at the current rate. */
|
|
76
|
+
convertToAssets(vaultAddress: string, shares: bigint): Promise<bigint>;
|
|
77
|
+
/** Convert an asset amount to shares at the current rate. */
|
|
78
|
+
convertToShares(vaultAddress: string, assets: bigint): Promise<bigint>;
|
|
79
|
+
/** Contract version string. */
|
|
80
|
+
version(vaultAddress: string): Promise<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Live quote for the EmberShare swap-with-holdback "instant withdraw": a holder of a
|
|
83
|
+
* source vault's shares (`share`) swaps `shareAmount` into this ALV, receiving most of
|
|
84
|
+
* the value instantly with a small % held back for later operator release.
|
|
85
|
+
*
|
|
86
|
+
* All dynamic inputs (rate, TVL, held value, epoch capacity, waivers) are read live via
|
|
87
|
+
* RPC. The fee-multiplier curve has no on-chain getter (the public `emberShareConfigs`
|
|
88
|
+
* getter omits the dynamic array), so pass it from bfvs `instantWithdrawConfig`; an empty
|
|
89
|
+
* curve means a 1x multiplier (matches the contract default).
|
|
90
|
+
*/
|
|
91
|
+
previewSwapInstantWithdraw(vaultAddress: string, share: string, shareAmount: bigint, owner: string, feeMultiplierCurve?: FeeMultiplierTier[]): Promise<InstantWithdrawQuote>;
|
|
92
|
+
/**
|
|
93
|
+
* Live quote for the ALV's own plain `instantWithdraw` (atomic-share holders): burn
|
|
94
|
+
* `shareAmount` ALV shares for `gross - fee`, no holdback, capped by
|
|
95
|
+
* `maxInstantWithdrawShares`. All inputs read live via RPC.
|
|
96
|
+
*/
|
|
97
|
+
previewPlainInstantWithdraw(vaultAddress: string, shareAmount: bigint, owner: string): Promise<InstantWithdrawQuote>;
|
|
98
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { Contract } from "ethers";
|
|
2
|
+
import AtomicLiquidityABI from "../../abis/AtomicLiquidity.json" with { type: "json" };
|
|
3
|
+
import EmberVaultABI from "../../abis/EmberVault.json" with { type: "json" };
|
|
4
|
+
import { computeSwapQuote, computePlainInstantQuote } from "../../atomic/instant-withdraw.js";
|
|
5
|
+
/** EVM fixed-point scale (1e18) used by the AtomicLiquidity contract math. */
|
|
6
|
+
const EVM_SCALE = 10n ** 18n;
|
|
7
|
+
/**
|
|
8
|
+
* Read-only views for the Atomic Liquidity Vault (BFE-817/818).
|
|
9
|
+
*
|
|
10
|
+
* Write calls live on the role classes (EVMUserCalls.instantWithdraw /
|
|
11
|
+
* swapEmberShares, EVMOperatorCalls.supplyToStrategy / withdrawFromStrategy /
|
|
12
|
+
* redeemCollectedEmberShares / releaseUsersHoldback, EVMVaultAdminCalls.setStrategy /
|
|
13
|
+
* setEmberShareWhitelist / setSwapWaiver / setMaxInstantWithdrawShares /
|
|
14
|
+
* setInstantWithdrawFeePercentage). Shared lifecycle calls (deposit, redeemShares,
|
|
15
|
+
* cancelPendingWithdrawalRequest, processWithdrawalRequests, collectPlatformFee,
|
|
16
|
+
* updateVaultRate, pause/role/cap setters) reuse the existing EmberVault methods on
|
|
17
|
+
* those same classes.
|
|
18
|
+
*
|
|
19
|
+
* This reader uses an ethers Contract against the bundled AtomicLiquidity ABI and
|
|
20
|
+
* provides typed convenience getters plus a generic `read` for any view not covered.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const reader = new EVMAtomicLiquidityReader(provider);
|
|
25
|
+
* const rate = await reader.rate(vault);
|
|
26
|
+
* const supplied = await reader.getStrategyAssets(vault);
|
|
27
|
+
* const cfg = await reader.read(vault, "emberShareConfigs", [sourceShare]);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export class EVMAtomicLiquidityReader {
|
|
31
|
+
constructor(_provider) {
|
|
32
|
+
this.provider = _provider;
|
|
33
|
+
}
|
|
34
|
+
contract(vaultAddress) {
|
|
35
|
+
return new Contract(vaultAddress, AtomicLiquidityABI.abi, this.provider);
|
|
36
|
+
}
|
|
37
|
+
/** A source EmberShare vault (ERC-4626) for read-only convertToAssets/balanceOf/accounts. */
|
|
38
|
+
shareContract(share) {
|
|
39
|
+
return new Contract(share, EmberVaultABI.abi, this.provider);
|
|
40
|
+
}
|
|
41
|
+
/** Generic view call for any function on the AtomicLiquidity ABI. */
|
|
42
|
+
async read(vaultAddress, functionName, args = []) {
|
|
43
|
+
return this.contract(vaultAddress)[functionName](...args);
|
|
44
|
+
}
|
|
45
|
+
/** roles() -> { admin, operator, rateManager }. */
|
|
46
|
+
async roles(vaultAddress) {
|
|
47
|
+
return this.contract(vaultAddress).roles();
|
|
48
|
+
}
|
|
49
|
+
/** rate() -> { value, maxRateChangePerUpdate, rateUpdateInterval, lastUpdatedAt }. */
|
|
50
|
+
async rate(vaultAddress) {
|
|
51
|
+
return this.contract(vaultAddress).rate();
|
|
52
|
+
}
|
|
53
|
+
/** Current external strategy address (zero if none). */
|
|
54
|
+
async strategy(vaultAddress) {
|
|
55
|
+
return this.contract(vaultAddress).strategy();
|
|
56
|
+
}
|
|
57
|
+
/** Assets currently supplied to the strategy. */
|
|
58
|
+
async getStrategyAssets(vaultAddress) {
|
|
59
|
+
return this.contract(vaultAddress).getStrategyAssets();
|
|
60
|
+
}
|
|
61
|
+
/** Total assets (idle + strategy + outstanding). */
|
|
62
|
+
async totalAssets(vaultAddress) {
|
|
63
|
+
return this.contract(vaultAddress).totalAssets();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Solvency margin (collateral units, signed): `totalAssets - totalLiabilities`. Negative
|
|
67
|
+
* means the vault is under-collateralised. Monitoring view added with the audit fixes.
|
|
68
|
+
*/
|
|
69
|
+
async solvencyMargin(vaultAddress) {
|
|
70
|
+
return this.contract(vaultAddress).solvencyMargin();
|
|
71
|
+
}
|
|
72
|
+
/** Total non-transferable shares in circulation. */
|
|
73
|
+
async totalShares(vaultAddress) {
|
|
74
|
+
return this.contract(vaultAddress).totalShares();
|
|
75
|
+
}
|
|
76
|
+
/** Non-transferable share balance of `account`. */
|
|
77
|
+
async shareOf(vaultAddress, account) {
|
|
78
|
+
return this.contract(vaultAddress).shareOf(account);
|
|
79
|
+
}
|
|
80
|
+
/** Cumulative instant-withdraw shares used. */
|
|
81
|
+
async cumulativeInstantWithdrawShares(vaultAddress) {
|
|
82
|
+
return this.contract(vaultAddress).cumulativeInstantWithdrawShares();
|
|
83
|
+
}
|
|
84
|
+
/** Configured instant-withdraw cap (shares). */
|
|
85
|
+
async maxInstantWithdrawShares(vaultAddress) {
|
|
86
|
+
return this.contract(vaultAddress).maxInstantWithdrawShares();
|
|
87
|
+
}
|
|
88
|
+
/** Remaining instant-withdraw headroom (shares). */
|
|
89
|
+
async availableInstantWithdrawShares(vaultAddress) {
|
|
90
|
+
return this.contract(vaultAddress).availableInstantWithdrawShares();
|
|
91
|
+
}
|
|
92
|
+
/** Per-source-share swap config. */
|
|
93
|
+
async emberShareConfigs(vaultAddress, share) {
|
|
94
|
+
return this.contract(vaultAddress).emberShareConfigs(share);
|
|
95
|
+
}
|
|
96
|
+
/** Remaining swap capacity for a source share in the current epoch. */
|
|
97
|
+
async availableEmberShareCapacity(vaultAddress, share) {
|
|
98
|
+
return this.contract(vaultAddress).availableEmberShareCapacity(share);
|
|
99
|
+
}
|
|
100
|
+
/** Length of the holdback FIFO for a source share. */
|
|
101
|
+
async getHoldbackQueueLength(vaultAddress, share) {
|
|
102
|
+
return this.contract(vaultAddress).getHoldbackQueueLength(share);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Escrowed (deferred) holdback collateral claimable by `account` — accrued when a
|
|
106
|
+
* holdback payout couldn't be transferred to it during `releaseUsersHoldback` (e.g. a
|
|
107
|
+
* token-level blocklist). Claim via user `claimHoldback` / `claimHoldbackFor`. 0 if none.
|
|
108
|
+
*/
|
|
109
|
+
async unclaimedHoldback(vaultAddress, account) {
|
|
110
|
+
return this.contract(vaultAddress).unclaimedHoldback(account);
|
|
111
|
+
}
|
|
112
|
+
/** Whether `operation` ("deposits" | "withdrawals" | "privilegedOperations") is paused. */
|
|
113
|
+
async pauseStatus(vaultAddress, operation) {
|
|
114
|
+
return this.contract(vaultAddress).pauseStatus(operation);
|
|
115
|
+
}
|
|
116
|
+
/** Per-account state (shares + pending withdrawals). */
|
|
117
|
+
async getAccountState(vaultAddress, account) {
|
|
118
|
+
return this.contract(vaultAddress).getAccountState(account);
|
|
119
|
+
}
|
|
120
|
+
/** Convert a share amount to assets at the current rate. */
|
|
121
|
+
async convertToAssets(vaultAddress, shares) {
|
|
122
|
+
return this.contract(vaultAddress).convertToAssets(shares);
|
|
123
|
+
}
|
|
124
|
+
/** Convert an asset amount to shares at the current rate. */
|
|
125
|
+
async convertToShares(vaultAddress, assets) {
|
|
126
|
+
return this.contract(vaultAddress).convertToShares(assets);
|
|
127
|
+
}
|
|
128
|
+
/** Contract version string. */
|
|
129
|
+
async version(vaultAddress) {
|
|
130
|
+
return this.contract(vaultAddress).version();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Live quote for the EmberShare swap-with-holdback "instant withdraw": a holder of a
|
|
134
|
+
* source vault's shares (`share`) swaps `shareAmount` into this ALV, receiving most of
|
|
135
|
+
* the value instantly with a small % held back for later operator release.
|
|
136
|
+
*
|
|
137
|
+
* All dynamic inputs (rate, TVL, held value, epoch capacity, waivers) are read live via
|
|
138
|
+
* RPC. The fee-multiplier curve has no on-chain getter (the public `emberShareConfigs`
|
|
139
|
+
* getter omits the dynamic array), so pass it from bfvs `instantWithdrawConfig`; an empty
|
|
140
|
+
* curve means a 1x multiplier (matches the contract default).
|
|
141
|
+
*/
|
|
142
|
+
async previewSwapInstantWithdraw(vaultAddress, share, shareAmount, owner, feeMultiplierCurve = []) {
|
|
143
|
+
const vault = this.contract(vaultAddress);
|
|
144
|
+
const src = this.shareContract(share);
|
|
145
|
+
const [grossAmount, cfg, vaultTotalAssets, availableCapacity, custodied, hasRedemption, feeWaived, holdbackWaived, userShareBalance] = await Promise.all([
|
|
146
|
+
src.convertToAssets(shareAmount),
|
|
147
|
+
vault.emberShareConfigs(share),
|
|
148
|
+
vault.totalAssets(),
|
|
149
|
+
vault.availableEmberShareCapacity(share),
|
|
150
|
+
src.balanceOf(vaultAddress),
|
|
151
|
+
vault.hasActiveRedemptionHistory(),
|
|
152
|
+
vault.feeWaivedAddresses(owner),
|
|
153
|
+
vault.holdbackWaivedAddresses(owner),
|
|
154
|
+
src.balanceOf(owner)
|
|
155
|
+
]);
|
|
156
|
+
// currentHeldValue mirrors _heldShareValueInCollateral: custodied + pending
|
|
157
|
+
// (pending only when the ALV has an active redemption history), valued via the
|
|
158
|
+
// source vault's convertToAssets.
|
|
159
|
+
let heldShares = custodied;
|
|
160
|
+
if (hasRedemption) {
|
|
161
|
+
// EmberVault.accounts(address) has a single uint256 output
|
|
162
|
+
// (totalPendingWithdrawalShares); ethers v6 returns the bare bigint for
|
|
163
|
+
// single-output calls, not a named struct.
|
|
164
|
+
const pendingWithdrawalShares = (await src.accounts(vaultAddress));
|
|
165
|
+
heldShares += pendingWithdrawalShares;
|
|
166
|
+
}
|
|
167
|
+
const currentHeldValue = heldShares === 0n ? 0n : (await src.convertToAssets(heldShares));
|
|
168
|
+
return computeSwapQuote({
|
|
169
|
+
scale: EVM_SCALE,
|
|
170
|
+
grossAmount,
|
|
171
|
+
shareAmount,
|
|
172
|
+
userShareBalance,
|
|
173
|
+
currentHeldValue,
|
|
174
|
+
vaultTotalAssets,
|
|
175
|
+
availableCapacity,
|
|
176
|
+
config: {
|
|
177
|
+
feePercentage: cfg.feePercentage,
|
|
178
|
+
holdbackPercentage: cfg.holdbackPercentage,
|
|
179
|
+
maxUtilizationPercentage: cfg.maxUtilizationPercentage,
|
|
180
|
+
minSwapGross: cfg.minSwapGross,
|
|
181
|
+
maxHeldValueAbsolute: cfg.maxHeldValueAbsolute,
|
|
182
|
+
feeMultiplierCurve
|
|
183
|
+
},
|
|
184
|
+
feeWaived,
|
|
185
|
+
holdbackWaived
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Live quote for the ALV's own plain `instantWithdraw` (atomic-share holders): burn
|
|
190
|
+
* `shareAmount` ALV shares for `gross - fee`, no holdback, capped by
|
|
191
|
+
* `maxInstantWithdrawShares`. All inputs read live via RPC.
|
|
192
|
+
*/
|
|
193
|
+
async previewPlainInstantWithdraw(vaultAddress, shareAmount, owner) {
|
|
194
|
+
const vault = this.contract(vaultAddress);
|
|
195
|
+
const [grossAmount, instantWithdrawFeePercentage, cumulativeInstantWithdrawShares, maxInstantWithdrawShares, userShareBalance] = await Promise.all([
|
|
196
|
+
vault.convertToAssets(shareAmount),
|
|
197
|
+
vault.instantWithdrawFeePercentage(),
|
|
198
|
+
vault.cumulativeInstantWithdrawShares(),
|
|
199
|
+
vault.maxInstantWithdrawShares(),
|
|
200
|
+
vault.shareOf(owner)
|
|
201
|
+
]);
|
|
202
|
+
return computePlainInstantQuote({
|
|
203
|
+
scale: EVM_SCALE,
|
|
204
|
+
grossAmount,
|
|
205
|
+
shareAmount,
|
|
206
|
+
userShareBalance,
|
|
207
|
+
instantWithdrawFeePercentage,
|
|
208
|
+
cumulativeInstantWithdrawShares,
|
|
209
|
+
maxInstantWithdrawShares
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -99,4 +99,14 @@ export declare class EVMOperatorCalls extends EVMOnChainCalls {
|
|
|
99
99
|
* @returns EvmOnChainCallResponse
|
|
100
100
|
*/
|
|
101
101
|
setDepositAllowList(vaultAddress: string, user: string, status: boolean, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
102
|
+
/** Atomic vault: supply `assets` of idle collateral into the external ERC-4626 strategy. */
|
|
103
|
+
supplyToStrategy(vaultAddress: string, assets: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
104
|
+
/** Atomic vault: withdraw `assets` of collateral back from the strategy into the vault. */
|
|
105
|
+
withdrawFromStrategy(vaultAddress: string, assets: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
106
|
+
/** Atomic vault: submit `amount` of collected source `share` for redemption on the source vault. */
|
|
107
|
+
redeemCollectedEmberShares(vaultAddress: string, share: string, amount: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
108
|
+
/** Atomic vault: release the holdback FIFO for `share` at `unwindingPercentage` (1e18=100%), up to `maxEntries`. */
|
|
109
|
+
releaseUsersHoldback(vaultAddress: string, share: string, unwindingPercentage: NumStr, maxEntries: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
110
|
+
/** Atomic vault: move `amount` of collateral to a registered sub-account. */
|
|
111
|
+
supplyToSubAccount(vaultAddress: string, subAccount: string, amount: NumStr, options?: IEvmCallOptions): Promise<EvmOnChainCallResponse>;
|
|
102
112
|
}
|
|
@@ -136,4 +136,32 @@ export class EVMOperatorCalls extends EVMOnChainCalls {
|
|
|
136
136
|
const txCall = this.txBuilder.setVaultDepositAllowList(vaultAddress, user, status);
|
|
137
137
|
return this.execCall(txCall, options);
|
|
138
138
|
}
|
|
139
|
+
// ============================================
|
|
140
|
+
// Atomic Liquidity Vault — operator actions (BFE-817/818)
|
|
141
|
+
// ============================================
|
|
142
|
+
/** Atomic vault: supply `assets` of idle collateral into the external ERC-4626 strategy. */
|
|
143
|
+
async supplyToStrategy(vaultAddress, assets, options) {
|
|
144
|
+
const txCall = this.txBuilder.atomicSupplyToStrategy(vaultAddress, assets);
|
|
145
|
+
return this.execCall(txCall, options);
|
|
146
|
+
}
|
|
147
|
+
/** Atomic vault: withdraw `assets` of collateral back from the strategy into the vault. */
|
|
148
|
+
async withdrawFromStrategy(vaultAddress, assets, options) {
|
|
149
|
+
const txCall = this.txBuilder.atomicWithdrawFromStrategy(vaultAddress, assets);
|
|
150
|
+
return this.execCall(txCall, options);
|
|
151
|
+
}
|
|
152
|
+
/** Atomic vault: submit `amount` of collected source `share` for redemption on the source vault. */
|
|
153
|
+
async redeemCollectedEmberShares(vaultAddress, share, amount, options) {
|
|
154
|
+
const txCall = this.txBuilder.atomicRedeemCollectedEmberShares(vaultAddress, share, amount);
|
|
155
|
+
return this.execCall(txCall, options);
|
|
156
|
+
}
|
|
157
|
+
/** Atomic vault: release the holdback FIFO for `share` at `unwindingPercentage` (1e18=100%), up to `maxEntries`. */
|
|
158
|
+
async releaseUsersHoldback(vaultAddress, share, unwindingPercentage, maxEntries, options) {
|
|
159
|
+
const txCall = this.txBuilder.atomicReleaseUsersHoldback(vaultAddress, share, unwindingPercentage, maxEntries);
|
|
160
|
+
return this.execCall(txCall, options);
|
|
161
|
+
}
|
|
162
|
+
/** Atomic vault: move `amount` of collateral to a registered sub-account. */
|
|
163
|
+
async supplyToSubAccount(vaultAddress, subAccount, amount, options) {
|
|
164
|
+
const txCall = this.txBuilder.atomicSupplyToSubAccount(vaultAddress, subAccount, amount);
|
|
165
|
+
return this.execCall(txCall, options);
|
|
166
|
+
}
|
|
139
167
|
}
|
|
@@ -280,6 +280,27 @@ export declare class EVMTxBuilder {
|
|
|
280
280
|
* @returns Transaction call object
|
|
281
281
|
*/
|
|
282
282
|
collectPlatformFee(vaultAddress: string, isETHVault?: boolean): ITransactionCall;
|
|
283
|
+
/**
|
|
284
|
+
* EmberETHVault: claim the caller's own escrowed (deferred) ETH withdrawal — accrued
|
|
285
|
+
* when a withdrawal couldn't be sent (receiver rejected the transfer). EmberETHVault only.
|
|
286
|
+
*/
|
|
287
|
+
claimWithdrawal(vaultAddress: string): ITransactionCall;
|
|
288
|
+
/**
|
|
289
|
+
* EmberETHVault: deliver `receiver`'s escrowed ETH withdrawal on their behalf
|
|
290
|
+
* (permissionless — funds can only go to `receiver`). EmberETHVault only.
|
|
291
|
+
*/
|
|
292
|
+
claimWithdrawalFor(vaultAddress: string, receiver: string): ITransactionCall;
|
|
293
|
+
/**
|
|
294
|
+
* EmberETHVault: redirect the CALLER's own escrowed ETH withdrawal to `to`. For a
|
|
295
|
+
* receiver that can transact but can no longer receive ETH; delivers only the
|
|
296
|
+
* caller's own escrow. EmberETHVault only.
|
|
297
|
+
*/
|
|
298
|
+
claimWithdrawalTo(vaultAddress: string, to: string): ITransactionCall;
|
|
299
|
+
/**
|
|
300
|
+
* EmberETHVault: owner recovery of `receiver`'s escrowed ETH to `to` (a permanently
|
|
301
|
+
* unpayable receiver). Owner-only (called directly on the vault). EmberETHVault only.
|
|
302
|
+
*/
|
|
303
|
+
recoverUnclaimedWithdrawal(vaultAddress: string, receiver: string, to: string): ITransactionCall;
|
|
283
304
|
/**
|
|
284
305
|
* Withdraws assets from the vault without redeeming shares (operator only)
|
|
285
306
|
* Used by operators to move funds to sub-accounts for strategy execution
|
|
@@ -501,4 +522,92 @@ export declare class EVMTxBuilder {
|
|
|
501
522
|
* @returns Transaction call object
|
|
502
523
|
*/
|
|
503
524
|
bridgeSend(adapterAddress: string, sendParam: IOFTSendParam, fee: IOFTMessagingFee, refundAddress: string): ITransactionCall;
|
|
525
|
+
private atomicCall;
|
|
526
|
+
/** Claim the caller's own escrowed (deferred) holdback collateral. */
|
|
527
|
+
atomicClaimHoldback(vaultAddress: string): ITransactionCall;
|
|
528
|
+
/** Deliver `recipient`'s escrowed holdback on their behalf (permissionless). */
|
|
529
|
+
atomicClaimHoldbackFor(vaultAddress: string, recipient: string): ITransactionCall;
|
|
530
|
+
/**
|
|
531
|
+
* Redirect the CALLER's own escrowed holdback to `to`. For a recipient that can
|
|
532
|
+
* transact but can no longer receive the collateral token (e.g. token blacklist);
|
|
533
|
+
* moves only the caller's own escrow.
|
|
534
|
+
*/
|
|
535
|
+
atomicClaimHoldbackTo(vaultAddress: string, to: string): ITransactionCall;
|
|
536
|
+
/**
|
|
537
|
+
* Owner recovery of `recipient`'s escrowed holdback to `to` (a permanently unpayable
|
|
538
|
+
* recipient). Owner-only, called directly on the vault (not via protocol config).
|
|
539
|
+
*/
|
|
540
|
+
atomicRecoverUnclaimedHoldback(vaultAddress: string, recipient: string, to: string): ITransactionCall;
|
|
541
|
+
/**
|
|
542
|
+
* Builds an atomic-vault ADMIN call routed through the vault's protocol config. Atomic admin
|
|
543
|
+
* setters are `onlyProtocolConfig`, so they must be invoked on the EmberProtocolConfig (which
|
|
544
|
+
* forwards msg.sender as `caller`) — never on the vault directly. Targets the vault's OWN
|
|
545
|
+
* protocol config (atomic vaults may use a config distinct from the global one). Each config
|
|
546
|
+
* forwarder takes the vault address as its first argument and derives `caller` from msg.sender.
|
|
547
|
+
*/
|
|
548
|
+
private atomicConfigCall;
|
|
549
|
+
/** Instant (capped, fee'd) withdraw of `shares` to `receiver`; auto-pulls from strategy. */
|
|
550
|
+
atomicInstantWithdraw(vaultAddress: string, shares: NumStr, receiver: string): ITransactionCall;
|
|
551
|
+
/** Swap `shareAmount` of a whitelisted source EmberShare into this vault's collateral. */
|
|
552
|
+
atomicSwapEmberShares(vaultAddress: string, share: string, shareAmount: NumStr, receiver: string): ITransactionCall;
|
|
553
|
+
/** Supply `assets` of idle collateral into the external ERC-4626 strategy. */
|
|
554
|
+
atomicSupplyToStrategy(vaultAddress: string, assets: NumStr): ITransactionCall;
|
|
555
|
+
/** Withdraw `assets` of collateral back from the strategy into the vault. */
|
|
556
|
+
atomicWithdrawFromStrategy(vaultAddress: string, assets: NumStr): ITransactionCall;
|
|
557
|
+
/** Submit `amount` of collected source `share` for redemption on the source EmberVault. */
|
|
558
|
+
atomicRedeemCollectedEmberShares(vaultAddress: string, share: string, amount: NumStr): ITransactionCall;
|
|
559
|
+
/** Release the holdback FIFO for `share` at `unwindingPercentage` (1e18 = 100%), up to `maxEntries`. */
|
|
560
|
+
atomicReleaseUsersHoldback(vaultAddress: string, share: string, unwindingPercentage: NumStr, maxEntries: NumStr): ITransactionCall;
|
|
561
|
+
/** Set the external ERC-4626 strategy (address(0) to disable). Drain the old strategy first. */
|
|
562
|
+
atomicSetStrategy(vaultAddress: string, _caller: string, newStrategy: string): ITransactionCall;
|
|
563
|
+
/**
|
|
564
|
+
* Whitelist (or update) a source EmberShare with fee / capacity / holdback / utilization
|
|
565
|
+
* percentages, a per-swap minimum gross floor (`minSwapGross`, 0 disables), and a
|
|
566
|
+
* TVL-independent absolute held-value cap (`maxHeldValueAbsolute`, 0 disables).
|
|
567
|
+
*/
|
|
568
|
+
atomicSetEmberShareWhitelist(vaultAddress: string, _caller: string, share: string, whitelisted: boolean, feePercentage: NumStr, maxCapacityPercentage: NumStr, holdbackPercentage: NumStr, maxUtilizationPercentage: NumStr, minSwapGross: NumStr, maxHeldValueAbsolute: NumStr): ITransactionCall;
|
|
569
|
+
/** Set per-account swap waivers (fee and/or holdback); (false,false) removes them. */
|
|
570
|
+
atomicSetSwapWaiver(vaultAddress: string, _caller: string, account: string, feeWaived: boolean, holdbackWaived: boolean): ITransactionCall;
|
|
571
|
+
/**
|
|
572
|
+
* Add/update (remove=false) or remove (remove=true) a fee-multiplier curve
|
|
573
|
+
* tier for an EmberShare. threshold is a utilization percentage (1e18 = 100%);
|
|
574
|
+
* multiplier is a fee multiplier (1e18 = 1x, must be >= 1e18 on upsert).
|
|
575
|
+
*/
|
|
576
|
+
atomicUpdateEmberShareFeeMultiplierTier(vaultAddress: string, _caller: string, share: string, threshold: NumStr, multiplier: NumStr, remove: boolean): ITransactionCall;
|
|
577
|
+
/** Set the cumulative instant-withdraw cap (in shares). */
|
|
578
|
+
atomicSetMaxInstantWithdrawShares(vaultAddress: string, _caller: string, newMax: NumStr): ITransactionCall;
|
|
579
|
+
/** Set the instant-withdraw fee percentage. */
|
|
580
|
+
atomicSetInstantWithdrawFeePercentage(vaultAddress: string, _caller: string, newFeePercentage: NumStr): ITransactionCall;
|
|
581
|
+
/** Set the platform fee percentage. */
|
|
582
|
+
atomicSetFeePercentage(vaultAddress: string, _caller: string, newFeePercentage: NumStr): ITransactionCall;
|
|
583
|
+
/** Set the maximum TVL. */
|
|
584
|
+
atomicSetMaxTVL(vaultAddress: string, _caller: string, newMaxTVL: NumStr): ITransactionCall;
|
|
585
|
+
/** Set the minimum withdrawable shares. */
|
|
586
|
+
atomicSetMinWithdrawableShares(vaultAddress: string, _caller: string, newMinWithdrawableShares: NumStr): ITransactionCall;
|
|
587
|
+
/** Set the max rate change per update bound. */
|
|
588
|
+
atomicSetMaxRateChangePerUpdate(vaultAddress: string, _caller: string, newMaxRateChangePerUpdate: NumStr): ITransactionCall;
|
|
589
|
+
/** Set the minimum interval between rate updates (ms). */
|
|
590
|
+
atomicSetRateUpdateInterval(vaultAddress: string, _caller: string, newInterval: NumStr): ITransactionCall;
|
|
591
|
+
/** Rename the vault. */
|
|
592
|
+
atomicSetVaultName(vaultAddress: string, _caller: string, newName: string): ITransactionCall;
|
|
593
|
+
/** Set the vault validator contract. */
|
|
594
|
+
atomicSetVaultValidator(vaultAddress: string, _caller: string, validator: string): ITransactionCall;
|
|
595
|
+
/** Add/remove a sub-account. */
|
|
596
|
+
atomicSetSubAccountStatus(vaultAddress: string, _caller: string, account: string, isSubAccount: boolean): ITransactionCall;
|
|
597
|
+
/** Pause/unpause one operation ("deposits" | "withdrawals" | "privilegedOperations"). */
|
|
598
|
+
atomicSetPausedStatus(vaultAddress: string, _caller: string, operation: string, paused: boolean): ITransactionCall;
|
|
599
|
+
/** Move `amount` of collateral to a registered sub-account (operator). */
|
|
600
|
+
atomicSupplyToSubAccount(vaultAddress: string, subAccount: string, amount: NumStr): ITransactionCall;
|
|
601
|
+
/** Rotate the admin role. */
|
|
602
|
+
atomicSetAdmin(vaultAddress: string, _caller: string, newAdmin: string): ITransactionCall;
|
|
603
|
+
/** Rotate the operator role. */
|
|
604
|
+
atomicSetOperator(vaultAddress: string, _caller: string, newOperator: string): ITransactionCall;
|
|
605
|
+
/** Rotate the rate-manager role. */
|
|
606
|
+
atomicSetRateManager(vaultAddress: string, _caller: string, newRateManager: string): ITransactionCall;
|
|
607
|
+
/** Transfer contract ownership (UUPS owner). */
|
|
608
|
+
atomicTransferOwnership(vaultAddress: string, newOwner: string): ITransactionCall;
|
|
609
|
+
/** Renounce ownership (irreversible). */
|
|
610
|
+
atomicRenounceOwnership(vaultAddress: string): ITransactionCall;
|
|
611
|
+
/** Upgrade the implementation and optionally call init data (UUPS). */
|
|
612
|
+
atomicUpgradeToAndCall(vaultAddress: string, newImplementation: string, data: string): ITransactionCall;
|
|
504
613
|
}
|