DEFI LIBRARY FOUNDATIONAL CONCEPTS

Token Standards and Asset Foundations For a Practical DeFi Guide

12 min read
#DeFi #Ethereum #Smart Contracts #Blockchain #security
Token Standards and Asset Foundations For a Practical DeFi Guide

Token Standards and Asset Foundations for a Practical DeFi Guide

In the world of decentralized finance, the term token can mean many things. From simple utility tokens that grant access to a service to complex derivatives that replicate real‑world assets, tokens are the building blocks that allow developers to create protocols that run without a central authority. Understanding the most widely used token standards, the foundations that give them meaning, and the quirks that can affect everyday DeFi operations is essential for anyone building, deploying, or using smart contracts on the blockchain.

Below we walk through the main token standards that dominate the space, explain how they underpin DeFi assets, and dive into a particular phenomenon—fee‑on‑transfer tokens that can have surprising effects on liquidity, yields, and user experience. This guide is meant to be actionable: you’ll find concrete examples, code snippets, and best‑practice recommendations that you can apply to your own projects.


Token Standards: The Language of Digital Assets

Token standards are formal contracts that define a common interface for a specific type of asset. They allow wallets, exchanges, and protocols to interact with any compliant token without needing custom code for each one. Below we cover the most common standards across the Ethereum ecosystem and briefly mention equivalents on other chains.

ERC‑20: The Classic Fungible Token

ERC‑20 is the foundational standard for fungible tokens—assets that are interchangeable and divisible, like USDC, DAI, or ETH itself when wrapped. The standard specifies functions such as totalSupply, balanceOf, transfer, and allowance. Developers rely on this interface to create liquidity pools, staking contracts, and cross‑chain bridges.

A key advantage of ERC‑20 is its simplicity and widespread adoption. Most wallets automatically recognize any token that implements the ERC‑20 interface, which lowers the barrier for user onboarding. However, this same simplicity can also hide problems; for example, the standard does not mandate a decimals function, so some tokens report balances in unconventional units, causing confusion.

ERC‑721: Non‑Fungible Tokens

ERC‑721 defines non‑fungible tokens (NFTs), which are unique and indivisible. Each token has a distinct ID and can carry metadata, ownership information, and royalty details. In DeFi, NFTs are increasingly used to represent collateral, governance rights, or even virtual land. The standard includes functions like ownerOf, transferFrom, and safeTransferFrom.

Because NFTs can be extremely diverse in design, many protocols add custom extensions—such as ERC‑1155 compatibility or on‑chain royalty information—to make them more usable within DeFi ecosystems.

ERC‑1155: Multi‑Token Standard

ERC‑1155 unifies fungible, semi‑fungible, and non‑fungible tokens under a single interface. It allows a contract to store multiple token types and transfer them efficiently in a single transaction. This batching capability reduces gas costs, which is particularly valuable for protocols that need to handle large volumes of assets—such as yield farming platforms or NFT marketplaces.

ERC‑1155 also introduces optional extensions, like royaltyInfo and metadataURI, making it flexible for both traditional DeFi use cases and creative NFT projects.

Other Standards

  • BEP‑20 (Binance Smart Chain) is essentially a copy of ERC‑20, but with a few minor differences that affect fee handling.
  • SPL (Solana) tokens operate on a different runtime and are comparable to ERC‑20 in functionality.
  • ERC‑777 adds advanced features like hooks for custom logic upon transfers, but its adoption remains limited.

Asset Foundations: From Liquidity to Synthetic Exposure

Token standards provide the interface; the actual asset is defined by the context in which it operates. In DeFi, there are three main pillars that give tokens economic meaning:

  1. Liquidity Pools – Pools of paired tokens that enable price discovery and provide liquidity for traders.
  2. Stablecoins – Tokens that aim to maintain a peg to an off‑chain asset (e.g., USD) to reduce volatility.
  3. Synthetic Assets – Tokens that represent real‑world commodities or securities, often created by locking collateral in a protocol.

Liquidity Pools and Automated Market Makers

