fix: skip CI bootstrap recenter when VWAP already seeded by deploy script
DeployLocal.sol now calls recenter() twice during the VWAP bootstrap sequence (issue #567 fix). The second recenter leaves ANCHOR positions at the post-seed-buy tick, so the CI bootstrap's subsequent call_recenter() failed with "amplitude not reached" (currentTick == anchorCenterTick, amplitude = 0 < 400). Fix: before calling recenter(), check cumulativeVolume(). If it is already > 0, the deploy script has placed positions and bootstrapped VWAP -- skip the redundant recenter rather than failing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c05b20d640
commit
3a17404529
1 changed files with 12 additions and 0 deletions
|
|
@ -113,6 +113,18 @@ call_recenter() {
|
|||
recenter_pk="$TXNBOT_PRIVATE_KEY"
|
||||
recenter_addr="$TXNBOT_ADDRESS"
|
||||
fi
|
||||
|
||||
# If the deploy script already bootstrapped VWAP (cumulativeVolume > 0), positions
|
||||
# are in place at the post-seed-buy tick. Calling recenter() now would fail with
|
||||
# "amplitude not reached" because currentTick == anchorCenterTick. Skip it.
|
||||
local cumvol
|
||||
cumvol="$(cast call --rpc-url "$ANVIL_RPC" \
|
||||
"$LIQUIDITY_MANAGER" "cumulativeVolume()(uint256)" 2>/dev/null || echo "0")"
|
||||
if [[ "$cumvol" != "0" && -n "$cumvol" ]]; then
|
||||
bootstrap_log "VWAP already bootstrapped by deploy script (cumulativeVolume=$cumvol) -- skipping initial recenter"
|
||||
return 0
|
||||
fi
|
||||
|
||||
bootstrap_log "Calling recenter() via $recenter_addr"
|
||||
cast send --rpc-url "$ANVIL_RPC" --private-key "$recenter_pk" \
|
||||
"$LIQUIDITY_MANAGER" "recenter()" >>"$LOG_FILE" 2>&1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue