AMM 101
Last updated
Last updated
Unlike on EVM, simply using a contract address is not enough to identify FTs on FVM. The unique identifier for FT is composed of: A.16-byte
-address.name
.
For example:
A.b19436aae4d94622.FiatToken
is USDC's unique identifier on mainnet.
Also ceWETH
and ceWBTC
(Celer-Bridged wETH & wBTC from ETH) are deployed under the same address but with different identifiers: A.231cc0dbbcffc4b7.ceWETH
, and A.231cc0dbbcffc4b7.ceWBTC
.
FT on FVM conforms to the FungibleToken
. One specific FT is represented as a Vault resource and stored directly under the holder' account storage area.
So each FT is also associated with several used to interact with it. Check the tokenlist
file for FT details on mainnet.
Unlike FT on EVM, one cannot 'airdrop' FT to arbitrary address without the receiver account first initializing the FT resource once (using FT.createEmptyVault()
method).
Example transaction: init_usdc_vault.cdc
The initialization only needs to be done once per holder account for one specific FT. After that any further action like: deposit / withdraw / etc. can be performed flawlessly.
*Note: FlowToken
is also FT but it's the only exception that it doesn't need initialization - as the init step has been performed when the account is created.
Check Uniswap-V2 whitepaper here: