Cushion
A Solana and Anchor prototype for liquidation protection around DeFi borrowing positions.
- Explores automated collateral injection and withdrawal around risky loan positions.
- Uses an obligation manager and vault model for controlled borrower and keeper interactions.
- Serves as a practical student-builder track for Solana and Rust development.
Motivation
Cushion explores automated liquidation protection for DeFi loans. The basic idea is to protect a borrower position when health deteriorates by injecting additional collateral from a vault, then withdrawing that injected collateral once the position is healthy again.
Architecture
The Solana implementation is organized as an Anchor project with on-chain programs, integration tests, TypeScript SDK code, helper scripts, and a frontend application.
The core model separates borrower control, vault assets, and third-party keeper actions:
ObligationManageracts as the authority over managed lending obligations.- Borrowers can operate their positions while the position is not under active protection.
- A vault can inject collateral when a position falls below a configured health threshold.
- Borrower control is temporarily restricted while injected collateral is active.
- When the position recovers, the injected collateral can be withdrawn back to the vault.
Technologies
The project uses Solana, Anchor, Rust, TypeScript, and local validator workflows. It is a useful training ground for students learning Solana program structure, account state, instruction handlers, managers, math utilities, SDK synchronization, and frontend integration.
Current status
Cushion is a prototype and learning track rather than a production protocol. Its value is in the engineering questions it forces: authority design, risk thresholds, keeper behavior, vault accounting, and safe borrower interactions.