Swap USDC Across Blockchains | Circle Wallets API (2024)

Circle APIs enable you to easily transfer USDC funds from one blockchain to another. Circle uses a "private bridge" approach to act as a counter-party to the swap operation. This means that funds being swapped are temporarily kept in Circle's custody. This process is fully automated and involves no human intervention, so you don’t need to manually interact with both blockchains as usual.

In this example, we'll transfer USDC funds from the Ethereum blockchain to the Algorand blockchain. However, it makes no difference which supported chains you decide to use or in which order.

  • Do NOT send real / live USDC to addresses generated in the sandbox environment, as your funds might be permanently lost.

If you don't yet have an API key in the sandbox environment, take a few moments to create a sandbox account. (Learn more about Circle’s sandbox and APIs here.


Get an API key
  • You can transfer USDC from an external wallet on any of the supported chains into a Circle wallet you control.

Start by transferring USDC from an external Ethereum wallet.

First, use the command below to create a new wallet to receive the external funds via the create wallet endpoint. Be sure to create your own idempotency key.

# Replace ${YOUR_API_KEY} with your API keycurl -H 'Content-type: application/json' \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -X POST https://api-sandbox.circle.com/v1/wallets \ --data '{"idempotencyKey": "4ddef365-f2fc-4a56-95f5-a214c84ba8f4"}'

The response should look like this:

{ "data":{ "walletId":"1000005062", "entityId":"7cbdedb1-d526-46b4-af12-4162a002eb9c", "type":"end_user_wallet", "balances":[] }}

Create a Deposit Address

  • Because wallets are not tied to specific blockchains, you can generate deposit addresses for wallets, allowing you to receive transfers from different chains.

To create a new Ethereum deposit address, use the generate new address endpoint. To ensure the API generates a USDC deposit address for the Ethereum blockchain, specify the origincurrency (USD) and chain (ETH) attributes. Change the chain attribute to create deposit addresses on other supported chains .

Create a deposit address for your wallet using the command below.

# Replace ${YOUR_API_KEY} with your API key# Replace ${WALLET_ID} with the wallet id from the previous stepcurl -H 'Accept: application/json' \ -H 'content-type: application/json' \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -X POST --url https://api-sandbox.circle.com/v1/wallets/${WALLET_ID}/addresses \ --data '{"idempotencyKey": "ed9a7b3b-b45f-4262-a8aa-8dfee5a4f31b", "currency": "USD", "chain": "ETH"}'

The response should look like this:

{ "data":{ "address":"0x618b24211048c6ec8b29e8129c2bbc5cf80c9f0b", "currency":"USD", "chain":"ETH" }}

📘

addressTag for Stellar

For blockchains that support destination tags or memos, you'll see an additional addressTag attribute returned with the deposit address. When present, this value is required when depositing USDC.

Circle's sandbox environment is connected to the Ethereum Sepolia testing network, so you can send USDC from a Sepolia wallet into your Circle hosted wallet.

❗️

Use supported chains and currencies only

Transferring unsupported currencies using the Accounts API may result in a permanent loss of funds. You can verify the token contract details for supported currencies here.

Now transfer the funds from the Ethereum blockchain. Circle's sandbox environment is connected to the Ethereum Sepolia testing network, so you can send USDC from a Sepolia wallet into your Circle hosted wallet.

  • Visit USDC on Testing Networks to learn more about support on other blockchains.

If you need USDC to send, you can obtain some USDC on the Sepolia network for testing by using a USDC faucet. Go to faucet.circle.com and make sure you choose the Sepolia button. Paste the deposit (wallet) address you created above and hit Submit.

  • Be very careful not to miss any characters in the deposit address.

Monitor the transfer on the blockchain by using the Sepolia Etherscan link provided by the faucet.

Alternately, you can obtain USDC by funding a test wallet with a payment and then transferring USDC out of that wallet.

Use the retrieve transfers endpoint (as in the command below) to find transfers that are routed to to the wallet you created earlier.

# Replace ${YOUR_API_KEY} with your API key# Replace ${WALLET_ID} with the wallet id from the previous stepcurl -H "Authorization: Bearer ${YOUR_API_KEY}" \ -X GET https://api-sandbox.circle.com/v1/transfers?destinationWalletId=${WALLET_ID}

The response should look like this:

{ "data":[ { "id":"9f6362f4-a3d2-396e-a1eb-b628ec3a29b2", "source":{ "type":"blockchain", "chain":"ETH" }, "destination":{ "type":"wallet", "id":"1000005062", "address":"0x618b24211048c6ec8b29e8129c2bbc5cf80c9f0b" }, "amount":{ "amount":"1.00", "currency":"USD" }, "transactionHash":"0xbd3085c3faed933f4093a7b93419ca934fa09d62fe62115d4b3f38a4a94e3a89", "status":"running", "createDate":"2020-09-21T18:50:06.202Z" } ]}

