From 19f8700b78f324861df7eb49ab6c315eb5746d6f Mon Sep 17 00:00:00 2001 From: Timur Gordon <31495328+timurgordon@users.noreply.github.com> Date: Tue, 29 Apr 2025 01:11:51 +0200 Subject: [PATCH] feat: Implement comprehensive DeFi platform in Digital Assets dashboard Add a complete DeFi platform with the following features: - Tabbed interface for different DeFi functionalities - Lending & Borrowing system with APY calculations - Liquidity Pools with LP token rewards - Staking options for tokens and digital assets - Token Swap interface with real-time exchange rates - Collateralization system for loans and synthetic assets - Interactive JavaScript functionality for real-time calculations This enhancement provides users with a complete suite of DeFi tools directly integrated into the Digital Assets dashboard. --- actix_mvc_app/src/views/assets/index.html | 1508 +++++++++++++++++++++ actix_mvc_app/static/js/defi.js | 571 ++++++++ 2 files changed, 2079 insertions(+) create mode 100644 actix_mvc_app/static/js/defi.js diff --git a/actix_mvc_app/src/views/assets/index.html b/actix_mvc_app/src/views/assets/index.html index e4b71f8..8fcbe01 100644 --- a/actix_mvc_app/src/views/assets/index.html +++ b/actix_mvc_app/src/views/assets/index.html @@ -62,6 +62,1511 @@ + +
Our decentralized finance platform allows you to maximize the value of your digital assets through various financial services.
+Use the tabs above to explore lending, borrowing, liquidity pools, staking, swapping, and collateralization features.
+Earn interest by lending your digital assets to the ZAZ DeFi platform.
+ + +Borrow digital assets using your existing assets as collateral.
+ + +Asset | +Amount | +Interest Rate | +Start Date | +End Date | +Earned Interest | +Status | +Actions | +
---|---|---|---|---|---|---|---|
ThreeFold Token (TFT) | +1,000 TFT | +4.2% APY | +2025-04-01 | +2025-05-01 | +3.5 TFT | +Active | ++ + | +
Zanzibar Token (ZAZ) | +500 ZAZ | +6.8% APY | +2025-03-15 | +2025-06-15 | +8.5 ZAZ | +Active | ++ + | +
Borrowed Asset | +Amount | +Collateral | +Collateral Ratio | +Interest Rate | +Start Date | +Due Date | +Actions | +
---|---|---|---|---|---|---|---|
ThreeFold Token (TFT) | +500 TFT | +Beach Property NFT | +
+
+
+
+
+
+ 65%
+ |
+ 5.2% APR | +2025-04-10 | +2025-05-10 | ++ + | +
Liquidity pools are collections of tokens locked in smart contracts that provide liquidity for decentralized trading. By adding your assets to a liquidity pool, you earn a share of the trading fees generated by the pool.
+Pool | +Total Liquidity | +24h Volume | +APY | +Your Liquidity | +Your Share | +Actions | +
---|---|---|---|---|---|---|
+
+
+
+
+ TFT-ZAZ
+ ![]() ![]() |
+ $1,250,000 | +$45,000 | +12.5% | +$2,500 | +0.2% | +
+
+
+
+
+ |
+
+
+
+
+
+ TFT-USDT
+ ![]() ![]() |
+ $3,750,000 | +$125,000 | +8.2% | +$0 | +0% | +
+
+
+
+
+ |
+
+
+
+
+
+ ZAZ-USDT
+ ![]() ![]() |
+ $850,000 | +$32,000 | +15.8% | +$5,000 | +0.59% | +
+
+
+
+
+ |
+
+
+
+
+
+ BTC-USDT
+ ![]() ![]() |
+ $5,250,000 | +$450,000 | +6.5% | +$0 | +0% | +
+
+
+
+
+ |
+
+
+
+
+
+ ETH-USDT
+ ![]() ![]() |
+ $4,100,000 | +$320,000 | +7.2% | +$0 | +0% | +
+
+
+
+
+ |
+
Swap allows you to exchange one token for another at the current market rate. Swaps are executed through liquidity pools with a small fee that goes to liquidity providers.
+Time | +From | +To | +Value | +
---|---|---|---|
2025-04-15 14:32 | +
+
+
+ ![]() |
+
+
+
+ ![]() |
+ $250.00 | +
2025-04-14 09:17 | +
+
+
+ ![]() |
+
+
+
+ ![]() |
+ $1,000.00 | +
2025-04-12 16:45 | +
+
+
+ ![]() |
+
+
+
+ ![]() |
+ $50.00 | +
Pair | +Rate | +24h Change | +Volume (24h) | +
---|---|---|---|
+
+
+
+
+ TFT/ZAZ
+ ![]() ![]() |
+ 0.5 | ++2.3% | +$125,000 | +
+
+
+
+
+ TFT/USDT
+ ![]() ![]() |
+ 0.5 | +-1.2% | +$250,000 | +
+
+
+
+
+ ZAZ/USDT
+ ![]() ![]() |
+ 0.5 | ++3.7% | +$175,000 | +
Use your digital assets as collateral to secure loans or generate synthetic assets. Maintain a healthy collateral ratio to avoid liquidation.
+Asset | +Collateral Value | +Borrowed/Generated | +Collateral Ratio | +Liquidation Price | +Status | +Actions | +
---|---|---|---|---|---|---|
+
+
+ ![]() |
+ $1,000 | +$700 (Loan) | +
+
+
+
+
+
+ 143%
+ |
+ $0.35 | +Healthy | +
+
+
+
+
+ |
+
+
+
+ Beach Property NFT
+
+ |
+ $25,000 | +10,000 sUSD | +
+
+
+
+
+
+ 250%
+ |
+ $10,000 | +Warning | +
+
+
+
+
+ |
+
+
+
+ ![]() |
+ $500 | +0.1 sBTC | +
+
+
+
+
+
+ 333%
+ |
+ $0.15 | +Healthy | +
+
+
+
+
+ |
+
Staking allows you to lock your digital assets for a period of time to support network operations and earn rewards. The longer you stake, the higher rewards you can earn.
+Stake your NFTs and other digital assets to earn passive income.
+ +Asset | +Amount | +Value | +Start Date | +End Date | +APY | +Earned Rewards | +Status | +Actions | +
---|---|---|---|---|---|---|---|---|
+
+
+ ![]() |
+ 1,000 TFT | +$500 | +2025-03-15 | +2025-06-15 | +10.2% | +22.5 TFT | +Active | ++ + | +
+
+
+ ![]() |
+ 500 ZAZ | +$250 | +2025-04-01 | +2025-05-01 | +12.0% | +5.0 ZAZ | +Active | ++ + | +
+
+
+ Beach Property NFT
+
+ |
+ 1 NFT | +$25,000 | +2025-02-10 | +2026-02-10 | +10.0% | +450 ZAZ | +Active | ++ + | +