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 the code to manage the asset pools

In Chapter 11, An Introduction to Crypto Loans we learned that the asset pool smart contract maintains multiple asset pools. In this section, we will explain how the AssetPool smart contract manages these asset pools.

Pool status

We already know that an asset pool is a pool that holds an ERC20 token. The asset pool also has a life cycle. For example, the prices of some tokens may become very volatile or some tokens may be improper to be served as collaterals in a crypto loan. Therefore, we should have an approach to deactivate the assets for crypto loans. So, there could be several statuses for each asset pool that form the life cycle of the asset pool.

In the AssetPool smart contract, we will introduce three statuses:

  • Inactive: This means that the pool is initialized but inactive for the user to take any actions with this pool. The inactive status means the owner needs to safely configure the pool or shut down the pool...
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