You can look up the transactionHash on Etherscan's tracker on Sepolia.

At first, the status is shown as running because the transaction has been recently initiated. In a few minutes, once the required 30 block confirmations have been completed, the status changes to complete. At that point Circle credits the receiving wallet with the value of the transfer.

At first, the status is shown as running because the transaction has been recently initiated. In a few minutes, once the required 30 block confirmations have been completed, thestatus changes to complete. At that point Circle credits the receiving wallet with the value of the transfer.

  • Refer to our confirmations guide to learn about block confirmation requirements for different chains.

You have successfully received USDC from the Ethereum blockchain using the Circle Wallets API.

After the receiving portion of the swap settles, you can initiate the second portion: sending USDC funds to an address on a different blockchain using the Create a transfer endpoint.

  • Make sure you have an Algorand blockchain address to send to as the destination.
  • Circle's sandbox environment is connected to the Algorand TestNet, so the destination blockchain address has to be a valid Algorand TestNet address.

📘

Algorand Wallet TestNet Account

Download the Algorand Wallet. Under Settings > Node Settings, select TestNet. From the main wallet screen, note your account address.

Your Algorand TestNet wallet address should look like this: BL27TI3CYMFX5URLYNBJJZGV4ABRYJJHBMLRR5OYSVPUVDIUAF66IR4COA.

🚧

Opt-in to Accept the USDC Asset

