# friend.tech: Tokenizing Incentives for "friends"

By [Arhat](https://paragraph.com/@aplusb) · 2023-08-24

---

Imagine a world where you could invest directly in your closest friends' futures, not through loans or empty promises, but by literally owning a piece of their success.

This is what most SocialFi startups target to sell to most crypto users.

Friend.tech comes with a new model of fractionalized ownership in individuals through shared value keys. By aligning incentives between friends, they aim to catalyze and benefit from the realized potential of people worldwide, or **Twitter**.

What I like about them:

*   Novel economic model creates a **bidirectional market** where previously launched projects failed to gain traction. Allowing people to invest in each other monetizes the immense latent value of social connections.
    
*   Quadratic bonding curve algorithm provides mathematically sound price discovery and incentives. Built-in network effects as early adopters benefit from lower prices.
    
*   Keys track ownership shares on-chain. This enables transparent, auditable ownership and transfers.
    
*   Subject fees incentivize user acquisition by sharing value directly with token subjects.
    
*   Protocol fees provide a sustainable revenue stream to fund growth. Parameterization gives flexibility.
    

**I’ve also built an Excel model to calculate how much you would pay or receive while buying or selling keys.**

![](https://storage.googleapis.com/papyrus_images/5c265ba9f6e26323dd53c603c768706daa342827ba69b46d81de9d3d6867484d.png)

Please reach out to me on X at [**0xArhat**](https://www.x.com/0xArhat) for this Excel model.

* * *

*   Keys are minted for a specific "subject" (the person being invested in).
    
*   There are no checks on the subject address; anyone can create keys for any address.
    
*   Keys represent ownership of individual subjects. Based on current supply, the keys are fungible and priced using a custom pricing model (discussed in detail below).
    
*   The **sharesBalance** mapping tracks how many keys each address holds for each subject.
    
*   The **sharesSupply** mapping tracks the total supply of keys for each subject.
    
*   The buy and sell prices are calculated differently, with buy prices being higher than sell prices. This leads to a **bid-ask spread**.
    
*   There are **protocol fees** (paid to the company) and **subject fees** (paid to the key subject) on each trade. The fee percentages are configurable by the team.
    
*   The **buyShares** and **sellShares** functions handle the trading logic, updating balances, sending fees, etc.
    
*   No functionality to transfer keys, burn keys, etc. The keys are non-transferable once bought.
    

The pricing model incentivizes early investment as the price per key increases with higher supply. Fees are collected on each trade.

* * *

friend.tech uses a custom pricing model to price its keys based on supply.
--------------------------------------------------------------------------

The pricing formula is:

    sum1 = (supply - 1) * supply * (2 * (supply - 1) + 1) / 6
    
    sum2 = (supply - 1 + amount) * (supply + amount) * (2 * (supply - 1 + amount) + 1) / 6  
    
    price = (sum2 - sum1) * 1 ether / 16000
    

*   `sum2 - sum1` gives the incremental difference in summations
    
*   This incremental value represents the "area under the curve" for the additional keys
    
*   It is multiplied by 1 ether and divided by 16000 to scale it to an appropriate price.
    

This creates an incremental pricing model, where the price for additional shares is based on the incremental area under the quadratic bonding curve as supply increases.

> \---
> 
> _I think the key purpose of_ **_16000_** _is to scale down the raw calculation to a reasonable price range when operating in the ETH denominations._
> 
> _Some reasons 16000 was likely chosen:_
> 
> *   _It produces prices in a convenient range for small supplies._
>     
> *   _Allows representing prices precisely with minimal floating point rounding._
>     
> *   _Keeps overall share prices affordable as supply grows into the thousands._
>     
> *   _Provides ample headroom for supplies to grow substantially before prices get too large._
>     
> *   _Hardcoding a constant allows it never to change, avoiding governance manipulation._
>     
> 
> _The exact value is somewhat arbitrary but was likely chosen through trial and error to strike a good balance for expected supply ranges._
> 
> _The key is that it is hardcoded, avoiding the need for external governance of the pricing model._
> 
> \---

The properties of using the **custom pricing model** give it the mathematical characteristics needed to produce the desired exponential bonding curve behavior.

### Here's a breakdown:

1.  **AMM with Bonding Curve:** The contract implements an automated market maker (AMM) using a bonding curve for price discovery. The bonding curve utilizes a custom pricing formula to determine the price of shares based on the current supply. This custom formula results in exponential price growth as the supply of shares increases.
    
2.  **Trustless Trading without Order Book:** The contract enables trustless trading by tracking balances on-chain, meaning trades can be executed without a traditional order book. Participants can interact with the contract directly to buy and sell keys, and the contract calculates the prices based on the supply on the custom pricing model.
    
3.  **Incentives and Economic Mechanisms:** The contract is designed to provide the necessary incentives and economic mechanisms to align with the specific use case of Friend.tech. The bonding curve pricing model incentivizes certain behaviors, such as early buying, and discourages mass sell-offs, contributing to the desired economic dynamics within the friend.tech ecosystem.
    

What is a Bonding Curve?
------------------------

A bonding curve is a type of automated market maker algorithm used for pricing and distributing tokens or shares in a decentralized way.

The friend.tech contract implements a bonding curve for pricing the non-fungible keys; let me explain how it works:

As supply increases, the price increases quadratically based on the formula.

When buying keys:

*   The buy price is based on the current supply.
    
*   As more shares are bought, supply increases, so the price for new shares increases
    

When selling keys:

*   The sell price is based on the remaining supply after subtracting the shares being sold.
    
*   As more shares are sold, the supply decreases, so the sell price decreases
    

This relationship between supply and price creates the bonding curve:

*   Buying more shares increases supply, which increases the price.
    
*   Selling shares decreases supply, which decreases the price
    

The curve incentivizes early buyers with lower prices and disincentivizes mass sell-offs, which would significantly reduce the price

I’ve been playing around with it. Not buying any other keys. Just static.

![](https://storage.googleapis.com/papyrus_images/91c023ac30a0801b4170073e50bd31f67906f3b5e0f924954882e9d69294ba39.png)

And, The Curve Incentivizes Certain Behaviors in the Market.
------------------------------------------------------------

*   Early buyers pay less; later buyers pay more as the supply increases.
    
*   Buying tokens "bonds" them by locking up capital-- increases the price.
    
*   Selling tokens releases some "bonded" capital and causes the price to drop.
    
*   This creates a positive feedback loop where increased demand raises prices.
    
*   No external price discovery or intervention is required. According to the programmed curve, prices adapt organically based on buying and selling activity.
    
*   The curve incentivizes early adopters and behaves like an automated market maker.
    

The price equilibrium emerges organically from the interactions rather than being imposed.

* * *

While there have been certain reservations about how the contract can be used to maliciously revert fees & withdrawals, seeing reliable investors back friend.tech, in good faith, we can trust them.

[![User Avatar](https://storage.googleapis.com/papyrus_images/6affc4f07e5712406bcee8c4d714fb3eae7a8b81f0122665e21fb67fcc456772.jpg)](https://twitter.com/0xArhat)

[Arhat](https://twitter.com/0xArhat)

[@0xArhat](https://twitter.com/0xArhat)

[![Twitter Logo](https://paragraph.com/editor/twitter/logo.png)](https://twitter.com/0xArhat/status/1693896791589261696)

So the current design of FriendtechSharesV1 gives the team the ability to set the protocolFeeDestination to a malicious contract that could block withdrawals by reverting when it receives fees??  
  
security risk...  
  
The key points he raised:  
  
\- buyShares and sellShares rely on

 [![Like Icon](https://paragraph.com/editor/twitter/heart.png) 5](https://twitter.com/0xArhat/status/1693896791589261696)[

3:04 AM • Aug 22, 2023

](https://twitter.com/0xArhat/status/1693896791589261696)

Risks exist. Are we ignoring it? Who knows.
-------------------------------------------

*   Speculative asset class is controversial and invites skepticism.
    
*   Limited legal precedents exist around monetizing personal social capital and future potential.
    
*   Subjects must provide ongoing value to token holders to sustain capital inflows. Reputation risks if subjects underdeliver.
    

* * *

Thank you for reading through, and subscribe below for regular post updates.

I’d also appreciate it if you shared this with your friends, who would enjoy reading this.

You can contact me here: [Twitter](https://www.twitter.com/0xArhat) and [LinkedIn](https://www.linkedin.com/in/arhatbhagwatkar).

If you find this deep dive analysis useful, please consider donating to **0x1de17b6c736bcd00895655a177535c2a33c6feba** and/or by minting an NFT for this & other blog posts by me.

* * *

1.  [friend.tech contract code](https://basescan.org/address/0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4#code)

---

*Originally published on [Arhat](https://paragraph.com/@aplusb/friend-tech-tokenizing-incentives-for-friends)*
