Skip to content

2. Synthetic Asset

Sasha Nechaiev edited this page Sep 19, 2021 · 1 revision

Synthetic Assets

1. Overview

Users can mint synthetic assets in the form of fToken (Flow Token), such as fEUR, fJPY, fXAU (Gold) etc to trade on underlying pricing fluctuation without actually owning the physical assets. These synthetic assets are over-collateralized using supported USD stable-coin such as aUSD (Acala Dollar). These synthetic assets can be used

  • as the basis for margin trading protocol
  • as general purpose stable-coin/currency for payments
  • as a sore of value where holders can deposit it into the money market to earn interest

2. Guides

Below are simple guidelines for

  1. check available liquidity pools
  2. mint fTokens
  3. redeem fTokens
  4. liquidate
  5. add more collaterals to a pool
  6. withdraw some collaterals from a pool

Testnet available tokens

Currency ID Symbol Description
0 LAMI Laminar network token for fees, rewards etc.
1 aUSD Acala USD stablecoin
2 fEUR EUR synthetic fToken
3 fJPY JPY synthetic fToken

2.1. Polkadot-UI User Guide

2.1.1. Check available liquidity pools

There are two types of liquidity pools:

  • baseLiquidityPoolsForMargin
  • baseLiquidityPoolsForSynthetics

They have the same structure and extrinsics but serve different purposes, reflected by their names.

Check Chain State of margin or synthetic liquidity pool Check

Use nextPoolId() to know pools that are available. Use pools to know how much liquidity the pool has. Note this includes the funds already used in collateral. Use identifyInfos to see details of

  • supported fToken
  • additional collateral ratio in permill e.g. 10% is input as 100000, it is the extra amount of collateral the pool chip in to provide for price fluctuation
  • bid and ask spread in permill, note this will be upgraded to pips in next version

Used collaterals - Check Chain State of syntheticTokens

Check Chain State for syntheticTokens module Use positions check funds used for collaterals for a particular pool and a particular fToken Convert hex to a decimal number, about 8k DOT used as collateral.

To decode the response you may need to add JSON types to your polkadot.js extension: Settings -> Developer. JSON types for syntheticTokens.positions:

{
  "Position": {
    "collateral": "Balance",
    "synthetic": "Balance"
  }
}

2.1.2. Mint fTokens

Use USD stablecoin as collateral to mint fEUR. mint

2.1.3. Redeem fToken

Deposit fToken back to obtain USD stablecoin collateral. The price fluctuation in-between time and spread taken by the pool would determine whether it is profiting or losing trade. Redeem

2.1.4. Liquidate

The current collateral ratio is re-calculated at every deposit/withdraw action with the exchange rate at the time. If the current collateral ratio is below the liquidation ratio which is defined per fToken, then the liquidity pool is open for public liquidation incentivized by a monetary reward. Liquidate

2.1.5. Add More Liquidity to Pool

Anyone can deposit more liquidity to a pool. Add collateral

2.1.6. Withdraw Some Liquidity from Pool

Only the pool owner can withdraw liquidity from the pool. Withdraw Collateral

2.2. DApp UI User Guide

Once logged on, navigate to the Swap page. Swap USD (ticker: aUSD powered by Acala Dollar) for any available synthetic assets such as Forex like Euro (ticker: fEUR), or gold (ticker fXAU). You can also swap your synthetic asset balance back to USD.

If there's more than one liquidity provider, you can choose amongst them for better pricing, collateral ratio or liquidity available.

swap

[TODO] We are integrating with block explorer providers for transaction details. Note: the Ethereum version has a savings account product where users can earn interest on the synthetic assets deposited. On Laminar-Chain or Polkadot as a whole, there are no interest-earning facilities like Compound yet. If you are interested in building one, please get in touch.