Learn the latest industry developments, reviews of the relevant trends
in Blockchain, TRADFI, Funds, Smart Contracts

DeFi 101 - Decentralized exchanges, Lending & the decentralized fund

Blockchain technology has become a true innovation powerhouse in recent years.

In 2021, it’s estimated that the total market cap of blockchain solutions is well over $1 trillion, and even hedge funds from all over the world are starting to explore this new exciting area.

More specifically, they’re looking for ways to capitalize on the latest advancements and are even playing with the idea of holding crypto on behalf of their investors… a major step that would send the value of crypto solutions even higher!

Problem is, even though most funds buy certificates for Bitcoin and other cryptocurrencies… they don’t yet have the capabilities to hold these coins themselves.

That’s where we at CPI Technologies come in.

We’ve already helped several financial service providers to get into crypto, and now we’ve decided to write an in-depth article that reveals the most important things.

You’ll get a deeper understanding of so-called “Decentralized Finance” (DeFi) products, including relevant examples that you can model yourself. This part will help you paint a better picture of how a fully decentralized hedge fund could really look like.

Let’s jump in.

The number of hedge funds and asset management companies that are implementing DeFi products into their portfolios is rapidly increasing.

Here a few recent examples:

  1. — With dHedge, everyone — no matter if they are a licensed hedge fund or not — can create a decentralized hedge fund on the Ethereum blockchain. Investors can invest their funds directly in so-called “smart contracts”, and some hedge funds are already represented here. They have full control over how the allocation should look like and how the funds should be invested… however, in terms of asset allocation and fund maintenance, it’s still very limited. That being said, dHedge holds a lot of promise and it all depends on what Synthetix, the development team will add on later
  2. — Numerai is based on a single hedge fund, which “outsources” its trading activities with a competition to data-scientists. Everyone interested in developing trading algorithms can participate in it and submit their algorithm via a smart contract. The hedge-fund operates in the “classic” way with bank accounts and trading via centralized exchanges — but the decision of what is traded comes from the crowd-sourced intelligence from the algorithm itself. All algorithms are tested against each other and only the best ones are taken into consideration as a trustworthy source for trading. This article explains the concept in more detail: — the idea of letting AI scientist compete against each other is very interesting. Unfortunately, holders of NMR (the token of Numaire) are not really participating from the profits of the fund, so it’s still a central fund that makes use of decentralized components.

As you can see, these emerging technologies hold a lot of potential and they’re all based on DeFi.

But to fully understand the opportunity of the 2 examples above, it’s important to understand what a token along with a smart contract actually is on a fundamental level.

What is a token?

Put simply, a token is a custom currency on a blockchain.

For example, the main coin on the Ethereum blockchain is Ether (ETH). At the moment of writing this article, 1 ETH is worth 1.800 USD… and it’s actually one of the best-performing assets of the last few years.

On the Ethereum Network, everybody can create their own Tokens by using a pattern of smart contracts (explained in the next section), but the most used pattern is ERC20 — developed by Fabian Vogelsteller.

On the other hand, the now popular NFTs (non-fungible tokens, explained in a separate article) use the ERC721 standard, for example.

Probably the best thing about the Ethereum blockchain is that anybody who owns ETH can write their own smart contracts using ERC20 generators like this one:

What is a smart contract?

A smart contract is essentially a few lines of code in the Ethereum blockchain via the programming language “Solidity”.

A smart contract can be created by anyone who has some ETH in a wallet.

Now, the thing that makes smart contracts special is that — when somebody publishes a smart contract to the Ethereum network — its source code becomes public info to everybody on the blockchain, so it’s completely transparent.

After its publication, it’s impossible to change a given smart contract’s code… instead, it will stay forever the same process, written forever in the blockchain with the forever same code.

Also, the smart contract has its own Ethereum address, which can send and receive ETH or any token if this is programmed in its source code.

Everything that happens in the smart contract is public and visible to everyone who knows the address of the smart contract.

But why is this useful?

Here’s a quick example:

Let’s say I want to exchange the 1 ETH I have in my wallet with you for 100 of your uniquely-created tokens (let’s call it the MY-Token — short MYT).

And let’s say we discuss the pricing via email and agree to the price of 1 ETH for 100 MYT.

Problem is, in this scenario, we don’t know each other very well and no one can trust the other party in that they’ll actually fulfill THEIR part of the agreement.

This can lead to a lot of uncertainty and potential for scams.

So what can you do about this to minimize or even completely eliminate risk?

If you were to go to traditional lawyers, they would create a “purchase agreement” which we would both print out and sign. This creates trust, as we now agreed in written form, that we both stand to our word — otherwise we could file a case to a court.

However, this is a slow, expensive, and limited process.

