Leverage Workflow
Last updated
Last updated
This guide explains the leveraged trading process using the Smart Contract. The workflow demonstrates how to leverage your initial USDC deposit to obtain a larger position in PT-sUSDe tokens. The process includes token minting, swaps, fee calculations, collateral purchase, and final repayment mechanics.
User deposits Underlying Tokens into the Smart Contract:
Deposit amount: 12 USDC
Contract mints: 12 XT + 10.8 FT (based on 90% initial LTV)
The contract performs several token conversions:
Current XT/FT exchange rate: 5.092 in AMM
Swaps 10.8 FT to 55 XT (10.8 Γ 5.092 = 55)
Total XT after combination: 67 XT (55 + 12)
Leverage calculation: 67 USDC total value with 60.3 USDC debt record (67 Γ 0.9)
Interest Calculation
Interest = 60.3 USDC (debt) - 55 USDC (borrowed) = 5.3 USDC
Borrowing fee = 5.3 USDC Γ 10% = 0.53 USDC
Fee Conversion
XT/USDC exchange rate: 67 XT/12 USDC = 5.58
Fee in XT = 0.53 USDC Γ 5.58 = 2.96 XT
Available XT after fee = 67 XT - 2.96 XT = 64.04 XT
Use 64.04 XT to buy PT-sUSDe tokens
Purchase amount: 64.04 USDC worth of PT-sUSDe
Swap executed in DEX
Contract mints GT NFT with:
Record 1: PT-sUSDe collateral worth 64.04 USDC
Record 2: Debt record of 57.64 USDC (64.04 Γ 0.9 LTV ratio)
GT NFT transferred to user
64.04 XT is burned
To close the position:
Repay 57.64 USDC debt
Receive PT-sUSDe collateral worth 64.04 USDC
Get back 5.24 USDC remainder
GT NFT and FT are burned upon completion
Initial leverage is achieved through token swaps
Final redemption includes return of excess funds