FilDA
  • FilDA
  • English
    • 🔧GUIDES
      • FilDA Guide for BitTorrent
      • Getting started with FilDA
      • Liquidity Mining
      • ELA User started with FilDA
      • Video Guides
      • IoTex Guide(Cross-chain/
      • Elastos Smart Chain (ESC) Guide
      • FilDA Guide for REI
      • REI Network Guide(Cross-chain/
    • 🔔Audits
    • ⏰FilDA Data
      • FilDA Update - July 7,2023
      • FilDA Update - June 30,2023
      • FilDA Update - June 25,2023
      • FilDA Update - June 16,2023
      • FilDA Update - June 9,2023
      • FilDA Update - June 2,2023
      • FilDA Update - May 26,2023
      • FilDA Update - May 19,2023
      • FilDA Update - May 12,2023
      • FilDA Update - May 5,2023
      • FilDA Update - April 28,2023
      • FilDA Update - April 14,2023
      • FilDA Update - April 7,2023
      • FilDA Update - March 31,2023
      • FilDA Update - March 24,2023
      • FilDA Update - March 17,2023
      • FilDA Update - March 10,2023
      • FilDA Update - March 3,2023
      • FilDA Update - February 17,2023
      • FilDA Update - February 10,2023
      • FilDA Update - February 3,2023
      • FilDA Update - January 27,2023
      • FilDA Update - January 20,2023
      • FilDA Update - January 13,2023
      • FilDA Update - January 6,2023
      • FilDA Update - December 30
      • FilDA Update - December 23
      • FilDA Update - December 16
      • FilDA Update - December 9
      • FilDA Update - December 2
      • FilDA Update - November 25
      • FilDA Update - November 18
      • FilDA Update - November 11
      • FilDA Update - November 4
      • FilDA Update - October 28
      • FilDA Update - October 21
      • FilDA Update - October 14
      • FilDA Update - October 8
      • FilDA Update -September 30
      • FilDA Update -September 23
      • FilDA Update -September 16
      • FilDA Update -September 9
      • FilDA Update -September 2
      • FilDA Update -August 26
      • FilDA Update -August 19
      • FilDA Update -August 12
      • FilDA Update -August 5
      • FilDA Update -July 29
      • FilDA Update -July 22
      • FilDA Update -July 17
      • FilDA Update -July 8
      • FilDA Update -June 17
      • FilDA Update -June 10
      • FilDA Update -May 27
      • FilDA Update -May 20
      • FilDA Update -May 13
      • FilDA Update -May 7
      • FilDA Update -May 5
      • FilDA Update -April 1
      • FilDA Update -March 25
      • FilDA Update -March 18
      • FilDA Update -March 11
      • FilDA Update -March 4
    • 📰FilDA Report
      • FilDA Finance Update - December 2022
      • FilDA Finance Update - November 2022
      • FilDA Finance Update - October 2022
      • FilDA Finance Update - September 2022
      • FilDA Finance Update - August 2022
      • FilDA Finance Update - July 2022
      • FilDA Finance Update - June 2022
      • FilDA Finance Update - May 2022
      • FilDA Finance Update - April 2022
      • FilDA Finance Update - March 2022
      • FilDA Finance Update - February 2022
      • FilDA Finance Update - January 2022
      • FilDA Finance Update - December 2021
      • FilDA Finance Update - November 2021
      • FilDA Finance Update - October 2021
      • FilDA Finance Update - September 2021
      • FilDA Finance Update - August 2021
      • FilDA Finance Update - July 2021
    • 🔑FilDA Documentation
      • FilDA Platform Documentation
        • fTokens
        • Interest rate model
        • Implementation Principle
        • Key Parameters
        • Liquidation Thresholds
        • Liquidation rules
      • DAO Governance
      • Risk Control
    • 🔍Announcements
      • Introducing FilDA on the BitTorrent Network
      • Voting and Incentives Announcement
      • FilDA and TUSD Launch Liquidity Pool
      • Blindbox Claiming Guide
      • FilDA Bug Bounty
    • 🎡FilDA on Multiple Chains
      • FilDA on BTTC
        • BTTC - FilDA Markets
        • BTTC - FilDA Tokenomics
        • BTTC - Token Contracts
        • BTTC - Mining
      • Elastos - FilDA on Elastos
        • Elastos - Token Contracts
      • IoTeX on FilDA
        • IoTeX - Token Contracts
      • FilDA on HECO
        • HECO Token Contracts
        • Heco - FilDA Contracts
    • ❓FAQ
    • Brand Assets
    • TERMS OF SERVICE
  • 中文
    • 🔑欢迎来到FilDA
      • 挖矿概览
        • DAO保险挖矿
        • 流动性挖矿
        • 借贷挖矿
      • 代币
        • 代币分配
        • 代币合约
        • 交易对
      • DAO治理
        • 社区治理理念
        • DAO实施路线图
        • 多级风控体系
      • 业务模型
        • 业务模型
        • 清算规则
        • 关键数值
        • 实现原理
        • 利率模型
      • 代码
        • 基础协议
      • fToken增益资产
        • fToken简介
        • 关于fToken
        • 应用场景
      • 常见问题
    • 🔧操作指南
      • BitTorrent链跨链教程
      • REI Network使用教程
      • REI Network跨链教程
      • Elastos ESC使用教程
      • IoTeX链挖矿全教程
      • IoTeX链跨链教程
      • HECO链代币合约地址汇总
      • HECO跨链-NEO用户参与FilDA挖矿指南
      • HECO跨链-ELA用户参与FilDA挖矿指南
      • FilDA换币还款教程
      • FilDA权益通证NFT领取教程
      • FilDA挖矿全教程(借贷、LP、DAO)
    • 🔔审计报告
    • 🎡多链FilDA
      • FilDA-BTTC
        • BTTC链FilDA市场
        • BTTC链FilDA经济模型
        • BTTC链代币合约
        • BTTC链矿池
      • FilDA-IoTeX
        • IoTeX链FilDA经济模型
        • IoTeX链代币合约
      • FilDA-Elastos
        • Elastos链FilDA经济模型
        • Elastos链代币合约
    • 🔍活动公告
      • 关于FilDA正式部署BitTorrent网络的公告
      • FilDA 联合TUSD推出LP挖矿
      • 【活动】LuckyHeco NFT通证权益领取中
      • 【活动】投票FilDA节点领红包
      • 【活动】FilDA Bug Bounty计划持续进行中
    • ⏰动态更新
      • 2023/7/7更新
      • 2023/6/30更新
      • 2023/6/25更新
      • 2023/6/16更新
      • 2023/6/9更新
      • 2023/6/2更新
      • 2023/5/26更新
      • 2023/5/19更新
      • 2023/5/12更新
      • 2023/5/5更新
      • 2023/4/28更新
      • 2023/4/14更新
      • 2023/4/7更新
      • 2023/3/31更新
      • 2023/3/24更新
      • 2023/3/17更新
      • 2023/3/10更新
      • 2023/3/3更新
      • 2023/2/17更新
      • 2023/2/10更新
      • 2023/2/3更新
      • 2023/1/27更新
      • 2023/1/20更新
      • 2023/1/13更新
      • 2023/1/6更新
      • 2022/12/30更新
      • 2022/12/23更新
      • 2022/12/16更新
      • 2022/12/9更新
      • 2022/12/2更新
      • 2022/11/25更新
      • 2022/11/18更新
      • 2022/11/11更新
      • 2022/11/4更新
      • 2022/10/28更新
      • 2022/10/21更新
      • 2022/10/14更新
      • 2022/10/8更新
      • 2022/9/30更新
      • 2022/9/23更新
      • 2022/9/16更新
      • 2022/9/9更新
      • 2022/9/2更新
      • 2022/8/26更新
      • 2022/8/19更新
      • 2022/8/12更新
      • 2022/8/5更新
      • 2022/7/29更新
      • 2022/7/22更新
      • 2022/7/15更新
      • 2022/7/8更新
      • 2022/6/17更新
      • 2022/6/10更新
      • 2022/5/27更新
      • 2022/5/20更新
      • 2022/5/13更新
      • 2022/5/7更新
      • 2022/5/5更新
      • 2022/4/8更新
      • 2022/4/1更新
      • 2022/3/25更新
      • 2022/3/18更新
      • 2022/3/11更新
      • 2022/3/4更新
      • 2022/2/25更新
      • 2022/2/18更新
      • 2022/2/11更新
      • 2022/2/7更新
      • 2022/1/28更新
      • 2022/1/21更新
      • 2022/1/14更新
      • 2022/1/7更新
      • 2021/12/31更新
      • 2021/12/24更新
      • 2021/12/23更新
      • 2021/12/21更新
      • 2021/12/17更新
      • 2021/12/13更新
      • 2021/12/10更新
      • 2021/12/7更新
      • 2021/12/4更新
      • 2021/11/26更新
      • 2021/11/19更新
      • 2021/11/10更新
      • 2021/11/6更新
      • 2021/11/5更新
      • 2021/11/3更新
      • 2021/10/27更新
      • 2021/10/20更新
      • 2021/10/13更新
      • 2021/10/9更新
      • 2021/9/23更新
      • 2021/9/22更新
      • 2021/9/10更新
      • 2021/9/9更新
      • 2021/9/8更新
      • 2021/9/3更新
      • 2021/9/1更新
      • 2021/8/31更新
      • 2021/8/27更新
      • 2021/8/25更新
      • 2021/8/20更新
      • 2021/8/19更新
      • 2021/8/18更新
      • 2021/8/17更新
      • 2020/8/13更新
      • 2020/8/10更新
      • 2020/8/6更新
      • 2020/8/2更新
      • 2021/8/1更新
      • 2021/7/21更新
      • 2021/7/20更新
      • 2021/7/19更新
      • 2021/7/16更新
      • 2021/7/15更新
      • 2021/7/14更新
      • 2021/7/7更新
      • 2021/7/5 更新
      • 2021/7/2更新
      • 2021/7/1更新
      • 2021/6/29更新
      • 2021/6/26更新
      • 2021/6/25更新
      • 2021/6/24 更新
      • 2021/6/21更新
      • 2021/6/18更新
      • 2021/6/17更新
      • 2021/6/16更新
      • 2021/6/15更新
      • 2021/6/11更新
      • 2021/6/5更新
      • 2021/6/4更新
      • 2021/5/31更新
      • 2021/5/28更新
      • 2021/5/27更新
      • 2021/5/25更新
      • 2021/5/24更新
      • 2021/5/21更新
      • 2021/5/18更新
      • 2021/5/14更新
      • 2021/5/13更新
      • 2021/5/12更新
      • 2021/5/11更新
      • 2021/5/9更新
      • 2021/5/7更新
      • 2021/5/6更新
      • 2021/5/2更新
      • 2021/4/30更新
      • 2021/4/29更新
      • 2021/4/28更新
      • 2021/4/27更新
      • 2021/4/26更新
      • 2021/4/25更新
      • 2021/4/24更新
      • 2021/4/23更新
      • 2021/4/22更新
      • 2021/4/20更新
      • 2021/4/16更新
      • 2021/4/15更新
      • 2021/4/14更新
      • 2021/4/13更新
      • 2021/4/11更新
      • 2021/4/9更新
      • 2021/4/8更新
      • 2021/4/7更新
      • 2021/4/6更新
      • 2021/4/3更新
      • 2021/4/2更新
      • 2021/3/31更新
      • 2021/3/30更新
      • 2021/3/28更新
      • 2021/3/26更新
      • 2021/3/25更新
      • 2021/3/24更新
      • 2021/3/23更新
      • 2021/3/22更新
      • 2021/3/19更新
      • 2021/3/18更新
      • 2021/3/17更新
      • 2021/3/16更新
      • 2021/3/15更新
      • 2021/3/12更新
      • 2021/3/10更新
      • 2021/3/9更新
      • 2021/3/5更新
      • 2021/3/4更新
      • 2021/3/2更新
      • 2021/2/26更新
      • 2021/2/24更新
      • 2021/2/22更新
      • 2021/2/20更新
      • 2021/2/19更新
      • 2021/2/18更新
      • 2021/2/15更新
      • 2021/2/14更新
      • 2021/2/13更新
      • 2021/2/12更新
      • 2021/2/11更新
      • 2021/2/10更新
      • 2021/2/9更新
      • 2021/2/8更新
      • 2021/2/6更新
      • 2021/2/5更新
      • 2021/2/4更新
      • 2021/2/3更新
      • 2021/2/2更新
      • 2021/2/1更新
      • 2021/1/29更新
      • 2021/1/28更新
      • 2021/1/27更新
      • 2021/1/26更新
      • 2021/1/25更新
      • 2021/1/24更新
      • 2021/1/22更新
      • 2021/1/21更新
      • 2021/1/20更新
      • 2021/1/19更新
      • 2021/1/18更新
      • 2021/1/17更新
      • 2021/1/16更新
      • 2021/1/15更新
      • 2021/1/14更新
      • 2021/1/13更新
      • 2021/1/12更新
    • 📰项目月报
      • FilDA月报—2022年12月
      • FilDA月报—2022年11月
      • FilDA月报—2022年10月
      • FilDA月报—2022年9月
      • FilDA月报—2022年8月
      • FilDA月报—2022年7月
      • FilDA月报—2022年6月
      • FilDA月报—2022年5月
      • FilDA月报—2022年4月
      • FilDA月报—2022年3月
      • FilDA月报—2022年2月
      • FilDA月报—2022年1月
      • FilDA月报—2021年12月
      • FilDA月报—2021年11月
      • FilDA月报—2021年10月
      • FilDA月报—2021年9月
      • FilDA月报—2022年8月
      • FilDA月报—2021年7月
    • 💹重要数据
      • 挖矿比例更新
        • 挖矿比例 6/21
        • 挖矿比例 6/11
        • 挖矿比例 5/25
        • 质押率 4/28
        • 挖矿比例4/7
        • 挖矿比例4/2
        • 挖矿比例 3/26
        • 挖矿比例 3/22
        • 挖矿比例 3/9
      • 运营数据快照
        • 2021/1/13 22:30 TVL 11.9M
        • 2021/1/14 09:30 TVL21.6M
        • 2021/1/15 10:00 TVL 22.5M
        • 2021/1/15 13:00 TVL 32M
    • 📝媒体报道
      • 市场低潮期 FilDA谋进化 蜂巢财经
      • FilDA的突破与变革 金色财经
      • HECO Head Lending FilDA дает новое определение децентрализованному финансовому кредитованию
  • Russian
    • 🔧Начало работы с FilDA
    • 📰Ежемесячный отчет FilDA
      • Ежемесячный отчет FilDA за июль
由 GitBook 提供支持
在本页
  • A ledger with real-time transaction settlement
  • Interest Model
  • Changes in the ledger
  • Relationship between income and time
  • Each Itemised account

这有帮助吗?

  1. English
  2. FilDA Documentation
  3. FilDA Platform Documentation

Implementation Principle

A ledger with real-time transaction settlement

This is a ledger that can settle the transactions in real-time using smart contracts. The premise of the real-time settlement of the transactions in the ledger is that the transactions are carried out one by one in a specific processing sequence and reliable transaction time. Blockchain meets these requirements and provides a basis for automatic transaction settlement.

When a transaction occurs, the ledger settles the transaction for the corresponding account and updates the interest into the account balance. When the next transaction occurs, the same process is triggered again to update the account balance.

Interest Model

A simple banking model is used to generate income from loans, which is used as the interest for deposit users. It doesn't offer floating loan interest or consider profits, but ensures the balance of borrowing and lending.

Loan Profit = Deposit InterestLoan Profit = Total loan * Loan interest rate * TimeDeposit Interest = Total deposit * Deposit interest rate * Time=>Total deposit * Deposit interest rate * Time =Total loan * Loan interest rate * Time=>Total deposit * Deposit interest rate =Total loan * Loan interest rate

According to the above equation,

  1. When the loan is 0, no profit will be generated and then deposit interest is 0.

  2. When the total loan increases, the profit will increase and then deposit interest will increase.

  3. When the total loan remains unchanged and the total deposit increases, the deposit interest will decrease

Conclusion: The deposit interest rates change with changes in total loans and total deposits.

Changes in the ledger

Here are 4 different transaction events: deposit, withdraw, borrow, repay.

If there are no transaction events, the total amount of deposits and loans will not change and interest rates will remain unchanged during this period. If any transaction events occur, the total amount of deposits and loans will change, and then the interest rate will also change.

Assuming that the borrowing interest rate is 0.05, the circles in the diagram below indicate the status of the ledger and interest rates, and the arrows indicate transaction events:

Circle a: Deposit is 100. Loan is 0. Loan interest rate is 5%. No interest earned.

Transaction 1: borrow 50

= (50 * 0.05)/ 100 = 0.025Deposit interest rate = ( total loan * loan interest rate)/ total deposit = (50 * 0.05)/ 100 = 0.025

​The ledger resulted from event 2 and 3 can also be calculated according to the above equation.

Conclusion: Transaction events result in changes in interest rates

Relationship between income and time

The status change as showed above doesn't include transaction settlement. In fact, incomes (interests) will be generated over time.

For deposits:

New total deposit = total deposit + (total deposit * deposit interest rate * time)

For loans:

New total loan = total loan + (total loan * loan interest rate * time)

Yellow arrows represent the duration of the previous status. After a new event occurs, the status will be updated into the next time period.

As shown in the above diagram, the changes in interest rates become more complex after considering the relationship between income and time, but this calculation is still very clear.

Status a lasts 1 day. Since the loan is 0 and the interest rate is 0, the deposit doesn't change after settlement for event 1. But the total loan increases after event 1. The deposit interest rate is updated to 0.025 after event 1.

Status b lasts 2 days until event 2 occurs. Here is the calculation of the new total deposit and total loan before settlement for event 2:

## Settlement ##

New total deposit = 100 +(100 * 0.025 * 2)= 105

New total loan = 50 +(50 * 0.05 * 2) = 55

After settlement for event 2, the total deposit will be 105 + 50 = 155.

According to the new deposit of 155 and the new loan of 55, the new interest rate is 0.01774.

Status c lasts 1 day until event 3 occurs.

## Settlement ##

New total deposit = 155 +(155 * 0.01774 * 1) = 157.75

New total loan = 55 + (55 * 0.05 * 1) = 57.75

Because 20 is repaid, total loan changes to 57.75 - 20 = 37.75

Then the new interest rate is 0.012.

Conclusion: The settlement is conducted when any transaction events occur. After settlement, the account balance will be adjusted, which leads to a change in the interest rate.

Each Itemised account

We classify the total deposit 100 in status a as other deposits. After 2 days, Alice deposits 50, and other deposits are updated to 105 after settlement. Alice's deposit increases the total deposits to 155, and the new deposit interest rate is updated to be 0.01774.

One day later, Bob also deposits 50. By the time before Bob's event, the settlement for Alice's deposit and other deposits uses the interest rate of 0.01774.This calculation results are shown in status c.

As analysed above, we can find that every account balance needs to be settled when an event occurs, . In this way, as the number of deposit/borrowing users increases, there will be more and more accounts, and the calculation workload for each settlement will also increase. In fact, it is not necessary to settle all the accounts as long as the historical interest rate is recorded. We can directly calculate the state c as shown in the diagram above based on the initial status of each account:

Other Deposits = 100 +(100 * 0.025 * 2)+((100 +(100 * 0.025 * 2))* 0.01774 * 1)

Alice's deposit = 50 + (50 * 0.01774 * 1)

Bob's deposit = 50

Where 100 is the initial amount of other deposits, and 50 is the initial amount of Alice's deposit. 0.025 is the interest rate for the first period, and 0.01774 is the interest rate for the second period. It can be found that as long as there is a record of historical interest rates, the balance of each account can be calculated through iterative computation. Therefore, when the settlement is performed, only the account of the event needs to be settled, and other accounts can be temporarily not settled until any events apply to them.

Conclusions: Each settlement is only for accounts whose balances are affected and the general ledger is updated. There is no need to settle other accounts before new events occur.

This part of the description is compiled from the Internet, thanks to the original author, outprog.

Link: https://juejin.cn/post/6844903774620745742

上一页Interest rate model下一页Key Parameters

最后更新于2年前

这有帮助吗?

​

Assuming that the loan interest rate is 5% (an usurious loan is used just for easy calculation), the settlement with time value should be as follows:

The calculation as discussed above is complicated, but it is clear that the status change is triggered by events. In reality, the total amount of deposits and borrowings is generated by the aggregation of countless accounts rather than one single account. For example, Alice deposits 50, Bob deposits 30, and the total deposit is 80. Because Alice and Bob deposit at different times, their interest rates are different. All these factors bring more complexity to the process. The same goes for borrowing. Therefore, each account must be settled separately, and their interest rates vary according to changes in the general ledger quota.

🔑