Creating a Stablecoin Conversion

USDC and PYUSD are directly available in Prime via Create Conversion. This endpoint processes movement between USD and USDC or USD and PYUSD, and is free, instant, and 1:1. This endpoint works in both directions.

The following examples show how to create a conversion between USD and USDC.

TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);  
  
CreateConversionRequest request = new CreateConversionRequest.Builder()  
    .portfolioId("PORTFOLIO_ID_HERE")  
    .walletId("WALLET_ID_HERE")  
    .amount("1")  
    .destination("DESTINATION_WALLET_UUID")  
    .idempotencyKey(UUID.randomUUID().toString())  
    .sourceSymbol("USD")  
    .destinationSymbol("USDC")  
    .build();  
  
CreateConversionResponse response = transactionsService.createConversion(request);  

For more information, please visit the Prime Java SDK.

Tracking a Stablecoin Conversion

Conversions are tracked via Get Transaction by ID. The process is identical to tracking a withdrawal. Simply look up the transaction by its ID. Typically, conversion transactions reach a terminal state within a few seconds.


TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);  
  
GetTransactionByTransactionIdRequest request = new GetTransactionByTransactionIdRequest.Builder()  
    .portfolioId("PORTFOLIO_ID_HERE")  
    .transactionId("TRANSACTION_ID_HERE")  
    .build();  
  
GetTransactionByTransactionIdResponse response = transactionsService.getTransactionByTransactionId(request);  

For more information, please visit the Prime Java SDK.

Please note: All requests discussed above require proper authentication. For more information, visit REST API Authentication.