Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion dca/dca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ async function executeDirectSwap(opts: {
network,
senderKey: opts.stxPrivateKey,
anchorMode: AnchorMode.Any,
fee: 5000n,
// 2026-07-15 field audit F-14: an underpriced hardcoded fee is a
// stuck-head-nonce seed (one stuck tx stalls every later tx from the
// signer). Configurable via DCA_FEE_USTX; default raised to match
// field-tested contract-call fees.
fee: BigInt(process.env.DCA_FEE_USTX ?? "50000"),
});

const broadcastRes = await broadcastTransaction({ transaction: tx, network });
Expand Down
8 changes: 6 additions & 2 deletions defi-portfolio-scanner/defi-portfolio-scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,18 @@ function computeRiskScore(scanData: ScanData): {
// 3. Zest LTV risk
for (const pos of protocols.zest.positions) {
if (pos.ltv !== null) {
if (pos.ltv > 85) {
// Scale contract (2026-07-15 field audit F-13): ltv is a FRACTION in
// [0, 1] — the display below multiplies by 100. The previous thresholds
// compared raw ltv > 85 / > 70, which a fractional value can never
// exceed, so the liquidation-risk flags could never fire.
if (pos.ltv > 0.85) {
score += 30;
factors.push({
factor: "zest-ltv-critical",
severity: "critical",
detail: `Zest position ${pos.asset} has LTV ${(pos.ltv * 100).toFixed(1)}% — liquidation risk imminent.`,
});
} else if (pos.ltv > 70) {
} else if (pos.ltv > 0.70) {
score += 15;
factors.push({
factor: "zest-ltv-warning",
Expand Down
Loading