Overview
1
Create swap request
Specify source currency, destination currency, and amount to exchange. The
swap is created with
OPEN_QUOTE status.2
Accept the swap
Accept the swap using the Accept
Swap endpoint
to execute the exchange.
3
Completion
Receive the swapped currency in the destination wallet once the swap is
accepted and executed.
Supported Pairs
| Source | Destination |
|---|---|
| Polygon - USDC | Polygon (USDT), Ethereum (USDT, USDG), Solana (USDT, USDG) |
| Polygon - USDT | Polygon (USDC), Ethereum (USDC, USDG), Solana (USDC, USDG) |
| Ethereum - USDC | Polygon (USDT), Ethereum (USDT, USDG), Solana (USDT, USDG) |
| Ethereum - USDT | Polygon (USDC), Ethereum (USDC, USDG), Solana (USDC, USDG) |
| Ethereum - USDG | Polygon (USDC, USDT), Ethereum (USDC, USDT), Solana (USDC, USDT) |
| Solana - USDC | Polygon (USDT), Ethereum (USDT, USDG), Solana (USDT, USDG) |
| Solana - USDT | Polygon (USDC), Ethereum (USDC, USDG), Solana (USDC, USDG) |
| Solana - USDG | Polygon (USDC, USDT), Ethereum (USDC, USDT), Solana (USDC, USDT) |
USDG swapping is available upon request. Please contact support to get access.
Fees
The Swap endpoint uses a two-part billing model:- Market quote fees: Fees are included in the swap quote response. Check the
quoteInformationfields (sendNet,receiveNet) to see the amounts after market fees are applied. - Gas fees: Network gas fees are charged separately on your invoice and are not included in the quote response.
Creating Swaps
Use the Create Swap endpoint to exchange currencies on the same chain.PENDING status and require acceptance:
Response
Response
Unique swap ID. Use this to check status using the Retrieve
Swap
endpoint.
Swap status. Swaps are created with
OPEN_QUOTE status and must be accepted
before execution. See Transaction Status for details.Source wallet details including currency, amount, chain, and user information.
Destination wallet details including currency, amount received, chain, and
user information.
Swap quote details including exchange rate, amounts sent and received.
For detailed field documentation, see the Create
Swap API
reference.
Accepting Swaps
All swaps are created inPENDING status and require explicit acceptance before execution. Use the Accept Swap endpoint to accept and execute a swap.
Request:
Response
Response
Swap status after acceptance. Transitions from
PENDING to COMPLETED upon
successful acceptance. See Transaction Status for
details.Required Step: All swaps must be accepted before execution. After creating
a swap, always call the accept endpoint to execute the exchange.
Transaction Status
Swaps progress through the following statuses:| Status | Description |
|---|---|
| OPEN_QUOTE | Swap quote requested and waiting for acceptance |
| CREATED | Swap request accepted |
| PENDING | Swap processing |
| COMPLETED | Swap successfully executed |
| FAILED | Swap failed (check error and errorDetails for specifics) |
| QUOTE_FAILED | Swap quote is expired or invalid |
Status Updates: Subscribe to
SWAP.TRANSACTION.CREATE and SWAP.STATUS.*
webhook events to receive real-time status notifications. See
Webhooks for setup instructions.Tracking Swaps
Monitor swap status using the Retrieve Swap endpoint. Request:Response
Response
Current swap status. See Transaction Status for all
possible statuses.
Listing Swaps
Retrieve a list of all swaps associated with users under your organization using the List Swaps endpoint. Swaps are returned sorted by creation date, with the most recent swaps appearing first. Request:Filter swaps by a specific user ID. If omitted, returns swaps for all users
under your organization.
Number of swaps to return. Defaults to 10, maximum is 100.
Filter swaps created before this date. ISO format: YYYY-MM-DD.
Filter swaps created after this date. ISO format: YYYY-MM-DD.
Response
Response
Total number of swaps returned in this response.
Array of swap objects. Each object follows the same structure as the swap
details returned by the retrieve endpoint.
Timestamp cursor for pagination. Use this value with
createdBefore parameter
to fetch the next page of results.Pagination: To fetch more swaps, use the
nextCursor value as the
createdBefore parameter in your next request. Continue until count is less
than your limit, indicating you’ve reached the end.Key Concepts
Amount Specification
Amount Specification
You can specify the amount in either source or destination:Source amount (you send exactly 100 USDC):Destination amount (you receive exactly 100 USDT):Provide amount in only one side - the system calculates the other based on the current rate.
Exchange Rates
Exchange Rates
The
quoteInformation.rate shows the exchange rate between currencies. Rates may vary slightly based on liquidity Always verify receiveNet to see the exact amount you’ll receive after any fees.External Wallet Swaps
External Wallet Swaps
Swap to external wallets (not managed by HIFI) by providing Or use a registered external wallet:
externalWalletId or walletAddress:Swap vs Bridge vs Transfer
Swap vs Bridge vs Transfer
Understanding the differences:Swaps: Exchange different currencies on the same/across chain (USDC → USDT)Bridges: Move same currency across chains (USDC on Polygon → USDC on Ethereum)Transfers: Move same currency to another wallet on same chain (USDC wallet A → USDC wallet B on Polygon)
Sample Code
Basic swap flow
1
Create swap
OPEN_QUOTE. Save the swap id from the response.2
Accept the swap
Accept the swap to execute the exchange:The response will show status
CRAETED for successful swap request acceptance.3
Verify completion
Review the swap details to confirm:
- Status – should be
COMPLETED - Destination Amount – the amount received
4
Handle errors
If status is
FAILED:- Check
errorfield for error type - Review
errorDetailsfor specific failure reason - Common issues: insufficient balance, unsupported pair, not enough liquidity
Getting Help
- 📧 Email: [email protected]
- 💬 Slack: Message us in our shared Slack channel
Related Resources
- Wallet Transfers - Same-chain transfers without currency exchange
- Bridging - Cross-chain asset movement
- Wallets - Understand wallet addresses and balances
- Webhooks - Real-time swap status notifications
- API Reference - Complete endpoint documentation