Due to Algorand Standard Assets spam protection, you must opt in to accept new assets such as USDC. To do so, select Add New Asset, then search for "USDC" (the USDC asset ID on Algorand TestNet is 10458941`).

📘

ALGO Dispenser (Faucet)

To complete the opt-in, you must pay for a transaction. Obtain TestNet ALGO tokens on from the TestNet ALGO Dispenser (Faucet).

To send funds to the external Algorand wallet, use the create wallet transfer endpoint. Specify the currency and chain attributes that match the destination blockchain. Create a USDC transfer to an Algorand blockchain address by using the command below.

# Replace ${YOUR_API_KEY} with your API key# Replace ${YOUR_WALLET_ID} with your master wallet idcurl -H 'Accept: application/json' \ -H 'Content-type: application/json' \ -H "Authorization: Bearer ${YOUR_API_KEY}" \ -X POST https://api-sandbox.circle.com/v1/transfers \ --data '{"idempotencyKey": "fbba9d81-72f1-4bf8-97c8-99f1f28995e2", "source": {"type": "wallet", "id": "${YOUR_WALLET_ID}"}, "destination": {"type": "blockchain", "address": "BL27TI3CYMFX5URLYNBJJZGV4ABRYJJHBMLRR5OYSVPUVDIUAF66IR4COA", "chain": "ALGO"}, "amount": {"amount": "1.00", "currency": "USD"}}'

📘

addressTag for Stellar

When you create a transfer on chains like Stellar that support destination tags or memos, you can use the optionaladdressTag parameter to make sure your send is received correctly.

📘

Flow Vaults

Prior to sending USDC to a wallet on the Flow network, make sure the wallet address is set up to receive a USDC transfer. In most cases, this involves selecting an option in the wallet’s UI to “add USDC.” See Flow documentation for details.

The response should look like this:

{ "data":{ "id":"9dd86dfe-72e8-4182-9573-04196cc7d6cb", "source":{ "type":"wallet", "id":"1000005062" }, "destination":{ "type":"blockchain", "address":"BL27TI3CYMFX5URLYNBJJZGV4ABRYJJHBMLRR5OYSVPUVDIUAF66IR4COA", "chain":"ALGO" }, "amount":{ "amount":"1.00", "currency":"USD" }, "status":"pending", "createDate":"2020-09-21T20:31:39.507Z" }}

Use the get transfer endpoint to retrieve details about the status of the transaction. You can use it as shown in the command below.

# Replace ${YOUR_API_KEY} with your API key# Replace ${TRANSFER_ID} with the id of the transfer you created earliercurl -H "Authorization: Bearer ${YOUR_API_KEY}" \ -X GET https://api-sandbox.circle.com/v1/transfers/${TRANSFER_ID}

The response should look like this:

{ "data":{ "id":"9dd86dfe-72e8-4182-9573-04196cc7d6cb", "source":{ "type":"wallet", "id":"1000005062" }, "destination":{ "type":"blockchain", "address":"BL27TI3CYMFX5URLYNBJJZGV4ABRYJJHBMLRR5OYSVPUVDIUAF66IR4COA", "chain":"ALGO" }, "amount":{ "amount":"1.00", "currency":"USD" }, "transactionHash":"PS74XNN7GHNQTVEV52ZMYHR3CWTKLJUFZ5U3DD43P5WO6GO5VDLQ", "status":"complete", "createDate":"2020-09-23T21:35:03.563Z" }}

Algorand transactions confirm in under 5 seconds, so your transferstatus should quickly change to complete. See Blockchain Confirmations to find transaction times for all chains.

After experimenting with our APIs, you’ll want to start building test integrations in sandbox prior to moving into production. Start by applying for a applying for a Circle Mint account. We'll be happy to walk you through the next steps.

Updated 4 months ago

Swap USDC Across Blockchains | Circle Wallets API (2024)

FAQs

Can USDC be swapped from one blockchain to another? ›

Stablecoins like USDC can be converted from different 'blockchain' variants. For instance, ChangeNow allows you to swap from: USDC(eth) — USDC(polygon)

Can you send USDC across networks? ›

Cross-Chain Transfer Protocol (CCTP) is a permissionless on-chain utility that facilitates USDC transfers securely between blockchains networks via native burning and minting.

How to swap USDC on base network? ›

How to swap on the Base Network
  1. Open Uniswap web app and connect your wallet. ...
  2. Select “Base”.
  3. Select the token drop-down.
  4. Search for and select the token you wish to swap. ...
  5. Now you have to select the token you want to swap for. ...
  6. Search for and select the token you wish to swap for.
Apr 29, 2024

How do I transfer USDC between wallets? ›

Access your current USDT wallet: Open the wallet or exchange where your USDT is stored. Initiate a transfer to MetaMask: Within your current wallet, find the option to send or transfer USDT, and paste your MetaMask wallet as the recipient. Confirm the transaction details: Enter the USDT amount you want to transfer.

How to swap between blockchains? ›

To perform a cross-chain swap, a user must lock up their tokens on the base blockchain, mint wrapped tokens on the destination blockchain, and then swap using a native decentralized exchange to buy the digital asset they desire.

What is the transfer protocol for USDC? ›

The Cross-Chain Transfer Protocol (CCTP), developed by Circle, facilitates the seamless movement of native USDC across various blockchains. CCTP streamlines the transfer of USDC by directly minting and burning tokens on the respective blockchains, eliminating the necessity for bridged token versions.

Can crypto be swapped between chains? ›

An atomic swap protocol enables P2P transactions between parties wishing to exchange cryptocurrencies on different blockchain networks. Smart contracts eliminate the need for a third party, such as a centralized exchange, enabling decentralized, cross-chain crypto asset trading.

What is the cheapest chain to transfer USDC? ›

Luckily, the cryptoverse offers more budget-friendly options. Binance, for example, charges just 0.3 USDC for USDC transfers on the BNB Smart Chain network, a significantly cheaper alternative.

Is swapping USDC taxable? ›

Capital Gains Tax: When you sell, swap, or spend USDC, you may need to pay Capital Gains Tax on any gain you made as a result - even if it's minimal.

Which network should I use for USDC? ›

Additionally, USDC can be sent and received by an Ethereum wallet or exchange that is ERC-20 compatible. But USD is not just limited to the Ethereum network: USD Coin is compatible with other major blockchain networks such as Algorand, Solana, Stellar, TRON, and Flow.

What can you swap USDC for? ›

Overall, USDC provides a reliable and secure digital currency option for individuals and businesses alike. Trade or exchange USDC on Swapzone among 15 instant exchanges to other digital assets like Ethereum, Litecoin, Bitcoin, and other 1600 cryptocurrencies.

Can I bridge USDC to base? ›

Separate and distinct naming helps make it clear to developers and users that this asset is bridged to Base. How can I get USDbC? You can bridge USDC to Base via the Base bridge at http://bridge.base.org using a compatible self-custody crypto wallet.

Can USDC be transferred? ›

Select the network Stellar (XLM) and enter the recipient's USDC address and the unique “USDC Tag”. Review the transaction details, including the fees; Confirm and send. Your USDC will be transferred instantly.

What blockchain does USDC use? ›

USDC first launched on the Ethereum blockchain as an ERC-20 token, but has since expanded to other blockchains including Solana, Stellar, and Algorand. It can be purchased on both centralized and decentralized exchanges (DEXs).

Can you transfer between blockchains? ›

A cross-chain bridge is an application that facilitates the transfer of digital assets between two different blockchain networks. Cross-chain bridges operate via smart contracts and function as a cross-chain messaging protocol that enables blockchain interoperability.

Can I swap USDC for Ethereum? ›

Convert USDC to Ethereum

1 USDC equals 0.00029 ETH. The current value of 1 USDC is -1.63% against the exchange rate to ETH in the last 24 hours. ​ ​Create a free Kraken account to instantly convert USDC to ETH or trade USDC/ETH markets today.

Top Articles
Tax Insights: Monthly Payments on Large Business Loans
Write Off Repayment Of A Business Loan | Bankrate
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: The Hon. Margery Christiansen

Last Updated:

Views: 6170

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: The Hon. Margery Christiansen

Birthday: 2000-07-07

Address: 5050 Breitenberg Knoll, New Robert, MI 45409

Phone: +2556892639372

Job: Investor Mining Engineer

Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.