Core variables
These variables define the fundamental state of any position in Twyne. Think of them as the “atoms” from which all other calculations are built.
Collateral (User’s Own Assets)
Whitepaper
C
User’s collateral deposited in their Collateral Vault
Litepaper
C
Simplified notation matching whitepaper
Solidity
userCollateral
Actual collateral owned by the borrower, excluding any reserved credit
Plain English
The borrower’s own assets used as collateral, not including borrowed credit from CLPs
Implementation Note: In Solidity, this value is often calculated as totalAssetsDepositedOrReserved - maxRelease
rather than stored directly, which helps maintain consistency as interest accrues.
Borrowed Amount (External Debt)
Whitepaper
B
User’s borrowed amount from external lending protocol
Litepaper
B
Outstanding external borrow
Solidity
maxRepay
Amount owed to the underlying lending protocol (e.g., Euler)
Plain English
The actual debt the borrower owes to the external lending market
Implementation Note: This value includes accrued interest and is denominated in the borrowed asset (e.g., USDC).
Reserved Credit (CLP Assets)
Whitepaper
C_LP
Credit reserved from Intermediate Vault
Litepaper
C_LP
Outstanding CLP collateral being reserved
Solidity
maxRelease
Amount borrowed from the Credit Vault to boost position
Plain English
The extra collateral borrowed from Credit LPs to increase borrowing power
Implementation Note: This is tracked separately to ensure proper interest accrual and ownership accounting.
Total Collateral
Whitepaper
C_total
or C + C_LP
Total collateral as seen by external protocol
Litepaper
Not explicitly defined
Implicit in calculations
Solidity
totalAssetsDepositedOrReserved
Sum of user collateral and reserved credit
Plain English
The total collateral backing the position from the external protocol’s perspective
Key Relationship: totalAssetsDepositedOrReserved = userCollateral + maxRelease
Last updated