Impermanent Loss (IL) is a concept in decentralized finance (DeFi) that occurs when providing liquidity to automated market maker (AMM) pools. It refers to the temporary loss of funds experienced by liquidity providers (LPs) due to price volatility of the assets in the pool. This loss is “impermanent” because it only materializes if the LP withdraws their funds when the asset prices have changed. If the prices return to their original state, the loss disappears.
How Impermanent Loss Occurs
In an AMM pool, liquidity providers deposit pairs of tokens (e.g., ETH and USDT) into a pool. The pool uses a constant product formula (e.g. x x y = k to determine the price of the assets. When the price of one asset changes relative to the other, arbitrageurs trade in the pool to restore equilibrium, which shifts the ratio of the two assets in the pool. This shift causes LPs to end up with a different value of assets than if they had simply held the tokens.
Example of Impermanent Loss
Let’s assume a liquidity pool with two assets: ETH and USDT. The pool follows the constant product formula x x y = k , where:
x = amount of ETH in the pool
y = amount of USDT in the pool
k = constant product
Initial Conditions
– Initial price of ETH: $1,000
– You deposit 1 ETH and 1,000 USDT into the pool.
– Total value of your deposit: $2,000 (1 ETH × $1,000 + 1,000 USDT × $1).
– The pool has:
– 10 ETH
– 10,000 USDT
– Constant product k = 10 x10,000 = 100,000 .
Your share of the pool: 10% (you deposited 1 ETH and 1,000 USDT out of 10 ETH and 10,000 USDT).
—
Scenario: Price of ETH Increases to $2,000
1. Arbitrageurs Trade in the Pool:
– When the external price of ETH rises to $2,000, arbitrageurs buy ETH from the pool until the pool price matches the external price.
– The new ratio of ETH to USDT in the pool will adjust to reflect the new price.
2. New Pool Balances:
– Let the new amount of ETH in the pool be x’ and USDT be y’ .
– The constant product formula x’ x y’ = 100,000 must hold.
– The new price of ETH in the pool is y’/x’ =2,000 (since 1 ETH = 2,000 USDT).
Solving the equations:
x’ x y’ = 100,000
y’/x’ =2,000 implies y’ = 2,000x’
Substituting y’ = 2,000x’ into the constant product formula:
In the previous post, you learned about the fundamental concepts of the Internet Computer Protocol (ICP), a third-generation blockchain designed to power the next evolution of the internet. At its core, ICP functions as a decentralized cloud, enabling developers to build and deploy applications entirely on-chain without relying on traditional centralized servers like AWS or Google Cloud.
You might be wondering—how is this even possible? To clear up any doubts, I will walk you through the process of creating and deploying an application on the Internet Computer. Unlike conventional web hosting, ICP allows you to launch apps without registering a domain name or provisioning a cloud server, leveraging blockchain-native web hosting for a truly decentralized experience.
Prerequisite
To start coding in IC(Internet Computer) , there are some prerequisites you need to set up or install before you can jump into developing your first app. Following are the prerequisites:
Ensure you have the supporting operating system-
Windows 10 or 11 with WSL2 installed with Ubuntu Linux v20.04
Mac OSX 12 or above
Ubuntu Linux v20.04
NodeJs v20
GitHub Account
IC SDK
Visual Studio Code IDE
Basic programming knowledge- JavaScript, CSS, HTML
Here are the references to install the or set up the prerequisites:
After installation, check its version using the command dfx –version, you should see something like dfx 0.24.3
*·If you are using a machine running Apple silicon, you will need to have Rosetta installed. You can install Rosetta by running softwareupdate –install-rosetta in your terminal.
The next step is to create an account in IC. In ICP, authentication requires a key pair consisting of a private and a public key, while the account itself is identified by a unique principal ID. Additionally, a ledger is needed to store accounts and transactions. This ledger is a smart contract known as a system canister. Each user will have a ledger account identifier, also called an account ID, which is used to hold ICP tokens. Furthermore, a wallet must be created to store cycles and facilitate sending cycles to and from canisters.
Creating ICP Account
To create an account in IC, using the following command:
dfx identity new <identity_name>
·💡Identity names must use alphanumeric characters comprising uppercase and lower letters, numbers and special characters. Example: My_chatb@t
·ℹ️Most importantly, REMEMBER to back up the 24-word account/identity seed phrase. This is essential for restoring your account if you forget your password or need to access it from another device. Additionally, you can create multiple accounts on your device.
Principal ID
Having created your account, you can obtain your principal id using the following commands:
In case you have changed your device and need to use the same account to develop ICP apps, you may import the 24-word seed phrase you have saved as a plaintext into your new development environment using the following command:
Follow the prompts to register your device . For Windows 10 user, require to use your mobile phone to scan the QR Code to store the credential information in the mobile phone. For Android device, recommend to use Google Lens to perform Passkey QR code scanning.
Note down your Internet Identity number (e.g., 12345).
ICP Account Address
To receive ICP tokens, you need an ICP account address associated with your Internet Identity. Here’s how to get it:
Once logged in, navigate to the “Accounts” section.
Plug Wallet
You may also use the Plug Wallet to store your ICP tokens. Plug wallet can be installed as a browser extension on a laptop or can be installed as a mobile app on your phone. You can download Plug Wallet using the link below.
The Network Nervous System (NNS) is the decentralized governance system aka DAO that controls and manages the Internet Computer (ICP), a blockchain-based computing platform developed by the DFINITY Foundation. The NNS is one of the most critical components of the Internet Computer, as it enables the network to operate autonomously and evolve over time through community participation.
Key Functions of the NNS
Governance:
The NNS allows ICP token holders to participate in the governance of the Internet Computer by submitting and voting on proposals.
Proposals can cover a wide range of topics, such as upgrading the protocol, adjusting network parameters, or funding ecosystem projects.
Token Economics:
The NNS manages the ICP utility token, including its minting, burning, and distribution.
It also handles the creation of cycles, which are used to pay for computation and storage on the Internet Computer.
Node Management:
The NNS oversees the addition, removal, and configuration of node machines that power the Internet Computer.
It ensures the network remains secure, scalable, and efficient.
Canister Management:
The NNS manages the lifecycle of canisters (smart contracts) on the Internet Computer, including their creation, upgrading, and deletion.
Network Upgrades:
The NNS facilitates seamless upgrades to the Internet Computer protocol without requiring hard forks or downtime.
This is achieved through a decentralized voting process.
ICP, short for Internet Computer Protocol, represents the third generation of blockchain technology, poised to revolutionize the Internet and accelerate the adoption of Web 3. Developed by the DFINITY Foundation , the Internet Computer blockchain aims to extend the public internet’s capabilities, allowing it to natively host software and services. In addition, it seeks to enable decentralized versions of popular applications—such as social media, enterprise software, and financial services—while fostering a new, decentralized internet that operates independently of traditional IT infrastructure.
The DFINITY Foundation, a non-profit organization founded by Dominic Williams in 2016 and headquartered in Zurich, Switzerland, achieved a major milestone with the launch of the Internet Computer in 2021. Dominic Williams, a serial entrepreneur, cryptographer, and DFINITY’s chief scientist, leads the foundation. With a team of over 250 scientists, researchers, and professionals, DFINITY is dedicated to building a public network that offers a secure, scalable, and efficient alternative to the current internet.
Dominic Williams
ICP boasts a unique architecture featuring independent subnet networks that run smart contracts known as canisters. Canisters are more powerful than traditional smart contracts, enabling more complex computations. Unlike conventional blockchains, ICP combines the security of blockchain technology with the scalability of cloud computing. Its core components include the Network Nervous System (NNS), which governs the entire network, and canisters—autonomous code units that operate on the Internet Computer.
In the Internet Computer, nodes are connected to form subnets, which are the fundamental building blocks of the IC. Each subnet operates its own consensus algorithm and runs canister smart contracts. Subnets replicate computation and storage while running concurrently with one another. The Internet Computer consists of numerous subnets and scales linearly by adding more, allowing for continuous expansion.
Subnets
Canisters are the building blocks of decentralized applications (DApps) on ICP, they contain both the code and state, making them more versatile than traditional smart contracts. Canisters run directly on the Internet Computer, without intermediaries. and enable developers to build complex DApps with ease. Benefits of using canisters are higher performance and scalability, and ability to handle complex logic and data storage.
ICP’s consensus protocol, known as Threshold Relay, introduces a novel mechanism that randomly selects nodes to produce blocks, ensuring both fairness and security. This protocol leverages chain key technology, enabling the Internet Computer to finalize transactions within milliseconds, a speed unmatched by most traditional blockchains. Additionally, the consensus algorithm ensures decentralization and security by eliminating the need for a centralized authority, promoting a more equitable and transparent internet. Compared to other consensus mechanisms like Proof of Work (PoW) and Proof of Stake (PoS), Threshold Relay offers significantly faster consensus, greater scalability, and lower energy consumption, making it a more sustainable and efficient solution for blockchain technology.
Canisters communicate via asynchronous messaging, allowing them to exchange data and execute functions without waiting for immediate responses. This enables canisters to continue other tasks while awaiting a reply, improving efficiency and scalability. Asynchronous messaging supports parallel processing, allowing distributed applications to run smoothly across the network. It also enhances fault tolerance, as messages can be retried without disrupting operations. This model ensures high responsiveness and performance, making the Internet Computer more scalable and reliable than traditional synchronous systems.
Canisters are precharged with “cycles,” which serve as the fuel for computation and storage, allowing them to run smoothly. These cycles are analogous to gas fees in other blockchains but are designed to be more efficient and cost-effective. Developers must ensure that their canisters are sufficiently stocked with cycles, which are consumed as the canister processes computations, stores data, or handles messages. One key advantage of this system is that users interacting with decentralized applications (dApps) on the Internet Computer are not burdened with transaction fees, unlike on traditional blockchains. Instead, the cost of running the canister is handled by the developers or organizations maintaining it. This user-friendly approach removes the friction of micro-transactions, offering a seamless and more accessible experience for users, thereby encouraging greater adoption of decentralized applications. Additionally, cycles are pegged to the cost of real-world computing resources, ensuring stability in pricing over time. This helps developers predict and manage operational costs more effectively while providing users with a fee-free experience.
Canister smart contracts have the unique capability to interact with Web2 systems, bridging the gap between traditional web services and decentralized blockchain applications. This means that canisters can communicate with existing Web2 APIs, databases, and services, enabling seamless integration with conventional web technologies. For example, a canister could fetch data from an external Web2 source, such as a financial API, or interact with cloud services like AWS, allowing decentralized applications (dApps) to utilize real-world data and functionality without needing to rely solely on blockchain-native data. This interoperability makes the Internet Computer highly versatile, as it allows developers to build dApps that can easily interact with both decentralized and centralized infrastructures. By enabling communication with Web2, canisters help ensure that blockchain-based applications can be integrated into the broader digital ecosystem, promoting smoother transitions from centralized systems to decentralized ones and broadening the use cases for blockchain technology in real-world applications.
Canister smart contracts have the capability to own and transact any cryptocurrency, allowing them to operate across multiple blockchain ecosystems. Unlike traditional smart contracts that are limited to a single token, canisters can manage and transfer various cryptocurrencies like Bitcoin, Ethereum, and more. This flexibility enables the creation of decentralized applications (dApps) that support multi-currency transactions, such as decentralized exchanges (DEXs) and cross-chain DeFi protocols. By facilitating seamless interaction between different cryptocurrencies, canisters enhance interoperability, security, and functionality, making the Internet Computer a versatile platform for innovative blockchain solutions.
Chain fusion in the Internet Computer (ICP) is a process where independent subnet blockchains can merge to increase scalability and efficiency. Subnets, which run smart contracts called canisters, operate autonomously but can be seamlessly combined when more computational resources are needed. This allows the Internet Computer to dynamically scale as demand grows, ensuring that decentralized applications (dApps) can handle increased traffic without performance bottlenecks. Chain fusion ensures interoperability, enhances resource allocation, and maintains the network’s security and decentralization, making ICP a flexible and scalable blockchain platform.
ICP tokens serve multiple essential functions within the Internet Computer (ICP) ecosystem. One of the primary roles is governance, where ICP token holders participate in decision-making through the Network Nervous System (NNS). By locking up ICP tokens to create neurons, users can vote on proposals related to network upgrades, policies, and development directions. The more tokens a user locks and the longer they are staked, the greater their voting power and potential rewards. This decentralized governance model ensures that the community actively shapes the future of the network.
In addition to governance, ICP tokens are used to fuel computation on the network by being converted into cycles, which act as the computational currency for running applications (canisters). Developers use these cycles to pay for processing power and storage, ensuring predictable and stable costs. ICP tokens also incentivize participation in the network by rewarding node operators and developers who contribute to the network’s security and functionality. While users are not directly charged transaction fees, ICP tokens are essential for the network’s operations, ensuring smooth and efficient interactions within decentralized applications.
The Network Nervous System (NNS) in the Internet Computer (ICP) is a decentralized, autonomous system responsible for governing the entire network. It acts as the control center, managing everything from the configuration of nodes to protocol upgrades, economic policies, and security measures. The NNS is crucial for maintaining the decentralized nature of the Internet Computer, as it allows decisions to be made transparently and collectively by the community of ICP token holders.
Here are the key functions of the NNS:
Governance: The NNS enables ICP token holders to participate in governance by creating “neurons.” Token holders can lock up their ICP tokens to form these neurons, which gives them the ability to vote on proposals related to network upgrades, protocol changes, and other decisions that affect the Internet Computer. Neurons can also submit proposals for consideration, and the NNS automatically executes approved proposals. The more tokens a neuron locks up and the longer the staking duration, the greater the neuron’s voting power.
Network Management: The NNS manages the configuration of the network by onboarding new node operators, setting up new subnets, and merging or upgrading existing subnets. It ensures that the network remains secure, scalable, and efficient by automating many aspects of its maintenance and operation. This includes distributing rewards to node operators and ensuring that resources are allocated efficiently.
Security and Economic Control: The NNS controls the economic system of the Internet Computer by regulating the creation and burning of ICP tokens, especially when they are converted into cycles (the fuel for computation). It also plays a role in ensuring network security by monitoring and addressing potential threats, such as malicious nodes, and coordinating responses to safeguard the integrity of the blockchain.
Motoko is a programming language designed specifically for building smart contracts and decentralized applications (dApps) on the Internet Computer (ICP) blockchain. Developed by the DFINITY Foundation, it is compiled to WebAssembly (Wasm) to ensure compatibility and efficient execution on the Internet Computer’s infrastructure. Motoko is a statically typed language, providing strong type safety and minimizing runtime errors, which is crucial for secure blockchain development. It follows an actor-based model, aligning with the Internet Computer’s asynchronous messaging system, enabling efficient, concurrent operations within decentralized applications.
Motoko also includes features tailored for blockchain development, such as automatic memory management (garbage collection), cryptographic functions, and built-in tools for managing cycles (the computation resource on ICP). Its syntax is accessible to developers familiar with languages like JavaScript or TypeScript, making it easier to adopt. With these features, Motoko simplifies the process of building secure, scalable, and efficient dApps on the Internet Computer, making it an ideal choice for developers in the blockchain space.
ICP (Internet Computer Protocol) plays a significant role in accelerating the adoption of Web3 by providing a scalable, efficient, and decentralized platform that extends the capabilities of the public internet. Unlike traditional blockchains, which often struggle with scalability and high transaction fees, ICP enables decentralized applications (dApps) to run at web speed, with low costs, and without relying on centralized infrastructure. This makes it easier for developers to build and deploy dApps that offer the same level of performance and user experience as traditional web applications, removing a major barrier to Web3 adoption.
Moreover, ICP’s architecture allows it to host not only smart contracts but also entire web services, making it possible to run decentralized versions of popular applications like social media, enterprise software, and financial services directly on the blockchain. Its governance system, powered by the Network Nervous System (NNS), ensures that the platform evolves through decentralized decision-making, creating a more equitable and transparent internet. By addressing key issues like scalability, decentralization, and user experience, ICP provides the infrastructure necessary to drive the widespread adoption of Web3, making decentralized applications more accessible to both developers and users.
If 2020 was the hottest trend for DeFi and 2021 NFT outshone DeFi, the blockchain industry in 2022 will be spearheaded by Metaverse, Web 3.0 and Decentralized Autonomous Organization (DAO) . Actually web3.0 supersede everything else we just mentioned.
Every revolution will profoundly changes people ways of living , social interaction, organization structure, work habits and more. For example, the industrial revolution turned farmers into factory workers, and the Internet enabled people to work remotely. Since the invention of the Internet by Sir Timothy John Berners-Lee, we have experienced Web1.0, the static read only web led by Yahaoo!, and Web2.0, the interactive web2.0 led by FAANG(F=Facebook, A=Amazon, A=Apple, N=Netflix, G=Google) without forgetting Alibaba, Tencent and Bytedance. Web1.0 is quite decentralized but Web2.0 is completely centralized as it is monopolized by FAANG and other huge conglomerates. With the invention of Bitcoin by Satoshi Nakamoto, the first application of blockchain, the concept of decentralized web aka web3 has begun to take shape.
Recent pheromonal that happened in the crypto space like ICO, DeFi, NFT and Metaverse are some of the first applications of web3.0. In web2.0, while you are enjoying good user experiences like able to publish your contents, stream videos on social media, create games and more, your data and are controlled and owned by FAANG and other big corporations, and worse still they collect and monetized your data. However, people are sicked of the manipulation of personal data and this sentiment is a driving force behind the emergence of web3.0, the web that allows you to read, write ad own your data. Among the Web3 ecosystems, decentralized autonomous organization stands up as the prominent game changer for the Web3 revolution.
What is DAO?
DAO is an organization managed by a community without a central authority where every decision is approved based on consensus. It is a stark different from the conventional organizations where the structure is hierarchical and decisions are made by the top management. Therefore, a DAO is much more democratic, transparent, and decentralized. On top of that, it usually has a shared vision to guide the direction of the DAO.
The concept of DAO is not new, it existed in ancient democratic systems like the Athenian Democracy and the present day cooperatives. However, these existing systems have flaws as they are managed and enforced by human beings and subject to misappropriations and abuses. In contrast, a blockchain-based DAO is powered and enforced by computer codes in the form of smart contracts . It is open for anyone to participate as long as they meet some basic requirements. Being autonomous means that smart contracts help run the majority of the processes with minimal human interference. Besides that, it builds trust among the trustless anonymous parties.
Over the past few years, DAOs have been gaining traction in the decentralized finance (DeFi) , NFT and the recent Metaverse spaces. The main objective of a DAO is usually to work on a project and manage funds. However, it can have many use cases such as proposal execution, crowdfunding, NFT-based investing , web3 education and more. Some of the established use cases of DAO are MakerDAO, Uniswap, Curve Finance, Aragon, ENS DAO and more.
How does DAO Works?
A core team from a community will initially design the DAO model, establish the governance and write the rules into smart contracts . The smart contracts are computer codes that lay out the framework by which the DAO is to operate. They are highly visible, verifiable, and publicly auditable so any member can fully understand how the DAO protocol functions.
The DAO operates based on consensus through voting by members. Any member can initiate a proposal by submitted it to the DAO protocol and all members can vote for the proposal. The proposal usually needs to achieve certain quorum of votes to get approved, for example 30% of the members voted for it.
In addition, the DAO should have a treasury to release funds needed by any projects. Ideally the funds are kept in a multisig wallet and released upon approval via consensus and signing by two third of the signers. The funds are usually issued by the DAO protocol in the form of tokens to enforce governance as each member can only join the DAO by holding governance tokens. Whenever a member submits a proposal or vote for a proposal, they need to spend a certain amount of tokens as gas fees. The funds are also needed to execute a project.
Funds raising is typically achieved through token issuance and sells tokens to the public via exercise like ICO or ICO to fill the DAO treasury. In return for their fiat money, token holders are given certain voting rights, usually proportional to their holdings. Once funding is completed, the DAO is ready for deployment. Sometimes early participants will receive airdrops from the protocol.
Metaverse is the newest buzzword not only in the gaming space but has proliferated into other industries. Large organizations are investing crazy amount of money into metaverse to create new applications on top of their current products and services.
One of the potential applications of metaverse is in the agriculture sector. Various technologies have long been employed in the agriculture sector to improve efficiency, reduce cost , increase yield via automation, AI, big data analytics and more.
One area which could see the implementation of Metaverse in agriculture is the use of AR/VR technologies in creating farming simulation for training of the workers. In fact, there is a big farm simulator called Pure Farming developed for PlayStation VR and Sony is investing in it. In addition, farm simulators for mobile phones are being developed.
On the other hand, the use of VR/AR technologies can help farms to save cost and increase yield via virtual crop management tools such as disease and pest control, soil quality survey, fertilizers administration , plants growth monitoring, harvesting and more. To implement the solution. sensors can be installed in the farm which are used to scan the crops. An agronomist needs only to use a VR headset, a tablet or a smartphone to retrieve information about the weather, temperature, plant health, fertilizer needs, and the time for harvesting.
In our case study, we will focus on durian, a tropical fruit that can be found in the Southeast Asian countries like Malaysia, Indonesia, Thailand and the Philippines. According to Wikipedia, durian is named as the “king of fruits”. The durian is distinctive for its large size, strong odour, and thorn-covered rind. Musang King is the most popular durian breed in Malaysia, named by the Chinese as “Mao Shan Wang” (猫山王), is the priciest of all durians. Musang King is known for its bright yellow flesh and is like a more an enhanced version of the D24.
Grafted durian trees usually start to bear fruits around 4 to 6 years after planting ; while seedlings usually take from 7 to 10 years but could be as long as 13 to 21 years, therefore it is a common practice to use vegetative propagation. The cost of planting durian saplings can be calculated from the size of the orchard and cost per sapling. Assuming we have a 200-acre land , cost per sapling is RM30 and the number of trees can be planted per acre is RM60, the initial cost (excluding the overhead cost) is 200x60x30=RM360,000. However, if we include the cost of buying the land, overhead cost like fertilizers, labour cost and more, the total cost would be millions.
Therefore, the orchard owner must look for various sources of funding. Conventional sources include from own pocket, relatives and friends, loan from financial institutions like banks and so forth. However, with the invention of decentralized finance(DeFi), orchard owners could raise fund via DeFi as a new source of funding without the need of intermediaries, it seems like a perfect solution. In addition, blockchain solutions like NFT and Metaverse as well as other advanced technologies could be adopted to better manage the durian orchard and produce better yield. Let us delve deeper into how these advanced technologies can really help the durian industry.
The proposed model is to create a durian metaverse that not only helps to raise funds but to better manage the durian orchard and produce much higher yield than conventional durian orchards. To begin with, we will create an NFT for each sapling which represent the real durian sapling as a digital twin. The NFTs can be created using the popular Ethereum blockchain or other popular layer 1 or layer 2 blockchains such as Polygon, Solana, Cardano and more. Each durian NFT will feature a smart contract that contains data like the ID of the sapling, price, terms and conditions for profit distribution, transferring of ownership, buying and selling, etc. The next step is to create a Metaverse that hosts an NFT marketplace for buying and selling of the durian NFTs. Prices of the NFTs should be much more than the actual saplings because NFT owners will enjoy the future benefits like profit from the sale of durians after harvesting, get to eat the durians for free and more. Besides that, an NFT can also be created for each fruit which can be sold to buyers via prebooking.
Building a Metaverse platform that houses an NFT marketplace, and a virtual orchard will provide an immersive experience for tree owners and visitors to engage in durian NFTs trading. In addition, the virtual orchard will be a digital twin of the real orchard where visitors and owners get to visit the orchard from the comfort of their homes. Besides that, tree owners will be able to monitor the growth of durian trees and check other data such as fertilizers administration, expected flowering and fruition time, expected number of fruits can be harvested during a season and more. Visitors who wish to buy the durians in advance could prebook the durians by purchasing the fruit NFT and use it to redeem the durian fruits after harvesting. Wholesale buyers can prebook the fruits of a whole tree and get special discounts via a special kind of NFT. Moreover, orchard owner can also create virtual tour of the orchard. Users who purchase the NFT ticket for the virtual tour will be entitled to visit the real orchard and savour the durians at no extra cost, maybe even entitled to stay at the homestay at the orchard for a special rate.
The Metaverse durian orchard will have a global reach where investors and buyers are not only from Malaysia but from all over globe, thereby enlarging the durian market immensely. Foreigners will be able to prebook the durians by purchasing the NFTs and get to enjoy the durians when they visit Malaysia in a future date, this is good for promoting tourism in Malaysia. On top of that, investors who wish to purchase the trees and hope to obtain a good return in the future can do so at the comfort of their homes from any part of the world and at any time, just one click away!