The most ubiquitous DeFi construct is the automated market maker (AMM). Protocols like Uniswap, SushiSwap, and Balancer use a mathematical formula—usually x * y = k—to maintain an invariant that dictates price. LP tokens, which are ERC‑20 tokens issued by the pool, represent a share of the underlying pool and can be used for staking or yield farming.

Because LP tokens are ERC‑20 compliant, they can be deposited into other protocols, bundled into NFT collateral, or even sold on secondary markets. The design of the AMM influences how a protocol reacts to large trades, slippage, and impermanent loss.

Stablecoins and Peg Stability

Stablecoins are a cornerstone of DeFi because they provide a medium of exchange that behaves predictably. They can be fiat‑collateralized (e.g., USDC, USDT), crypto‑collateralized (e.g., DAI, sUSD), or algorithmic (e.g., Ampleforth, TerraUSD). Each model has its own risk profile and governance structure.

When a stablecoin is used as a base token in an AMM, its price stability reduces slippage for traders and creates more reliable arbitrage opportunities. For lenders and borrowers, stablecoins are the primary collateral in protocols like Aave or Compound.

Synthetic Assets

Synthetic assets replicate the price of a real‑world asset without owning it. They typically require a collateral ratio (e.g., 150%) to protect lenders from market movements. Protocols such as Synthetix issue synths that are ERC‑20 tokens pegged to fiat, commodities, or even other cryptocurrencies.

Because synths are backed by collateral, they can be used as collateral themselves in other protocols, leading to a layered ecosystem. However, the complexity of multi‑layered collateral can expose users to cascading risk. For a deeper dive into how synthetic assets behave, see Building a DeFi Library Understanding Fee On Transfer Tokens.


Fee‑on‑Transfer Tokens: Why They Matter

A subset of tokens implements a fee on transfer (FOT) mechanism: every time the token is sent, a portion of the transferred amount is deducted as a fee. The fee is usually sent to a treasury, burned, or redistributed to holders. While this design can incentivize long‑term holding and fund protocol development, it introduces subtle complications for DeFi protocols.

How FOT Tokens Work

Consider a token that imposes a 2% transfer fee. If you transfer 100 units, the recipient receives 98 and 2 units are sent to the treasury. In code, the transfer function may look like:

function transfer(address to, uint256 amount) public override returns (bool) {
    uint256 fee = amount * 2 / 100;
    uint256 amountAfterFee = amount - fee;
    _balances[msg.sender] -= amount;
    _balances[to] += amountAfterFee;
    _balances[treasury] += fee;
    emit Transfer(msg.sender, to, amountAfterFee);
    emit Transfer(msg.sender, treasury, fee);
    return true;
}

This logic is simple to implement, but the side effect is that any contract interacting with the token must be aware that the net amount received is less than the gross amount sent. AMMs, lending platforms, and cross‑chain bridges must account for the deduction, otherwise user balances will appear incorrect and operations can fail.

Impact on Liquidity Pools

In an AMM, the token’s net amount that enters the pool is less than the gross amount that the trader intended to swap. If the pool is not designed to handle fee‑on‑transfer tokens, the effective input amount will be smaller, causing higher slippage and potentially skewing the invariant. Some protocols add a wrapper contract that performs the transfer and immediately re‑adds the correct net amount to the pool.

For example, if a trader swaps 500 USDT (which charges a 1% fee) for DAI in a pool, they effectively deposit 495 USDT. If the pool interprets the input as 500, the price will be miscalculated, leading to an inaccurate trade outcome.

Effects on Yield Farming and Staking

Staking contracts that reward users with FOT tokens must adjust the reward calculation to compensate for the fee. A typical staking contract might transfer a reward amount R to a user, but the user will receive R * (1 - feeRate). If the contract’s accounting does not include the fee, the user’s actual earnings will be lower than expected.

Additionally, if a staking reward token itself has a transfer fee, users who stake their tokens may see a reduction in the amount that is ultimately credited, potentially dissuading participation.

Cross‑Chain Bridges and Wrapped Tokens