What if you want to do these deals en masse and very rapidly?

That’s where smart contracts come in.

By using a smart contract, it’s no longer necessary to sign a written contract — the blockchain’s ledger does that for us.

For example, let’s just imaging one of us creates a smart contract, in which is following rules are written in programmed code:

  • One participant sends 1 ETH to the contract.
  • One participant sends 100 MYT to the contract
  • After both did that with the appropriate amounts, they will receive what was sent from the counter-party. The smart contract will then delete itself after successfully executing both transactions.
  • If only one party sends the correct amount to the smart contract — but the other party doesn’t — there will be a refund after e.g. 1 week of creating this smart contract.

As a result, with the help of a smart contract, we can both now make this deal with complete confidence because both of us have “read” the rules of the smart contract via the public source code…

And we both know that it’s impossible to change the rules since the source code is not changeable after publishing it.

In other words, we don’t have to “trust” or even know the other person because we can trust the smart contract itself — without an expensive intermediary such as a lawyer.

We both know that — when the other party fulfills its promise — both sides will get what was agreed.

And if one side breaks the deal, the other side has no risk, as the smart contract will refund automatically.

We can be 100% sure because we can both read the source code, and see what will happen in cases A, B, C.

This is just a simple example of how smart contracts can be used, and it’s no wonder that many organizations have already started using this technology.

In fact, there are several examples of decentralized exchanges that work fully autonomously by smart contracts with the same concept, but of course, they’re more advanced than this simple example.

Here are some of the most common of these:

DeFI products in action: 3 specific applications

1 — Decentralized exchanges

The following graphic shows how these decentralized exchanges work in a very simple way:

Relation of traders and liquidity providers in a decentralized exchange platform as Uniswap or 1inch

Just like any other exchange, decentralized exchanges need liquidity to facilitate trading, reserves of many different values stored, so that people can exchange one value to another (for example ETH => USD-C).

So to increase liquidity, people who own coins or tokens can simply deposit them in the smart contract of the exchanges. As exchanges usually take fees from traders (ex: Uniswap 0.3%), these fees will be 100% distributed to the liquidity providers, depending on how much % they own of the liquidity pool.

This is how people who hold coins and tokens long-term can earn interest payments on their deposits in a fully decentralized way.

2 — Decentralized insurances

Another common use-case for smart contracts are insurances.

