Search papers, labs, and topics across Lattice.
This paper introduces an autonomous agent for DeFi lending protocols that proactively prevents liquidations by using survival analysis to predict time-to-liquidation and counterfactual optimization to determine optimal interventions. The agent employs an XGBoost Cox proportional hazards model to normalize risk and a volatility-adjusted trend score to filter noise, enabling it to differentiate between genuine insolvency and minor fluctuations. Validated on Aave v3, the agent successfully prevents liquidations in high-risk scenarios where static rules fail, while maintaining a zero worsening rate and optimizing capital efficiency.
An autonomous agent can "save the unsavable" in DeFi lending by proactively preventing liquidations that static risk management tools miss, without worsening user positions.
Decentralized Finance (DeFi) lending protocols like Aave v3 rely on over-collateralization to secure loans, yet users frequently face liquidation due to volatile market conditions. Existing risk management tools utilize static health-factor thresholds, which are reactive and fail to distinguish between administrative"dust"cleanup and genuine insolvency. In this work, we propose an autonomous agent that leverages time-to-event (survival) analysis and moves beyond prediction to execution. Unlike passive risk signals, this agent perceives risk, simulates counterfactual futures, and executes protocol-faithful interventions to proactively prevent liquidations. We introduce a return period metric derived from a numerically stable XGBoost Cox proportional hazards model to normalize risk across transaction types, coupled with a volatility-adjusted trend score to filter transient market noise. To select optimal interventions, we implement a counterfactual optimization loop that simulates potential user actions to find the minimum capital required to mitigate risk. We validate our approach using a high-fidelity, protocol-faithful Aave v3 simulator on a cohort of 4,882 high-risk user profiles. The results demonstrate the agent's ability to prevent liquidations in imminent-risk scenarios where static rules fail, effectively"saving the unsavable"while maintaining a zero worsening rate, providing a critical safety guarantee often missing in autonomous financial agents. Furthermore, the system successfully differentiates between actionable financial risks and negligible dust events, optimizing capital efficiency where static rules fail.