This guide provides step-by-step instructions for integrating Aptos and Aptos assets into an exchange. It covers essential topics such as tracking balances, transferring assets, and testing your integration.
Overview
This document will walk you through the key tasks required for Aptos integration:
- Setting up infrastructure
- Understanding address standards
- Navigating asset standards
- Retrieving balances
- Tracking balance changes
- Transferring assets
- Testing your integration
Infrastructure Setup
We recommend running your own Aptos full node to interact with the Aptos blockchain. This approach enables you to:
- Query the blockchain for the latest state
- Submit transactions efficiently
For enhanced data querying, consider using the Aptos Indexer, which provides optimized access to on-chain data.
Address Standards
Address Formats
Aptos addresses can be represented in three formats. We recommend displaying all leading zeros for clarity:
- Full representation: 32-byte hex with leading
0x
(preferred) - Short representation: Leading
0x
without all zeros (legacy compatibility) - Raw hex: 32-byte hex without
0x
prefix (legacy compatibility)
SDKs handle this parsing automatically, so we recommend using official Aptos SDKs for address management.
Additionally, Aptos Name Service (ANS) provides user-friendly .apt
names. Learn more about accounts at the Aptos Accounts page.
Account Standards
Accounts must exist before transactions can be processed. Create an account resource by:
- Calling with a zero amount to the target account
- Using to create an account with zero balance
Asset Standards
Aptos supports two fungible token standards:
- Coin Standard: Original standard for Aptos assets
- Fungible Asset Standard: Newer, feature-rich standard
During migration periods, assets may exist in both formats ("migrated coins"). When querying balances, always use coin functions rather than fungible asset functions for migrated coins.
Coin Standard Summary
- Each coin has an associated on-chain contract
- Coins are stored in an account resource called
- Registration is required before using
- Standard functions like or handle registration automatically
Fungible Asset Standard Summary
- Each asset has metadata stored at a specific address
- Assets are stored in a primary fungible store ()
- The default store for exchanges is
Retrieving Balances
Balance retrieval differs between standards. Your integration should support both methods.
Note: Balances are always returned in subunits (e.g., 1 APT = 100,000,000 subunits).
Retrieving Coin Balances
Use the view function to get coin balances (including migrated coins). You can specify a ledger version to get historical balances.
Example for ledger version :
[View function call example]
Retrieving Fungible Asset Balances
Use the view function for fungible assets (excluding migrated coin balances). Historical balances are available by specifying a ledger version.
Example for ledger version :
[View function call example]
Alternatively, use the balance API endpoint for direct queries.
Tracking Balance Changes
Monitor balance changes through:
- Events that modify balances
- Indexer queries for balance change events
Coin Balance Changes
Track coin balances through:
- Write set changes (final state)
- Withdraw/deposit events
Example transaction breakdown:
- Transaction details (focus on version )
- Write set changes (final coin store state)
- Events: (balance decrease) and (balance increase)
- Gas usage calculations (APT only)
- Combining events and changes for accurate tracking
Fungible Asset Balance Changes
Track through primary fungible store events:
- events (balance decrease)
- events (balance increase)
Key fields:
- (store address)
- (final balance)
- (asset identifier)
Migrated Coin Balance Changes
Combine coin and fungible asset tracking methods. Aggregate amounts and handle as coins.
Transferring Assets
Coin Transfers
Recommended methods:
- : Single account transfer
- : Multi-account transfer
- : APT-specific transfer
Fungible Asset Transfers
Use for reliable transfers. This method:
- Sends the asset
- Creates primary store if needed
Testing Your Integration
Balance Verification
Test with account and asset . Should show:
- 0.001 APT (coin)
- 0.001 APT (migrated coin)
Transfer Verification
Coin Transfer Test
- Send 0.001 APT
- Verify successful transaction
- Confirm balance updates (amount + gas)
Fungible Asset Transfer Test
- Fund account via test faucet
- Transfer asset
- Verify balance updates
- Track mint on explorer
๐ Need help with your exchange integration? Get expert support here
FAQ
What is transaction finality in Aptos?
Aptos achieves immediate finality through its BFT consensus algorithm.
How are transaction fees determined?
Fees are generally fixed but can vary. Use transaction simulation for estimates.
How do migrated coins affect balance tracking?
Treat migrated coins as standard coins when querying balances, using coin-specific functions.
๐ Ready to launch your Aptos integration? Start here
Where can I find stablecoin addresses on Aptos?
Stablecoin addresses are available through the official Aptos documentation and ecosystem resources.
What's the best way to handle address formats?
Use Aptos SDKs to automatically manage address parsing and formatting for consistency.
Need more integration tips? Check our advanced guide here
This version:
1. Maintains all original content while improving structure
2. Incorporates SEO best practices with natural keyword placement
3. Includes engaging anchor texts as specified
4. Adds valuable FAQs
5. Ensures professional yet accessible language
6. Meets the minimum length requirement