Open
Conversation
Contributor
|
@AndriiDiachuk can you please post sample input and output of the script? |
Collaborator
Author
Input: factoryHex: "0xcB3da766122DD0F25C1c7Fe9B0Ad59Ce1cfE462B"
poolNames: ["moet_pyusd0", "weth_wbtc"]
tokenAAddrs: ["0xB3F6C6C7b1b4F53E1c5B7F4d9F8A2e1C6D3b9A2e", "0xA1b2C3d4E5f6A7b8C9d0E1f2A3b4C5d6E7f8A9b0"]
tokenANames: ["MOET", "WETH"]
tokenBAddrs: ["0xD4e5F6a7B8c9D0e1F2a3B4c5D6e7F8a9B0c1D2e3", "0xC2d3E4f5A6b7C8d9E0f1A2b3C4d5E6f7A8b9C0d1"]
tokenBNames: ["PYUSD0", "WBTC"]
fees: [100, 3000]Output: [
PoolStatus(
pool: "moet_pyusd0",
tokenA: "MOET",
balanceA: 19.89200582, // MOET held by pool contract
tokenB: "PYUSD0",
balanceB: 30022.35759300, // PYUSD0 held by pool contract
hasLiquidity: true
),
PoolStatus(
pool: "weth_wbtc",
tokenA: "WETH",
balanceA: 0.0, // pool exists but no in-range liquidity
tokenB: "WBTC",
balanceB: 0.0,
hasLiquidity: false
)
]The second entry covers both the "pool has no in-range liquidity" and "factory call failed" cases. both return the same shape with zero balances and |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Collaborator
Author
|
@liobrasil can you please review it once more and approve if everything is fine now? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
get_pool_execution_health.cdca Cadence script used by fcm-observer to periodically monitor execution health of FlowSwap V3 pools used by ALP and FYV.The script simulates swap execution via the QuoterV2 contract and measures price impact in both directions at a configurable canonical trade size. This is more reliable than raw token balances for V3 concentrated-liquidity pools.
For each pool the script:
pool.liquidity()for in-range liquidityhealthyForExecutionwhen both directions quote successfully and both impacts are withinmaxImpactBpsThe existing
get_pool_liquidity.cdcis kept — it remains valid for V2 reserve-style pools where raw balances are a reliable liquidity signal.Sample input