-
Notifications
You must be signed in to change notification settings - Fork 25
2. Synthetic Asset
Synthetic Assets
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
Below are simple guidelines for
- check available liquidity pools
- mint fTokens
- redeem fTokens
- liquidate
- add more collaterals to a pool
- 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 |
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
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 as100000
, 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"
}
}
Use USD stablecoin as collateral to mint fEUR.
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.
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.
Anyone can deposit more liquidity to a pool.
Only the pool owner can withdraw liquidity from the pool.
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.
[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.