Take a recent project called Etherisc ( for example. Using their service, you can easily get insurance for things like your flight… and if there’s any delay, you will get compensation handled exclusively through a fully decentralized smart contract:

Here’s an illustration showing this use case:

How decentralized insurance work, illustrating Etherisc flight-delay product as an example

In this case, Person 1–3 insure their flights for delays.

They pay an assurance fee into the smart contract of the insurance, and this smart contract will create so-called “oracles” that are basically trustworthy connections to real-world data outside the blockchain (in this special case, a trustworthy provider of data would be any government flight security commission that reports about flight delays).

One famous vendor for oracles is Chainlink (LINK — ).

Through their service, if the oracle reports that there was a delay in one flight that was higher than N hours (a number specified in the insurance policy), the person who assured this flight gains the right to claim compensation from the insurance contract.

Moreover, the source code of this smart contract can even include details specifying that — in this case — the person in question can only claim compensation once for the delay.

And best of all: because of the decentralized nature of this system, there’s no need for people to get involved in handling the insurance cases!

Everything happens automatically, instantly, and securely for all participants.

And as for the decentralized exchange, the technology even allows investors themselves to add liquidity to the smart contracts of the insurance products and share in the profits generated.

3 — Lending / Borrowing / Saving

One last example for DeFi products is “Lending”.

Everybody who holds any type of coins can now put them into a so-called “Saving” smart contract, offered for example by Compound (

Borrowing and lending in DeFi world. Without any intermediary.

In this case, let’s say that I’m a crypto holder that wants to borrow money, as I have to pay my invoices, taxes, and am currently out of cash… but at the same time, I don’t want to sell my crypto portfolio to pay for this.

With the help of DeFi, I can now put parts of my portfolio as “collateral” into the lending smart contract, and receive a credit in ETH or other stable coins.

I can then exchange these values for fiat currencies and pay my invoices with them.

And when done, I can remove the collateral from the smart contract.

Of course, any interest paid for the loan will be received by the liquidity provider of the lending contract who put their stable coins (or other coins) into it.

It’s a win-win situation for everyone: Person 1 can pay their invoices without having to sell their portfolio, and the people who provided the necessary liquidity received interest on their deposited funds.

And again, as with all decentralized products, ALL of this is happening without an intermediary. You only need peer-to-peer via a smart contract.

The decentral hedge fund

After explaining several DeFi products and how they work, let’s now look at how a fully-decentral operating hedge fund could work… and explain the example draft of CPI for this.

The draft concept for a decentral hedge fund using blockchain technology and smart contracts, connecting to different DeFi products and holding/trading assets.

As we are talking about a fully decentralized product, all investment and trading activities should happen via a smart contract that adheres to the following criteria:

  • It allows anyone to buy/sell/hold tokens, wrapped blockchain currencies (Bitcoin, Dash, etc.), Wrapped Stocks, Wrapped metals (gold, silver, etc.), other tokens, by using different decentralized exchanges (always use the cheapest)
  • It can interact with other DeFi products and provide liquidity for them (ex: for insurances and decentralized exchanges) and receive the fees that were generated through them
  • it makes sure that only the owning hedge-fund can execute investment and allocation decisions into the smart contract. These decisions can come from people working in the hedge-fund or from a trading bot based on artificial intelligence that submits its decisions to the smart contract
  • Everyone in general who deposits liquidity in this smart contract will benefit from the profits generated by it. How exactly investors profit can be up to the owning hedge-fund which defines the rules
  • The hedge-fund receives a % management fee of the profits generated by the smart contract, deducted from the profits distributed to the investors for providing it with the investment and allocation strategies. The management fee amount is transparently visible for all investors — as all activities happen on the public blockchain

In the graphic above, you can see both green and blue elements.

The blue elements could represent any investor who gets aware of the project and decides to deposit its funds into the smart contract.

His funds will now be used for trading and he can participate from the profits generated by the project (of course, the hedge-fund will always receive the management fee from the profits first)

So that means that everyone can invest in the fund, even small or medium-sized investors.

As the hedge-fund never owns the funds that are deposited, technically and legally speaking, they are not in your property or custody, as the smart contract would not allow the withdrawing of deposited funds. Instead, all funds are locked inside it.

Withdrawals outside of the smart contract are only possible for:

  • Investors who want to withdraw their deposits + generated profits
  • The hedge-fund to withdraw their management fee

This means that no one at the hedge-fund can withdraw all funds from the smart contract and touch funds belonging to investors. It’s a very safe system.

Another thing: when launching such a project, it makes sense to create a new token that represents the investment for an investor.

For example, for every investment of 1.000 USD, the investor would receive 100 Tokens (let’s call them “Hedge-Fund Tokens”; HFTs in further examples) as a representation of their investment; equivalent to certificates in the classical world.

He can then always use these tokens to claim back his deposit & profits OR sell them to someone else directly or via an exchange (then this token becomes something similar to an ETF).

Now, when it comes to the GREEN color in the image above…

This represents the classical investor as we have them in Phase 1, who doesn’t know anything about crypto or investing in FIAT currencies (USD, EUR) at all.

In their case, they’ll still deposit funds in fiat in the bank account of the hedge-fund…

And they’ll still convert these funds into cryptocurrencies (ex: stable coins in USD) and add them to the smart contract.

By doing this, the hedge-fund will receive the HFT-Tokens just like any crypto investor.

The same amount as in HFT will be issued to the classical investors in regulated certificates, which they can then deposit at their broker.

Once again, this technology is building the bridge between the classic and the new decentralized world by having a licensed hedge fund and the allowance to emit certificates.

When a classical investor wants to cash out, he will transfer back the certificates from his broker to the hedge-fund.

The hedge-fund is holding his HFT-tokens, so it will claim the deposit + profits from the smart contract, receive it in crypto, exchange it back into fiat currencies and pay out the investor with it (by deducting a handling fee for this process).

A fully decentralized hedge-fund smart contract could allow both: open for everybody to invest OR just for people selected and approved by the hedge-fund.

We hope you enjoyed this ultimate guide on how hedge funds can use DeFi to unlock new growth opportunities!

If you feel like you and your organization can benefit from something like this, feel free to reach out at

Note: All rules and processes described above are subject to be changed in development processes and can be customized to the needs of the customer. Feel free to consult CPI Technologies for more information about smart contract development, tokenomics, or general questions about this article.

Disclaimer: This article is not investment advice. Cryptocurrencies and DeFi products are high-risk investments that could lead to a total loss. The explanations of the projects described in this article are created by the due diligence of CPI Technologies and could be incomplete, wrong, or outdated. Always do your own due diligence before investing. CPI Technologies GmbH is not liable for any content given in this article or responsible for any loss based on this information. Again: Please do your own due diligence before implementing this!

Financial Software
that sells


CPI Technologies GmbH, Anni-Eisler-Lehmann-Str. 3, 55122 Mainz, Germany

+49 6131 48 99 003

Newsletter Signup

Join our community and receive the latest news & updates about our company and our offers

Follow Us

Visit & follow CPI Technologies at our social media accounts: