LogoLogo
Frictionless Markets
  • Welcome to Frictionless Protocol
  • Protocol Overview
    • How it works
    • Participants
    • Protocol Roadmap
  • SMART CONTRACTS
    • Overview
    • Audit & Security
    • Smart Contract Docs
      • Frictionless Tokens
        • IBasicFrictionlessToken
        • IFrictionlessTokensFactory
        • IFrictionlessOnChainAssetToken
        • IFrictionlessDigitalSecurityToken
        • IFrictionlessFundDepositToken
      • Compliance
        • IFrictionlessComplianceModule
        • IFrictionlessComplianceFactory
        • IFrictionlessModularCompliance
        • AbstractFrictionlessComplianceModule
      • Automated Fee Collection
        • IAbstractFeeModule
        • AbstractFeeModule
      • Manager Contracts
        • IFrictionlessTransferManager
        • IFrictionlessAttestationManager
        • IFrictionlessTreasuryManager
        • IFrictionlessPermissionsManager
      • ERC20 Swaps
        • IFrictionlessERC20ConverterManager
      • Frictionless FX Swaps
        • IFrictionlessFXSwap
    • Source Code
    • Deployments
      • Institutional Deposit Tokens
  • API
    • Overview
    • Security & Access
    • Frictionless Markets APIs
    • License
Powered by GitBook
LogoLogo

Copyright © 2024 Frictionless Markets S.à.r.l

On this page
Export as PDF
  1. SMART CONTRACTS
  2. Smart Contract Docs

ERC20 Swaps

PreviousIFrictionlessPermissionsManagerNextIFrictionlessERC20ConverterManager

Last updated 1 year ago

ERC20 Swaps were designed by the developers in the Frictionless protocol to risk off permissionless stablecoins such as USDC or USDT.

Permissionless are a great innovation from the crypto markets which were designed for permissionless crypto referencing to US Dollars, however handling stablecoins for traditional institutional partners is still a risky proposition.

Using the ERC20 Converter contracts, FrictionlessFundDepositTokens can be converted to/from stablecoins using the Frictionless protocol to help Managers accept stablecoins whilst off-loading their associated risks, such as de-peg events, underlying community bank reliance and liquidity risks.

The PROTOCOL_TREASURY manages the on/off ramp of the ERC20 stablecoin, such as USDC/USDT within its fund structures of FRICTIONLESS MARKETS SECURITIES FT.

The availability of a valid configured ERC20 token for conversion to/from FrictionlessFundDepositToken along with the associated fees is transparent, any market participant may query the smart contract.

The principle of an ERC20 Swap is simple.

  1. The PROTOCOL_ADMIN defines the valid token pairs which are convertible on a 1:1 basis.

  2. Fees can be optionally defined for the conversion to/from the ERC20 token.

  3. The holder (Investor) of ERC20 tokens invokes the convertFromERC20function of the smart contract, the ERC20 tokens are sent to the PROTOCOL_TREASURY and a matching amount of FrictionlessFundDepositToken is minted and sent to the holder (Investor).

  4. If the Investor wishes to convert their FrictionlessFundDepositToken to a valid configured ERC20 token, such as USDC/USDT, then they can invoke the convertToERC20function of the smart contract. In this case, the PROTOCOL_TREASURY will receive the FrictionlessFundDepositToken and burn it, transferring the matching amount of ERC20 (less any fees) to the Investor.

An example of two live ERC20 swaps on the Avalanche C-Chain are;

In these swaps, you can observe the collection of optional fees and the atomic settlement of the swap of the fsUSD tokens with USDC into the PROTOCOL_TREASURY.

USDC swapped for fsUSD
fsUSD swapped for USDC
Schematic of a Frictionless ERC20 (USDC stablecoin) Swap
Frictionless ERC20 Swap - USDC for fsUSD with automatic fee collection
Frictionless ERC20 Swap - fsUSDC for USDC with no fee collection