When bridging FOT tokens across chains, the bridging contract must consider the fee because the amount transferred from the source chain will be reduced before reaching the destination. Some bridges enforce a pre‑deduction step: the user sends the intended gross amount, and the bridge deducts the fee internally before minting the wrapped token on the target chain. If not handled correctly, users may receive fewer wrapped tokens than expected, breaking trust.

Governance and DAO Dynamics

Many FOT tokens are used by decentralized autonomous organizations (DAOs) to allocate funds for development or community rewards. The fee collected on transfers becomes a treasury that can be used for grants or protocol upgrades. Understanding how much is collected and how quickly it accumulates helps governance participants make informed decisions about budget and spending.


Practical Guidance for Building with Fee‑on‑Transfer Tokens

Below are concrete steps and patterns that developers and protocol designers can use to manage FOT tokens effectively.

1. Detect and Handle Transfer Fees

When interacting with a token, first check if it implements transfer or transferFrom in a way that emits a fee. Many projects expose a boolean isFeeOnTransfer flag or provide a feeRate view function. If such an indicator is absent, you can infer a fee by performing a test transfer and measuring the difference between the sent and received amounts.

uint256 balanceBefore = IERC20(token).balanceOf(address(this));
IERC20(token).transferFrom(msg.sender, address(this), amount);
uint256 balanceAfter = IERC20(token).balanceOf(address(this));
uint256 received = balanceAfter - balanceBefore;
uint256 fee = amount - received;

Use the received value in subsequent calculations.

2. Wrap FOT Tokens

Create a wrapper contract that stores the original token and exposes a standard ERC‑20 interface without the fee. The wrapper’s transfer and transferFrom functions call the original token’s functions internally, but return the net amount to users. This approach isolates the fee logic and allows other protocols to interact with the wrapper as if it were a regular token.

contract FOTWrapper is IERC20 {
    IERC20 public originalToken;
    mapping(address => uint256) balances;
    mapping(address => mapping(address => uint256)) allowances;

    function transfer(address to, uint256 amount) public returns (bool) {
        uint256 before = originalToken.balanceOf(msg.sender);
        originalToken.transferFrom(msg.sender, address(this), amount);
        uint256 after = originalToken.balanceOf(address(this));
        uint256 received = after - before;

        balances[msg.sender] -= amount;
        balances[to] += received;
        emit Transfer(msg.sender, to, received);
        return true;
    }
    // ... other ERC‑20 functions
}

3. Design AMMs for FOT Tokens

If you plan to support FOT tokens in your AMM, include an input multiplier that accounts for the fee. For instance, let f be the fee rate; the effective amount that the pool should see is amount * (1 - f). This can be implemented in the swap function:

uint256 effectiveInput = amount * (1e18 - feeRate) / 1e18;

Adjust the invariant calculation accordingly. Many protocols publish a list of supported FOT tokens and their fee rates.

4. Adjust Yield Calculations

When distributing rewards or calculating yields, multiply the reward amount by 1 - feeRate to reflect the net tokens the user will receive. If your protocol also needs to consider gas costs associated with extra transfers (e.g., transferring to the treasury), factor these into the reward model.

5. Bridge Smartly

For cross‑chain operations, design the bridge to collect the fee on the source chain before minting the wrapped token. The bridge’s logic should be:

  1. Pull the gross amount from the user.
  2. Transfer the gross amount to the bridge contract.
  3. Receive the net amount after fee deduction.
  4. Mint the wrapped token on the destination chain with the net amount.

This ensures that the wrapped token’s supply accurately reflects the user’s net holdings.

6. Governance Protocols

If you are running a DAO that collects fees, publish the fee schedule and the allocation plan. Transparency builds trust among token holders and ensures that community members understand how the treasury is used. For a comprehensive discussion on how DAOs can manage fee‑on‑transfer tokens, refer to the advanced post on DAO dynamics.


Case Study: A Yield Farming Protocol Integrating Fee‑on‑Transfer Tokens

Setup

Suppose you’re building a yield‑farming protocol that rewards users with fee‑on‑transfer tokens. The protocol needs to handle the transfer fee both when users deposit and when they claim rewards.

Step 1: Wrap the Reward Token

