@ocap/tx-pipeline 1.30.26 → 1.31.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/esm/appchain-sovereign-hub.d.mts +160 -0
- package/esm/appchain-sovereign-hub.mjs +348 -0
- package/esm/arcvault-external-adapter.d.mts +166 -0
- package/esm/arcvault-external-adapter.mjs +376 -0
- package/esm/encrypted-nft-envelope.d.mts +172 -0
- package/esm/encrypted-nft-envelope.mjs +458 -0
- package/esm/evm-simplified-bridge.d.mts +1370 -0
- package/esm/evm-simplified-bridge.mjs +3875 -0
- package/esm/give-to-mint-karma.d.mts +472 -0
- package/esm/give-to-mint-karma.mjs +1057 -0
- package/esm/helpers/replay-guard.d.mts +15 -0
- package/esm/helpers/replay-guard.mjs +23 -0
- package/esm/index.d.mts +10 -5
- package/esm/index.mjs +14 -10
- package/esm/legacy-protocol-sunset.d.mts +251 -0
- package/esm/legacy-protocol-sunset.mjs +1519 -0
- package/esm/library.d.mts +16 -0
- package/esm/library.mjs +17 -0
- package/esm/native-abt-exchange.d.mts +2055 -0
- package/esm/native-abt-exchange.mjs +7250 -0
- package/esm/ofac-screening.d.mts +17 -0
- package/esm/ofac-screening.mjs +39 -0
- package/esm/pipes/anti-land-attack.mjs +1 -1
- package/esm/pipes/decode-itx.mjs +43 -4
- package/esm/pipes/decode-tx.d.mts +2 -3
- package/esm/pipes/decode-tx.mjs +53 -115
- package/esm/pipes/extract-signer.mjs +2 -2
- package/esm/pipes/extract-state.mjs +14 -3
- package/esm/pipes/post-execution-invariant-gate.d.mts +61 -0
- package/esm/pipes/post-execution-invariant-gate.mjs +789 -0
- package/esm/pipes/pre-flight-waf.d.mts +34 -0
- package/esm/pipes/pre-flight-waf.mjs +603 -0
- package/esm/pipes/take-state-snapshot.mjs +3 -2
- package/esm/pipes/update-owner.mjs +39 -4
- package/esm/pipes/verify-account-migration.mjs +14 -4
- package/esm/pipes/verify-blocked.mjs +1 -1
- package/esm/pipes/verify-delegation.d.mts +22 -3
- package/esm/pipes/verify-delegation.mjs +259 -36
- package/esm/pipes/verify-list-size.mjs +1 -1
- package/esm/pipes/verify-multisig-v2.mjs +15 -7
- package/esm/pipes/verify-multisig.mjs +15 -7
- package/esm/pipes/verify-sender.mjs +1 -1
- package/esm/pipes/verify-signature.mjs +35 -6
- package/esm/pipes/verify-signer.mjs +2 -2
- package/esm/pipes/verify-state-diff.mjs +3 -3
- package/esm/pipes/verify-token-access.mjs +1 -1
- package/esm/pipes/verify-token-balance.mjs +13 -5
- package/esm/pipes/verify-transferrable.d.mts +8 -1
- package/esm/pipes/verify-transferrable.mjs +3 -3
- package/esm/pipes/verify-tx-input.mjs +2 -2
- package/esm/pipes/verify-tx-size.mjs +46 -2
- package/esm/pipes/verify-tx.mjs +5 -7
- package/esm/pipes/verify-updater.mjs +1 -1
- package/esm/social-economy-factories.d.mts +346 -0
- package/esm/social-economy-factories.mjs +845 -0
- package/esm/super-suites-foundation.d.mts +513 -0
- package/esm/super-suites-foundation.mjs +1241 -0
- package/esm/transaction-block.d.mts +471 -0
- package/esm/transaction-block.mjs +1906 -0
- package/esm/uniswap-erc7683-solver.d.mts +201 -0
- package/esm/uniswap-erc7683-solver.mjs +321 -0
- package/esm/uniswap-lp-copilot.d.mts +113 -0
- package/esm/uniswap-lp-copilot.mjs +320 -0
- package/esm/uniswap-router.d.mts +335 -0
- package/esm/uniswap-router.mjs +578 -0
- package/esm/uniswap-token-factory-graduation.d.mts +187 -0
- package/esm/uniswap-token-factory-graduation.mjs +426 -0
- package/esm/uniswap-v4-hook.d.mts +173 -0
- package/esm/uniswap-v4-hook.mjs +517 -0
- package/lib/appchain-sovereign-hub.cjs +352 -0
- package/lib/appchain-sovereign-hub.d.cts +160 -0
- package/lib/arcvault-external-adapter.cjs +383 -0
- package/lib/arcvault-external-adapter.d.cts +166 -0
- package/lib/encrypted-nft-envelope.cjs +477 -0
- package/lib/encrypted-nft-envelope.d.cts +172 -0
- package/lib/evm-simplified-bridge.cjs +3943 -0
- package/lib/evm-simplified-bridge.d.cts +1370 -0
- package/lib/give-to-mint-karma.cjs +1084 -0
- package/lib/give-to-mint-karma.d.cts +472 -0
- package/lib/helpers/replay-guard.cjs +27 -0
- package/lib/helpers/replay-guard.d.cts +15 -0
- package/lib/index.cjs +49 -16
- package/lib/index.d.cts +10 -5
- package/lib/legacy-protocol-sunset.cjs +1543 -0
- package/lib/legacy-protocol-sunset.d.cts +251 -0
- package/lib/library.cjs +303 -0
- package/lib/library.d.cts +16 -0
- package/lib/native-abt-exchange.cjs +7322 -0
- package/lib/native-abt-exchange.d.cts +2055 -0
- package/lib/ofac-screening.cjs +42 -0
- package/lib/ofac-screening.d.cts +17 -0
- package/lib/pipes/anti-land-attack.cjs +2 -2
- package/lib/pipes/decode-itx.cjs +43 -4
- package/lib/pipes/decode-itx.d.cts +1 -1
- package/lib/pipes/decode-tx.cjs +52 -116
- package/lib/pipes/decode-tx.d.cts +3 -4
- package/lib/pipes/extract-signer.cjs +2 -2
- package/lib/pipes/extract-state.cjs +14 -3
- package/lib/pipes/post-execution-invariant-gate.cjs +800 -0
- package/lib/pipes/post-execution-invariant-gate.d.cts +61 -0
- package/lib/pipes/pre-flight-waf.cjs +616 -0
- package/lib/pipes/pre-flight-waf.d.cts +34 -0
- package/lib/pipes/take-state-snapshot.cjs +3 -2
- package/lib/pipes/update-owner.cjs +40 -5
- package/lib/pipes/update-owner.d.cts +1 -1
- package/lib/pipes/verify-account-migration.cjs +14 -4
- package/lib/pipes/verify-blocked.cjs +1 -1
- package/lib/pipes/verify-delegation.cjs +259 -36
- package/lib/pipes/verify-delegation.d.cts +22 -3
- package/lib/pipes/verify-list-size.cjs +1 -1
- package/lib/pipes/verify-multisig-v2.cjs +15 -7
- package/lib/pipes/verify-multisig.cjs +15 -7
- package/lib/pipes/verify-sender.cjs +1 -1
- package/lib/pipes/verify-service-fee.d.cts +1 -1
- package/lib/pipes/verify-signature.cjs +35 -6
- package/lib/pipes/verify-signature.d.cts +1 -1
- package/lib/pipes/verify-signer.cjs +2 -2
- package/lib/pipes/verify-state-diff.cjs +4 -4
- package/lib/pipes/verify-token-access.cjs +2 -2
- package/lib/pipes/verify-token-balance.cjs +13 -5
- package/lib/pipes/verify-transferrable.cjs +3 -3
- package/lib/pipes/verify-transferrable.d.cts +8 -1
- package/lib/pipes/verify-tx-input.cjs +3 -3
- package/lib/pipes/verify-tx-size.cjs +46 -2
- package/lib/pipes/verify-tx-size.d.cts +1 -1
- package/lib/pipes/verify-tx.cjs +6 -8
- package/lib/pipes/verify-tx.d.cts +1 -1
- package/lib/pipes/verify-updater.cjs +1 -1
- package/lib/social-economy-factories.cjs +852 -0
- package/lib/social-economy-factories.d.cts +346 -0
- package/lib/super-suites-foundation.cjs +1257 -0
- package/lib/super-suites-foundation.d.cts +513 -0
- package/lib/transaction-block.cjs +1941 -0
- package/lib/transaction-block.d.cts +471 -0
- package/lib/uniswap-erc7683-solver.cjs +327 -0
- package/lib/uniswap-erc7683-solver.d.cts +201 -0
- package/lib/uniswap-lp-copilot.cjs +328 -0
- package/lib/uniswap-lp-copilot.d.cts +113 -0
- package/lib/uniswap-router.cjs +593 -0
- package/lib/uniswap-router.d.cts +335 -0
- package/lib/uniswap-token-factory-graduation.cjs +431 -0
- package/lib/uniswap-token-factory-graduation.d.cts +187 -0
- package/lib/uniswap-v4-hook.cjs +527 -0
- package/lib/uniswap-v4-hook.d.cts +173 -0
- package/package.json +11 -10
- package/esm/helpers/dedup-height.d.mts +0 -16
- package/esm/helpers/dedup-height.mjs +0 -61
- package/lib/helpers/dedup-height.cjs +0 -72
- package/lib/helpers/dedup-height.d.cts +0 -16
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_ofac_screening = require('./ofac-screening.cjs');
|
|
3
|
+
require('./uniswap-router.cjs');
|
|
4
|
+
const require_transaction_block = require('./transaction-block.cjs');
|
|
5
|
+
let _ocap_mcrypto = require("@ocap/mcrypto");
|
|
6
|
+
let _ocap_util = require("@ocap/util");
|
|
7
|
+
let _ocap_util_lib_error = require("@ocap/util/lib/error");
|
|
8
|
+
|
|
9
|
+
//#region src/uniswap-lp-copilot.ts
|
|
10
|
+
/**
|
|
11
|
+
* Uniswap V3 / V4 absolute tick bounds.
|
|
12
|
+
*/
|
|
13
|
+
const MIN_UNISWAP_TICK = -887272;
|
|
14
|
+
const MAX_UNISWAP_TICK = 887272;
|
|
15
|
+
/**
|
|
16
|
+
* Maximum allowed LP rebalance slippage in basis points (1.00% = 100 bps).
|
|
17
|
+
*/
|
|
18
|
+
const MAX_LP_REBALANCE_SLIPPAGE_BPS = 100;
|
|
19
|
+
/**
|
|
20
|
+
* Default minimum cooldown blocks between automated LP rebalances to prevent rebalance storms.
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS = 20;
|
|
23
|
+
/**
|
|
24
|
+
* Default deterministic jitter window (in blocks) to spread multi-agent rebalances across blocks.
|
|
25
|
+
*/
|
|
26
|
+
const DEFAULT_LP_JITTER_WINDOW_BLOCKS = 16;
|
|
27
|
+
const FORBIDDEN_KEYS = new Set([
|
|
28
|
+
"__proto__",
|
|
29
|
+
"constructor",
|
|
30
|
+
"prototype"
|
|
31
|
+
]);
|
|
32
|
+
const CANONICAL_UINT_REGEX = /^\d+$/;
|
|
33
|
+
const BYTES32_HEX_REGEX = /^0x[0-9a-fA-F]{64}$/;
|
|
34
|
+
function assertSafeIdentifier(val, label) {
|
|
35
|
+
if (typeof val !== "string") throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `${label} must be a non-empty string`);
|
|
36
|
+
const trimmed = val.trim();
|
|
37
|
+
if (!trimmed || FORBIDDEN_KEYS.has(trimmed)) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `Unsafe or empty ${label}`);
|
|
38
|
+
return trimmed;
|
|
39
|
+
}
|
|
40
|
+
function parsePositiveBn(val, label) {
|
|
41
|
+
if (typeof val !== "string" || !CANONICAL_UINT_REGEX.test(val)) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `${label} must be a canonical non-negative integer string`);
|
|
42
|
+
const bn = new _ocap_util.BN(val, 10);
|
|
43
|
+
if (bn.lte(new _ocap_util.BN(0))) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `${label} must be strictly positive`);
|
|
44
|
+
return bn;
|
|
45
|
+
}
|
|
46
|
+
function parseNonNegativeBn(val, label) {
|
|
47
|
+
if (typeof val !== "string" || !CANONICAL_UINT_REGEX.test(val)) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `${label} must be a canonical non-negative integer string`);
|
|
48
|
+
return new _ocap_util.BN(val, 10);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Computes a deterministic block slot offset `[0, jitterWindowBlocks - 1]` for a given
|
|
52
|
+
* `contractNftAddress` and volatility epoch so thousands of AIGNE LP Copilots never fire
|
|
53
|
+
* in the exact same block during market spikes (Thundering Herd / Self-DDoS mitigation).
|
|
54
|
+
*/
|
|
55
|
+
function computeDeterministicRebalanceSlot(contractNftAddress, epoch, jitterWindowBlocks = DEFAULT_LP_JITTER_WINDOW_BLOCKS) {
|
|
56
|
+
const safeAddr = assertSafeIdentifier(contractNftAddress, "contractNftAddress");
|
|
57
|
+
if (!Number.isSafeInteger(epoch) || epoch < 0) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "epoch must be a non-negative integer");
|
|
58
|
+
if (!Number.isSafeInteger(jitterWindowBlocks) || jitterWindowBlocks <= 0 || jitterWindowBlocks > 1024) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "jitterWindowBlocks must be an integer between 1 and 1024");
|
|
59
|
+
const digest = _ocap_mcrypto.Hasher.SHA3.hash256(Buffer.from(`${safeAddr}:${epoch}`, "utf8")).replace(/^0x/, "");
|
|
60
|
+
return Number.parseInt(digest.slice(0, 8), 16) % jitterWindowBlocks;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Builds a 100% Non-Custodial `ContractNFT` asset with deterministic on-chain guardrails
|
|
64
|
+
* for managing a single user's Uniswap V3/V4 concentrated liquidity position.
|
|
65
|
+
*
|
|
66
|
+
* Legal & Security Invariants:
|
|
67
|
+
* 1. Strictly prohibits pooled / commingled multi-user funds (`commingledPool: false`, single `ownerDid`).
|
|
68
|
+
* 2. Strictly prohibits `% AUM` management fees, `% Performance` fees, and `% Swap` commissions.
|
|
69
|
+
* 3. Encodes hard declarative guards for `allowedPoolIds`, `maxSlippageBps`, `minTickWidth`,
|
|
70
|
+
* `maxTwapTickDeviation`, `minCooldownBlocks`, and post-rebalance NAV conservation.
|
|
71
|
+
*/
|
|
72
|
+
function buildNonCustodialLpContractNft(spec) {
|
|
73
|
+
if (!spec || typeof spec !== "object") throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "Missing NonCustodialLpGuardSpec");
|
|
74
|
+
if (spec.commingledPool === true) throw new _ocap_util_lib_error.CustomError("ILLEGAL_COMMINGLED_VAULT", "Pooled or commingled multi-investor LP vaults are strictly prohibited (1940 Investment Company Act Safe Harbor)");
|
|
75
|
+
const contractNftAddress = assertSafeIdentifier(spec.contractNftAddress, "contractNftAddress");
|
|
76
|
+
const ownerDid = require_ofac_screening.normalizeScreeningAddress(assertSafeIdentifier(spec.ownerDid, "ownerDid"));
|
|
77
|
+
const copilotAgentDid = require_ofac_screening.normalizeScreeningAddress(assertSafeIdentifier(spec.copilotAgentDid, "copilotAgentDid"));
|
|
78
|
+
const abtTokenAddress = assertSafeIdentifier(spec.abtTokenAddress, "abtTokenAddress");
|
|
79
|
+
const computeFeeRecipientDid = require_ofac_screening.normalizeScreeningAddress(assertSafeIdentifier(spec.computeFeeRecipientDid, "computeFeeRecipientDid"));
|
|
80
|
+
if (Array.isArray(spec.beneficiaryDids)) {
|
|
81
|
+
if (spec.beneficiaryDids.length === 0 || spec.beneficiaryDids.length > 1) throw new _ocap_util_lib_error.CustomError("ILLEGAL_COMMINGLED_VAULT", "Non-custodial LP ContractNFT can only have a single beneficiary equal to ownerDid");
|
|
82
|
+
const singleBeneficiary = require_ofac_screening.normalizeScreeningAddress(assertSafeIdentifier(spec.beneficiaryDids[0], "beneficiaryDid"));
|
|
83
|
+
if (singleBeneficiary !== ownerDid) throw new _ocap_util_lib_error.CustomError("ILLEGAL_COMMINGLED_VAULT", `beneficiaryDid (${singleBeneficiary}) must match ownerDid (${ownerDid})`);
|
|
84
|
+
}
|
|
85
|
+
if (spec.managementFeeBps !== void 0 && spec.managementFeeBps !== 0 || spec.performanceFeeBps !== void 0 && spec.performanceFeeBps !== 0 || spec.swapCommissionBps !== void 0 && spec.swapCommissionBps !== 0) throw new _ocap_util_lib_error.CustomError("ILLEGAL_ADVISORY_FEE_STRUCTURE", "Percentage management fees, performance fees, and swap brokerage commissions are strictly prohibited; use fixed SaaS / AIGNE ABT compute credits only");
|
|
86
|
+
require_ofac_screening.assertNotOfacSanctioned([
|
|
87
|
+
contractNftAddress,
|
|
88
|
+
ownerDid,
|
|
89
|
+
copilotAgentDid,
|
|
90
|
+
abtTokenAddress,
|
|
91
|
+
computeFeeRecipientDid
|
|
92
|
+
], spec.ofacBlocklist);
|
|
93
|
+
if (!Array.isArray(spec.allowedPoolIds) || spec.allowedPoolIds.length === 0 || spec.allowedPoolIds.length > 16) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "allowedPoolIds must contain between 1 and 16 32-byte Pool IDs");
|
|
94
|
+
const normalizedPools = spec.allowedPoolIds.map((pid, idx) => {
|
|
95
|
+
if (typeof pid !== "string" || !BYTES32_HEX_REGEX.test(pid)) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `allowedPoolIds[${idx}] must be a 32-byte 0x hex string`);
|
|
96
|
+
return pid.toLowerCase();
|
|
97
|
+
});
|
|
98
|
+
if (typeof spec.maxSlippageBps !== "number" || !Number.isSafeInteger(spec.maxSlippageBps) || spec.maxSlippageBps <= 0 || spec.maxSlippageBps > MAX_LP_REBALANCE_SLIPPAGE_BPS) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `maxSlippageBps must be an integer between 1 and ${MAX_LP_REBALANCE_SLIPPAGE_BPS}`);
|
|
99
|
+
if (typeof spec.minTickWidth !== "number" || !Number.isSafeInteger(spec.minTickWidth) || spec.minTickWidth <= 0 || spec.minTickWidth > MAX_UNISWAP_TICK - MIN_UNISWAP_TICK) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "minTickWidth must be a positive integer within Uniswap tick bounds");
|
|
100
|
+
if (typeof spec.maxTwapTickDeviation !== "number" || !Number.isSafeInteger(spec.maxTwapTickDeviation) || spec.maxTwapTickDeviation <= 0 || spec.maxTwapTickDeviation > MAX_UNISWAP_TICK - MIN_UNISWAP_TICK) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "maxTwapTickDeviation must be a positive integer within Uniswap tick bounds");
|
|
101
|
+
const minCooldownBlocks = spec.minCooldownBlocks ?? DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS;
|
|
102
|
+
if (typeof minCooldownBlocks !== "number" || !Number.isSafeInteger(minCooldownBlocks) || minCooldownBlocks <= 0) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "minCooldownBlocks must be a positive integer");
|
|
103
|
+
const fixedAbtComputeFeeBn = parseNonNegativeBn(spec.fixedAbtComputeFee, "fixedAbtComputeFee");
|
|
104
|
+
const statementTemplates = [{
|
|
105
|
+
type: "uniswap_v4_rebalance_position",
|
|
106
|
+
typeUrl: "fg:t:uniswap_v4_rebalance_position",
|
|
107
|
+
from: ownerDid,
|
|
108
|
+
itx: {
|
|
109
|
+
owner: ownerDid,
|
|
110
|
+
contractNft: contractNftAddress,
|
|
111
|
+
poolId: "$args.poolId",
|
|
112
|
+
positionId: "$args.positionId",
|
|
113
|
+
newTickLower: "$args.newTickLower",
|
|
114
|
+
newTickUpper: "$args.newTickUpper",
|
|
115
|
+
preRebalanceNavUsd: "$args.preRebalanceNavUsd",
|
|
116
|
+
postRebalanceNavUsd: "$args.postRebalanceNavUsd",
|
|
117
|
+
blockHeight: "$args.currentBlockHeight"
|
|
118
|
+
}
|
|
119
|
+
}];
|
|
120
|
+
if (fixedAbtComputeFeeBn.gt(new _ocap_util.BN(0))) statementTemplates.push({
|
|
121
|
+
type: "transfer_v3",
|
|
122
|
+
typeUrl: "fg:t:transfer_v3",
|
|
123
|
+
from: ownerDid,
|
|
124
|
+
itx: {
|
|
125
|
+
to: computeFeeRecipientDid,
|
|
126
|
+
tokens: [{
|
|
127
|
+
address: abtTokenAddress,
|
|
128
|
+
value: fixedAbtComputeFeeBn.toString(10)
|
|
129
|
+
}],
|
|
130
|
+
data: {
|
|
131
|
+
type: "json",
|
|
132
|
+
value: JSON.stringify({
|
|
133
|
+
consumptiveUse: true,
|
|
134
|
+
serviceType: "aigne_lp_copilot_compute_fee",
|
|
135
|
+
contractNft: contractNftAddress
|
|
136
|
+
})
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
address: contractNftAddress,
|
|
142
|
+
owner: ownerDid,
|
|
143
|
+
data: {
|
|
144
|
+
type: "json",
|
|
145
|
+
value: {
|
|
146
|
+
kind: require_transaction_block.CONTRACT_NFT_KIND,
|
|
147
|
+
name: "AIGNE Non-Custodial Uniswap V4 LP Copilot Guard",
|
|
148
|
+
version: "1.0.0",
|
|
149
|
+
allowedCallers: Array.from(new Set([ownerDid, copilotAgentDid])),
|
|
150
|
+
guards: [
|
|
151
|
+
{
|
|
152
|
+
field: "args.poolId",
|
|
153
|
+
op: "in",
|
|
154
|
+
value: normalizedPools
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
field: "args.slippageBps",
|
|
158
|
+
op: "lte",
|
|
159
|
+
value: spec.maxSlippageBps
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
field: "args.newTickWidth",
|
|
163
|
+
op: "gte",
|
|
164
|
+
value: spec.minTickWidth
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
field: "args.twapTickDeviation",
|
|
168
|
+
op: "lte",
|
|
169
|
+
value: spec.maxTwapTickDeviation
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
field: "args.cooldownElapsedBlocks",
|
|
173
|
+
op: "gte",
|
|
174
|
+
value: minCooldownBlocks
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
statementTemplates
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
guardSpec: {
|
|
181
|
+
...spec,
|
|
182
|
+
contractNftAddress,
|
|
183
|
+
ownerDid,
|
|
184
|
+
copilotAgentDid,
|
|
185
|
+
allowedPoolIds: normalizedPools,
|
|
186
|
+
minCooldownBlocks,
|
|
187
|
+
fixedAbtComputeFee: fixedAbtComputeFeeBn.toString(10),
|
|
188
|
+
abtTokenAddress,
|
|
189
|
+
computeFeeRecipientDid,
|
|
190
|
+
commingledPool: false,
|
|
191
|
+
managementFeeBps: 0,
|
|
192
|
+
performanceFeeBps: 0,
|
|
193
|
+
swapCommissionBps: 0
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Validates and executes a non-custodial LP rebalance proposal through the user's personal `ContractNFT`:
|
|
199
|
+
* 1. Verifies OFAC sanctions screening.
|
|
200
|
+
* 2. Enforces `minCooldownBlocks` and optional deterministic jitter slot to prevent automated rebalance storms.
|
|
201
|
+
* 3. Trips the Volatility Circuit Breaker if `|spotTick - twapTick| > maxTwapTickDeviation`.
|
|
202
|
+
* 4. Enforces post-condition NAV conservation (`postRebalanceNavUsd >= minRequiredPostNavUsd`).
|
|
203
|
+
* 5. Runs a mandatory pre-flight `dryRun: true` check on the overlay before committing.
|
|
204
|
+
*/
|
|
205
|
+
async function executeNonCustodialLpRebalance(input) {
|
|
206
|
+
if (!input || typeof input !== "object" || !input.contractNft) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "Missing LpRebalanceProposalInput");
|
|
207
|
+
const { contractNft } = input;
|
|
208
|
+
const spec = contractNft.guardSpec;
|
|
209
|
+
if (!spec) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "ContractNFT is missing NonCustodialLpGuardSpec");
|
|
210
|
+
const canonicalNft = buildNonCustodialLpContractNft(spec);
|
|
211
|
+
if (contractNft.address !== canonicalNft.address || require_ofac_screening.normalizeScreeningAddress(assertSafeIdentifier(contractNft.owner, "contractNft.owner")) !== canonicalNft.owner || JSON.stringify(contractNft.data) !== JSON.stringify(canonicalNft.data)) throw new _ocap_util_lib_error.CustomError("TAMPERED_CONTRACT_NFT", "ContractNFT payload or ownership has been tampered with and does not match canonical NonCustodialLpGuardSpec");
|
|
212
|
+
const verifiedContractNft = {
|
|
213
|
+
...canonicalNft,
|
|
214
|
+
consumedTime: contractNft.consumedTime
|
|
215
|
+
};
|
|
216
|
+
const verifiedSpec = canonicalNft.guardSpec;
|
|
217
|
+
const callerDid = require_ofac_screening.normalizeScreeningAddress(assertSafeIdentifier(input.callerDid, "callerDid"));
|
|
218
|
+
const positionId = assertSafeIdentifier(input.positionId, "positionId");
|
|
219
|
+
if (typeof input.poolId !== "string" || !BYTES32_HEX_REGEX.test(input.poolId)) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "poolId must be a 32-byte 0x hex string");
|
|
220
|
+
const poolId = input.poolId.toLowerCase();
|
|
221
|
+
const combinedOfac = /* @__PURE__ */ new Set();
|
|
222
|
+
if (verifiedSpec.ofacBlocklist) for (const a of verifiedSpec.ofacBlocklist) combinedOfac.add(a);
|
|
223
|
+
if (input.ofacBlocklist) for (const a of input.ofacBlocklist) combinedOfac.add(a);
|
|
224
|
+
require_ofac_screening.assertNotOfacSanctioned([
|
|
225
|
+
callerDid,
|
|
226
|
+
verifiedContractNft.owner,
|
|
227
|
+
verifiedContractNft.address,
|
|
228
|
+
verifiedSpec.copilotAgentDid,
|
|
229
|
+
verifiedSpec.abtTokenAddress,
|
|
230
|
+
verifiedSpec.computeFeeRecipientDid,
|
|
231
|
+
positionId
|
|
232
|
+
], combinedOfac);
|
|
233
|
+
if (!verifiedSpec.allowedPoolIds.includes(poolId)) throw new _ocap_util_lib_error.CustomError("POOL_NOT_ALLOWLISTED", `Pool ${poolId} is not in ContractNFT allowlist`);
|
|
234
|
+
if (typeof input.currentBlockHeight !== "number" || !Number.isSafeInteger(input.currentBlockHeight) || input.currentBlockHeight <= 0) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "currentBlockHeight must be a positive safe integer");
|
|
235
|
+
const existingPos = typeof input.statedb?.asset?.get === "function" ? await input.statedb.asset.get(positionId) : null;
|
|
236
|
+
if (existingPos) {
|
|
237
|
+
if (typeof existingPos.owner === "string" && require_ofac_screening.normalizeScreeningAddress(existingPos.owner) !== verifiedContractNft.owner) throw new _ocap_util_lib_error.CustomError("FORBIDDEN", `Position ${positionId} is owned by ${existingPos.owner}, not ContractNFT owner ${verifiedContractNft.owner}`);
|
|
238
|
+
}
|
|
239
|
+
const onChainLastHeightRaw = existingPos?.updatedAtBlock ?? existingPos?.lastRebalanceHeight;
|
|
240
|
+
const onChainLastHeight = typeof onChainLastHeightRaw === "number" && Number.isSafeInteger(onChainLastHeightRaw) ? onChainLastHeightRaw : void 0;
|
|
241
|
+
if (input.lastRebalanceHeight !== void 0) {
|
|
242
|
+
if (typeof input.lastRebalanceHeight !== "number" || !Number.isSafeInteger(input.lastRebalanceHeight) || input.lastRebalanceHeight < 0 || input.lastRebalanceHeight > input.currentBlockHeight) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "Invalid lastRebalanceHeight");
|
|
243
|
+
if (onChainLastHeight !== void 0 && input.lastRebalanceHeight < onChainLastHeight) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `Provided lastRebalanceHeight (${input.lastRebalanceHeight}) is older than on-chain position updatedAtBlock (${onChainLastHeight})`);
|
|
244
|
+
}
|
|
245
|
+
const effectiveLastHeight = onChainLastHeight !== void 0 ? Math.max(onChainLastHeight, input.lastRebalanceHeight ?? 0) : input.lastRebalanceHeight;
|
|
246
|
+
const minCooldownBlocks = verifiedSpec.minCooldownBlocks ?? DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS;
|
|
247
|
+
let cooldownElapsedBlocks = minCooldownBlocks;
|
|
248
|
+
if (effectiveLastHeight !== void 0) {
|
|
249
|
+
if (effectiveLastHeight > input.currentBlockHeight) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", "effectiveLastHeight cannot exceed currentBlockHeight");
|
|
250
|
+
cooldownElapsedBlocks = input.currentBlockHeight - effectiveLastHeight;
|
|
251
|
+
if (cooldownElapsedBlocks < minCooldownBlocks) throw new _ocap_util_lib_error.CustomError("REBALANCE_COOLDOWN_ACTIVE", `LP rebalance cooldown active: ${cooldownElapsedBlocks} blocks elapsed since height ${effectiveLastHeight} (minimum required: ${minCooldownBlocks})`);
|
|
252
|
+
}
|
|
253
|
+
const jitterWindow = input.jitterWindowBlocks ?? DEFAULT_LP_JITTER_WINDOW_BLOCKS;
|
|
254
|
+
const epoch = Math.floor(input.currentBlockHeight / jitterWindow);
|
|
255
|
+
const jitterSlot = computeDeterministicRebalanceSlot(verifiedContractNft.address, epoch, jitterWindow);
|
|
256
|
+
if (input.enforceJitterSlot && input.currentBlockHeight % jitterWindow !== jitterSlot) throw new _ocap_util_lib_error.CustomError("JITTER_SLOT_MISMATCH", `Rebalance storm protection: ContractNFT ${verifiedContractNft.address} is assigned to block slot ${jitterSlot} (current slot: ${input.currentBlockHeight % jitterWindow})`);
|
|
257
|
+
if (typeof input.spotTick !== "number" || !Number.isSafeInteger(input.spotTick) || input.spotTick < MIN_UNISWAP_TICK || input.spotTick > MAX_UNISWAP_TICK || typeof input.twapTick !== "number" || !Number.isSafeInteger(input.twapTick) || input.twapTick < MIN_UNISWAP_TICK || input.twapTick > MAX_UNISWAP_TICK) throw new _ocap_util_lib_error.CustomError("INVALID_LP_COPILOT", `spotTick and twapTick must be valid integers within [${MIN_UNISWAP_TICK}, ${MAX_UNISWAP_TICK}]`);
|
|
258
|
+
const twapTickDeviation = Math.abs(input.spotTick - input.twapTick);
|
|
259
|
+
if (twapTickDeviation > verifiedSpec.maxTwapTickDeviation) throw new _ocap_util_lib_error.CustomError("VOLATILITY_CIRCUIT_BREAKER_TRIPPED", `Spot tick (${input.spotTick}) deviates from TWAP tick (${input.twapTick}) by ${twapTickDeviation} ticks (max allowed: ${verifiedSpec.maxTwapTickDeviation})`);
|
|
260
|
+
if (typeof input.newTickLower !== "number" || !Number.isSafeInteger(input.newTickLower) || typeof input.newTickUpper !== "number" || !Number.isSafeInteger(input.newTickUpper) || input.newTickLower < MIN_UNISWAP_TICK || input.newTickUpper > MAX_UNISWAP_TICK || input.newTickLower >= input.newTickUpper) throw new _ocap_util_lib_error.CustomError("INVALID_TICK_RANGE", `Invalid Uniswap tick range [${input.newTickLower}, ${input.newTickUpper}]`);
|
|
261
|
+
const newTickWidth = input.newTickUpper - input.newTickLower;
|
|
262
|
+
if (newTickWidth < verifiedSpec.minTickWidth) throw new _ocap_util_lib_error.CustomError("TICK_WIDTH_TOO_NARROW", `New tick width (${newTickWidth}) is narrower than minTickWidth (${verifiedSpec.minTickWidth})`);
|
|
263
|
+
const preNavBn = parsePositiveBn(input.preRebalanceNavUsd, "preRebalanceNavUsd");
|
|
264
|
+
const postNavBn = parsePositiveBn(input.postRebalanceNavUsd, "postRebalanceNavUsd");
|
|
265
|
+
const bpsDenom = new _ocap_util.BN(1e4);
|
|
266
|
+
const minRequiredPostNavBn = preNavBn.mul(new _ocap_util.BN(1e4 - verifiedSpec.maxSlippageBps)).add(new _ocap_util.BN(9999)).div(bpsDenom);
|
|
267
|
+
if (postNavBn.lt(minRequiredPostNavBn)) throw new _ocap_util_lib_error.CustomError("SLIPPAGE_GUARD_VIOLATED", `Post-rebalance NAV (${postNavBn.toString(10)}) is below minimum required NAV (${minRequiredPostNavBn.toString(10)}) for maxSlippageBps=${verifiedSpec.maxSlippageBps}`);
|
|
268
|
+
const navLossBn = preNavBn.gt(postNavBn) ? preNavBn.sub(postNavBn) : new _ocap_util.BN(0);
|
|
269
|
+
const actualSlippageBps = navLossBn.isZero() ? 0 : navLossBn.mul(bpsDenom).add(preNavBn.sub(new _ocap_util.BN(1))).div(preNavBn).toNumber();
|
|
270
|
+
const contractArgs = {
|
|
271
|
+
poolId,
|
|
272
|
+
positionId,
|
|
273
|
+
newTickLower: input.newTickLower,
|
|
274
|
+
newTickUpper: input.newTickUpper,
|
|
275
|
+
newTickWidth,
|
|
276
|
+
twapTickDeviation,
|
|
277
|
+
cooldownElapsedBlocks,
|
|
278
|
+
slippageBps: actualSlippageBps,
|
|
279
|
+
preRebalanceNavUsd: preNavBn.toString(10),
|
|
280
|
+
postRebalanceNavUsd: postNavBn.toString(10),
|
|
281
|
+
currentBlockHeight: input.currentBlockHeight
|
|
282
|
+
};
|
|
283
|
+
if (!input.dryRun) {
|
|
284
|
+
const preflight = await require_transaction_block.executeContractNft({
|
|
285
|
+
contractAsset: verifiedContractNft,
|
|
286
|
+
caller: callerDid,
|
|
287
|
+
args: contractArgs,
|
|
288
|
+
statedb: input.statedb,
|
|
289
|
+
executeStatement: input.executeStatement,
|
|
290
|
+
dryRun: true
|
|
291
|
+
});
|
|
292
|
+
if (!preflight.ok) return {
|
|
293
|
+
...preflight,
|
|
294
|
+
nextAllowedRebalanceHeight: input.currentBlockHeight,
|
|
295
|
+
jitterSlot
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
const execRes = await require_transaction_block.executeContractNft({
|
|
299
|
+
contractAsset: verifiedContractNft,
|
|
300
|
+
caller: callerDid,
|
|
301
|
+
args: contractArgs,
|
|
302
|
+
statedb: input.statedb,
|
|
303
|
+
executeStatement: input.executeStatement,
|
|
304
|
+
dryRun: input.dryRun
|
|
305
|
+
});
|
|
306
|
+
if (execRes.ok && !input.dryRun && input.positionId && typeof input.statedb?.asset?.update === "function") {
|
|
307
|
+
const existingPos$1 = typeof input.statedb?.asset?.get === "function" ? await input.statedb.asset.get(input.positionId) : null;
|
|
308
|
+
if (existingPos$1 && typeof existingPos$1 === "object") await input.statedb.asset.update(input.positionId, {
|
|
309
|
+
...existingPos$1,
|
|
310
|
+
updatedAtBlock: input.currentBlockHeight
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
...execRes,
|
|
315
|
+
nextAllowedRebalanceHeight: execRes.ok ? input.currentBlockHeight + minCooldownBlocks : input.currentBlockHeight,
|
|
316
|
+
jitterSlot
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
//#endregion
|
|
321
|
+
exports.DEFAULT_LP_JITTER_WINDOW_BLOCKS = DEFAULT_LP_JITTER_WINDOW_BLOCKS;
|
|
322
|
+
exports.DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS = DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS;
|
|
323
|
+
exports.MAX_LP_REBALANCE_SLIPPAGE_BPS = MAX_LP_REBALANCE_SLIPPAGE_BPS;
|
|
324
|
+
exports.MAX_UNISWAP_TICK = MAX_UNISWAP_TICK;
|
|
325
|
+
exports.MIN_UNISWAP_TICK = MIN_UNISWAP_TICK;
|
|
326
|
+
exports.buildNonCustodialLpContractNft = buildNonCustodialLpContractNft;
|
|
327
|
+
exports.computeDeterministicRebalanceSlot = computeDeterministicRebalanceSlot;
|
|
328
|
+
exports.executeNonCustodialLpRebalance = executeNonCustodialLpRebalance;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { ContractNftPayload, StatementExecutor, TransactionBlockResult } from "./transaction-block.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/uniswap-lp-copilot.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Uniswap V3 / V4 absolute tick bounds.
|
|
7
|
+
*/
|
|
8
|
+
declare const MIN_UNISWAP_TICK = -887272;
|
|
9
|
+
declare const MAX_UNISWAP_TICK = 887272;
|
|
10
|
+
/**
|
|
11
|
+
* Maximum allowed LP rebalance slippage in basis points (1.00% = 100 bps).
|
|
12
|
+
*/
|
|
13
|
+
declare const MAX_LP_REBALANCE_SLIPPAGE_BPS = 100;
|
|
14
|
+
/**
|
|
15
|
+
* Default minimum cooldown blocks between automated LP rebalances to prevent rebalance storms.
|
|
16
|
+
*/
|
|
17
|
+
declare const DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS = 20;
|
|
18
|
+
/**
|
|
19
|
+
* Default deterministic jitter window (in blocks) to spread multi-agent rebalances across blocks.
|
|
20
|
+
*/
|
|
21
|
+
declare const DEFAULT_LP_JITTER_WINDOW_BLOCKS = 16;
|
|
22
|
+
interface NonCustodialLpGuardSpec {
|
|
23
|
+
contractNftAddress: string;
|
|
24
|
+
ownerDid: string;
|
|
25
|
+
/** Optional single beneficiary DID — MUST equal ownerDid (zero commingling) */
|
|
26
|
+
beneficiaryDids?: string[];
|
|
27
|
+
/** Must ALWAYS be false or omitted (1940 Investment Company Act Safe Harbor) */
|
|
28
|
+
commingledPool?: boolean;
|
|
29
|
+
/** Authorized AIGNE Copilot session key / agent DID allowed to submit bounded rebalance proposals */
|
|
30
|
+
copilotAgentDid: string;
|
|
31
|
+
/** Allowlisted Uniswap V3/V4 32-byte Pool IDs */
|
|
32
|
+
allowedPoolIds: string[];
|
|
33
|
+
/** Maximum allowed NAV slippage per rebalance in bps (must be <= 100 bps = 1.00%) */
|
|
34
|
+
maxSlippageBps: number;
|
|
35
|
+
/** Minimum tick range width (`newTickUpper - newTickLower >= minTickWidth`) */
|
|
36
|
+
minTickWidth: number;
|
|
37
|
+
/** Maximum allowed spot-vs-TWAP tick divergence before volatility circuit breaker trips */
|
|
38
|
+
maxTwapTickDeviation: number;
|
|
39
|
+
/** Minimum block interval between rebalances (`currentHeight - lastRebalanceHeight >= minCooldownBlocks`) */
|
|
40
|
+
minCooldownBlocks?: number;
|
|
41
|
+
/** Fixed SaaS / AIGNE compute fee in ABT per rebalance (not % of AUM or % of profit) */
|
|
42
|
+
fixedAbtComputeFee: string;
|
|
43
|
+
abtTokenAddress: string;
|
|
44
|
+
computeFeeRecipientDid: string;
|
|
45
|
+
/** Must ALWAYS be 0 or omitted (Investment Advisers Act Safe Harbor) */
|
|
46
|
+
managementFeeBps?: number;
|
|
47
|
+
/** Must ALWAYS be 0 or omitted (Investment Advisers Act Safe Harbor) */
|
|
48
|
+
performanceFeeBps?: number;
|
|
49
|
+
/** Must ALWAYS be 0 or omitted (SEC Section 15(a) Broker-Dealer Safe Harbor) */
|
|
50
|
+
swapCommissionBps?: number;
|
|
51
|
+
ofacBlocklist?: Iterable<string>;
|
|
52
|
+
}
|
|
53
|
+
interface NonCustodialLpContractNftAsset {
|
|
54
|
+
address: string;
|
|
55
|
+
owner: string;
|
|
56
|
+
consumedTime?: string;
|
|
57
|
+
data: {
|
|
58
|
+
type: 'json';
|
|
59
|
+
value: ContractNftPayload;
|
|
60
|
+
};
|
|
61
|
+
guardSpec: NonCustodialLpGuardSpec;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Computes a deterministic block slot offset `[0, jitterWindowBlocks - 1]` for a given
|
|
65
|
+
* `contractNftAddress` and volatility epoch so thousands of AIGNE LP Copilots never fire
|
|
66
|
+
* in the exact same block during market spikes (Thundering Herd / Self-DDoS mitigation).
|
|
67
|
+
*/
|
|
68
|
+
declare function computeDeterministicRebalanceSlot(contractNftAddress: string, epoch: number, jitterWindowBlocks?: number): number;
|
|
69
|
+
/**
|
|
70
|
+
* Builds a 100% Non-Custodial `ContractNFT` asset with deterministic on-chain guardrails
|
|
71
|
+
* for managing a single user's Uniswap V3/V4 concentrated liquidity position.
|
|
72
|
+
*
|
|
73
|
+
* Legal & Security Invariants:
|
|
74
|
+
* 1. Strictly prohibits pooled / commingled multi-user funds (`commingledPool: false`, single `ownerDid`).
|
|
75
|
+
* 2. Strictly prohibits `% AUM` management fees, `% Performance` fees, and `% Swap` commissions.
|
|
76
|
+
* 3. Encodes hard declarative guards for `allowedPoolIds`, `maxSlippageBps`, `minTickWidth`,
|
|
77
|
+
* `maxTwapTickDeviation`, `minCooldownBlocks`, and post-rebalance NAV conservation.
|
|
78
|
+
*/
|
|
79
|
+
declare function buildNonCustodialLpContractNft(spec: NonCustodialLpGuardSpec): NonCustodialLpContractNftAsset;
|
|
80
|
+
interface LpRebalanceProposalInput {
|
|
81
|
+
contractNft: NonCustodialLpContractNftAsset;
|
|
82
|
+
callerDid: string;
|
|
83
|
+
poolId: string;
|
|
84
|
+
positionId: string;
|
|
85
|
+
newTickLower: number;
|
|
86
|
+
newTickUpper: number;
|
|
87
|
+
spotTick: number;
|
|
88
|
+
twapTick: number;
|
|
89
|
+
preRebalanceNavUsd: string;
|
|
90
|
+
postRebalanceNavUsd: string;
|
|
91
|
+
currentBlockHeight: number;
|
|
92
|
+
lastRebalanceHeight?: number;
|
|
93
|
+
enforceJitterSlot?: boolean;
|
|
94
|
+
jitterWindowBlocks?: number;
|
|
95
|
+
statedb: Record<string, any>;
|
|
96
|
+
executeStatement: StatementExecutor;
|
|
97
|
+
dryRun?: boolean;
|
|
98
|
+
ofacBlocklist?: Iterable<string>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Validates and executes a non-custodial LP rebalance proposal through the user's personal `ContractNFT`:
|
|
102
|
+
* 1. Verifies OFAC sanctions screening.
|
|
103
|
+
* 2. Enforces `minCooldownBlocks` and optional deterministic jitter slot to prevent automated rebalance storms.
|
|
104
|
+
* 3. Trips the Volatility Circuit Breaker if `|spotTick - twapTick| > maxTwapTickDeviation`.
|
|
105
|
+
* 4. Enforces post-condition NAV conservation (`postRebalanceNavUsd >= minRequiredPostNavUsd`).
|
|
106
|
+
* 5. Runs a mandatory pre-flight `dryRun: true` check on the overlay before committing.
|
|
107
|
+
*/
|
|
108
|
+
declare function executeNonCustodialLpRebalance(input: LpRebalanceProposalInput): Promise<TransactionBlockResult & {
|
|
109
|
+
nextAllowedRebalanceHeight: number;
|
|
110
|
+
jitterSlot: number;
|
|
111
|
+
}>;
|
|
112
|
+
//#endregion
|
|
113
|
+
export { DEFAULT_LP_JITTER_WINDOW_BLOCKS, DEFAULT_LP_REBALANCE_COOLDOWN_BLOCKS, LpRebalanceProposalInput, MAX_LP_REBALANCE_SLIPPAGE_BPS, MAX_UNISWAP_TICK, MIN_UNISWAP_TICK, NonCustodialLpContractNftAsset, NonCustodialLpGuardSpec, buildNonCustodialLpContractNft, computeDeterministicRebalanceSlot, executeNonCustodialLpRebalance };
|