/fluid-vault:fluid-liquidate-muldiv-clampfrom fluid-vault
Reviews Fluid (Instadapp) vault liquidate paths for inverted integer mul/div when clamping collateral to a debt amount. Use when auditing Fluid vaultT1 or vaultTypesCommon liquidation, or any protocol that scales collateral as col * (debt/actualDebt) in Solidity integer math.
Ships in fluid-vault. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
vaultT1, T2–T4 common modules)Incorrect scaling of collateral when reducing liquidated debt to a caller-supplied cap:
// WRONG in integer math when debtAmt < actualDebtAmt:
// quotient is 0 → wipes collateral amount
actualColAmt = actualColAmt * (debtAmt / actualDebtAmt);
actualDebtAmt = debtAmt;
// RIGHT:
actualColAmt = (actualColAmt * debtAmt) / actualDebtAmt;
actualDebtAmt = debtAmt;
Solidity floor division means debtAmt / actualDebtAmt == 0 whenever debtAmt < actualDebtAmt.
If the branch is reachable:
colPerUnitDebt == 0): liquidator may pay debt and receive 0 coll while vault internal totals still subtract full raw liquidated col/debt → books desync from Liquidity layer.If the branch is dead under the protocol’s floor math (e.g. raw path guarantees actualDebtAmt <= debtAmt), impact may be zero — always prove reachability.
actualDebtAmt > debtAmt (or similar) clampsdebtAmt near full liquidatable amount.liquidate(debtAmt, 0, liquidator, false) (or protocol equivalent).actualCol zeroed / vault totals ≠ Liquidity balances after success.contracts/protocols/vault/vaultT1/coreModule/main.sol — liquidate clampcontracts/protocols/vault/vaultTypesCommon/coreModule/main.sol — shared pathWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub cyotee/cyotee-claude-plugins --plugin fluid-vault