Deploy a wrapper contract to isolate the fee logic. This allows the rest of the protocol to treat the reward token as a standard ERC‑20.

Step 2: Adjust the AMM

If the protocol’s liquidity pool accepts the wrapped FOT token, the AMM should calculate the effective input using the input multiplier described above. This prevents slippage issues during swaps.

Step 3: Yield Adjustment

When users claim their rewards, the protocol must reduce the claimed amount by the transfer fee. This can be achieved by using the effectiveInput formula for the wrapped token before distributing rewards.


Conclusion

Fee‑on‑transfer tokens bring both benefits and challenges to the DeFi ecosystem. By detecting transfer fees early, wrapping tokens, and designing AMMs, yield farms, bridges, and governance structures that account for these fees, you can build robust and reliable DeFi protocols. For deeper insights into how synthetic assets, AMMs, and DAO governance interact with fee‑on‑transfer mechanisms, refer to the advanced posts above.


Questions? Feel free to reach out on the community forum or contribute to the open‑source codebase.


Token Standards Overview

Fee-on-Transfer Mechanism

Sofia Renz
Written by

Sofia Renz

Sofia is a blockchain strategist and educator passionate about Web3 transparency. She explores risk frameworks, incentive design, and sustainable yield systems within DeFi. Her writing simplifies deep crypto concepts for readers at every level.

Discussion (11)

DE
deFiGuru 2 months ago
Really, the ERC‑20 spec sets a hard standard for fungibility, and every token that says it’s ERC‑20 must expose the totalSupply, balanceOf, transfer, and approve functions exactly. Consequently, when you swap on Uniswap, the router calls transferFrom and expects the allowance to be set, otherwise the transaction will fail.
BL
blockchainBabe 2 months ago
Yeah, that’s spot on! I’ve seen newbies drop ERC‑20 tokens that mis‑implement totalSupply, and their trades just die. If you’re building, double‑check the decimals field; a typo there makes your token 1000× smaller or bigger than expected.
BL
blockchainBabe 2 months ago
Um, I’m not sure I get this. Are ERC‑721 tokens the same as regular NFTs? And do I need to use a separate wallet for ERC‑1155? Because I’ve only had one address so far.
CR
cryptoNewbie 2 months ago
Last month I swapped a batch of newly minted ERC‑1155 NFTs on a game launch, and the marketplace bot was expecting a single token ID, but the contract sent a batch transfer. I fixed it by calling safeBatchTransferFrom with the correct array, and that resolved the issue. Lesson: always test the transfer path before listing.
ET
ethie 2 months ago
I was in the same boat! I thought ERC‑721 was just a fancy NFT wrapper, but you’re right—ERC‑721 is the standard that gives each token a unique ID. ERC‑1155 is a whole other beast that lets you bundle both fungible and non‑fungible items, so you’ll need a wallet that supports that standard if you want to move them all.
ET
ethie 2 months ago
I added a new ERC‑20 token and my balance shows 0.1 but the explorer shows 100. I think I messed up the decimals. Any quick fix?
N0
n00b123 2 months ago
You’re so right, but I’m still learning. I added a new ERC‑20 token and my balance shows 0.1 but the explorer shows 100. I think I messed up the decimals. Any quick fix?
N0
n00b123 2 months ago
I’m so confused, but I’ll try resetting the decimals to 18 and see if that fixes the issue.
WA
walletWhiz 2 months ago
Honestly, I’ve coded 10 different ERC‑20 contracts in a week, and the community still questions my work. I think I can teach everyone to write flawless tokens in a single day. Trust me, you’ll be impressed.
ME
memeMaster 2 months ago
WOWWW!!! THIS IS THE BEST POST EVER!!! ㅋㅋㅋㅋ.
BL
blockchainBabe 2 months ago
I just saw that post and it’s hilarious. But seriously, if you’re adding new tokens, always test on a testnet first. It saves a lot of headaches.
SK
SkepticSam 2 months ago
I’m not convinced that all these standards are necessary. Why can’t we just have a single contract that handles fungible and non‑fungible tokens? It feels overengineered.
SK
SkepticSam 2 months ago
Actually, ERC‑20 tokens are not Bitcoin. ERC‑20 is a standard on Ethereum that defines how tokens behave. Bitcoin is a separate protocol, so you can’t just call another token a Bitcoin copy. The standards exist because Ethereum can host many different assets.
SK
SkepticSam 2 months ago
I’m not convinced that all these standards are necessary. Why can’t we just have a single contract that handles fungible and non‑fungible tokens? It feels overengineered.
RA
randomUser 2 months ago
I think ERC‑20 tokens are just fancy names for Bitcoin. They’re basically the same thing, right? Because Bitcoin is the original token, so any other token is just a copy.
SK
SkepticSam 2 months ago
Actually, ERC‑20 tokens are not Bitcoin. ERC‑20 is a standard on Ethereum that defines how tokens behave. Bitcoin is a separate protocol, so you can’t just call another token a Bitcoin copy. The standards exist because Ethereum can host many different assets.
QU
quickie 2 months ago
Just saw that fee‑on‑transfer tokens can mess up your yield farming. Like, it’s super annoying.

