Skip to main content

TrustVault Contract

The TrustVault contract manages the protocol’s liquidity pool, handling staking, borrowing, and yield distribution.

Overview

Contract Address

Interface

Data Structures

Key Functions

deposit

Stake USDC and receive tmUSDC shares.
Parameters:
  • amount: Amount of USDC to deposit (6 decimals)
Returns:
  • shares: Amount of tmUSDC shares received
Example:

borrow

Borrow USDC based on Trust Score.
Parameters:
  • amount: Amount of USDC to borrow
  • duration: Loan duration in seconds
Requirements:
  • Caller must have sufficient Trust Score
  • Amount must not exceed borrowing limit
  • Vault must have sufficient liquidity

repay

Repay an active loan.
Parameters:
  • loanId: ID of the loan to repay
Requirements:
  • Caller must be the borrower
  • Loan must be active
  • Caller must have approved sufficient USDC

Interest Rate Model

The vault uses a utilization-based interest rate:

Security

The TrustVault integrates with an oracle for Trust Score verification. Only authorized oracles can update scores.

Access Control

Emergency Functions

Events

Monitor contract activity by subscribing to events:

View on GitHub

Full source code