Reader small image

You're reading from  Building Full Stack DeFi Applications

Product typeBook
Published inMar 2024
PublisherPackt
ISBN-139781837634118
Edition1st Edition
Concepts
Right arrow
Author (1)
Samuel Zhou
Samuel Zhou
author image
Samuel Zhou

Samuel Zhou has over 15 years of software engineering experience in top high tech companies including being a blockchain developer as his hobby since 2018. In 2022, Samuel turned his enthusiasm on blockchain technology into a business by founding TiFi, which is a silicon valley based startup that builds e-Commerce platform on blockchain and brings blockchain to everyday life. Over there he has created TiFi Token that offers token rebates so people can get cash back when spending the token. Also he has built TiFi Bank which is a DeFi application that offers crypto saving, lending, trading, staking and liquidity management features. Samuel holds a Master Degree and a Bachelor Degree in Computer Science.
Read more about Samuel Zhou

Right arrow

Implementing an asset pool share and its deployer

When a lender deposits assets into an asset pool, the lender owns shares of the pool to represent the lender’s ownership of a portion of tokens in it. In this book, we will use the term asset pool share to represent the lender’s ownership.

Next, let’s introduce an asset pool share.

Introducing an asset pool share

Similar to the liquidity pool token we discussed in Chapter 5, Building Crypto-Trading Smart Contracts an asset pool share is also an ERC20 token. One share represents an amount of an asset token. After a period of time, the interest will be cumulated by the asset token amount for each share. So, a user can receive an amount of shares on a deposit, and after a period of time, the user can get more asset tokens when they redeem the same amount of shares on withdrawal. Figure 11.7 shows how a crypto loan uses the asset pool share in deposit and withdraw operations:

Figure 11.7 – A demonstration of using the asset pool share in deposit and withdraw operations

Figure...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Building Full Stack DeFi Applications
Published in: Mar 2024Publisher: PacktISBN-13: 9781837634118

Author (1)

author image
Samuel Zhou

Samuel Zhou has over 15 years of software engineering experience in top high tech companies including being a blockchain developer as his hobby since 2018. In 2022, Samuel turned his enthusiasm on blockchain technology into a business by founding TiFi, which is a silicon valley based startup that builds e-Commerce platform on blockchain and brings blockchain to everyday life. Over there he has created TiFi Token that offers token rebates so people can get cash back when spending the token. Also he has built TiFi Bank which is a DeFi application that offers crypto saving, lending, trading, staking and liquidity management features. Samuel holds a Master Degree and a Bachelor Degree in Computer Science.
Read more about Samuel Zhou