Join the Discussion

Contents

quickie Just saw that fee‑on‑transfer tokens can mess up your yield farming. Like, it’s super annoying. on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
randomUser I think ERC‑20 tokens are just fancy names for Bitcoin. They’re basically the same thing, right? Because Bitcoin is the... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
SkepticSam I’m not convinced that all these standards are necessary. Why can’t we just have a single contract that handles fungible... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
SkepticSam I’m not convinced that all these standards are necessary. Why can’t we just have a single contract that handles fungible... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
memeMaster WOWWW!!! THIS IS THE BEST POST EVER!!! ㅋㅋㅋㅋ. on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
walletWhiz Honestly, I’ve coded 10 different ERC‑20 contracts in a week, and the community still questions my work. I think I can t... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
n00b123 You’re so right, but I’m still learning. I added a new ERC‑20 token and my balance shows 0.1 but the explorer shows 100.... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
ethie I added a new ERC‑20 token and my balance shows 0.1 but the explorer shows 100. I think I messed up the decimals. Any qu... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
cryptoNewbie Last month I swapped a batch of newly minted ERC‑1155 NFTs on a game launch, and the marketplace bot was expecting a sin... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
blockchainBabe Um, I’m not sure I get this. Are ERC‑721 tokens the same as regular NFTs? And do I need to use a separate wallet for ERC... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
deFiGuru Really, the ERC‑20 spec sets a hard standard for fungibility, and every token that says it’s ERC‑20 must expose the tota... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
quickie Just saw that fee‑on‑transfer tokens can mess up your yield farming. Like, it’s super annoying. on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
randomUser I think ERC‑20 tokens are just fancy names for Bitcoin. They’re basically the same thing, right? Because Bitcoin is the... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
SkepticSam I’m not convinced that all these standards are necessary. Why can’t we just have a single contract that handles fungible... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
SkepticSam I’m not convinced that all these standards are necessary. Why can’t we just have a single contract that handles fungible... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
memeMaster WOWWW!!! THIS IS THE BEST POST EVER!!! ㅋㅋㅋㅋ. on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
walletWhiz Honestly, I’ve coded 10 different ERC‑20 contracts in a week, and the community still questions my work. I think I can t... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
n00b123 You’re so right, but I’m still learning. I added a new ERC‑20 token and my balance shows 0.1 but the explorer shows 100.... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
ethie I added a new ERC‑20 token and my balance shows 0.1 but the explorer shows 100. I think I messed up the decimals. Any qu... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
cryptoNewbie Last month I swapped a batch of newly minted ERC‑1155 NFTs on a game launch, and the marketplace bot was expecting a sin... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
blockchainBabe Um, I’m not sure I get this. Are ERC‑721 tokens the same as regular NFTs? And do I need to use a separate wallet for ERC... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |
deFiGuru Really, the ERC‑20 spec sets a hard standard for fungibility, and every token that says it’s ERC‑20 must expose the tota... on Token Standards and Asset Foundations Fo... Jul 28, 2025 |