Borrower Workflow
Last updated
Last updated
This guide explains the borrowing process using PT-sUSDe as a collateral example in the Smart Contract. The workflow demonstrates how to deposit collateral, obtain a loan, and repay it, including all token conversions and fee calculations. The process includes collateral management, debt recording, token swaps, and final repayment with associated fees.
The Borrower deposits Collateral Tokens into the Smart Contract.
Deposit PT-sUSDe worth 50 USDC as collateral
This initiates the borrowing process
Several automated steps occur in the contract:
Initial Token Minting
Mints 45 FT tokens based on debt calculation
Debt = 50 USDC × 90% LTV ratio = 45 USDC
Mints GT NFT to record collateral and debt
Token Swapping
Current XT/FT exchange rate: 4.99% in AMM
Swaps 8.19 FT for 40.9 XT
Remaining FT: 36.81 (45 - 8.19)
Final Token Conversion
Converts 40.9 XT + 36.81 FT to 40.9 USDC, where 36.81 FT = 40.9 x 90% LTV ratio.
Based on 90% LTV ratio calculation
Interest Calculation
Interest = 45 USDC (debt) - 40.9 USDC (borrowed) = 4.1 USDC
Borrowing Fee
Fee = 4.1 USDC × 10% = 0.41 USDC
Final Amount
Available borrowed amount = 40.9 - 0.41 = 40.49 USDC
Borrower receives 40.49 USDC and GT NFT
The Borrower repays the loan:
Repays 45 USDC debt
Receives back PT-sUSDe collateral
Contract returns 4.1 USDC to borrower
GT NFT is burned after repayment
LTV ratio is 90% in this example
The XT/FT exchange rate varies, depending on the current AMM curve.