Conversions between MXNB and USD stablecoins

The Conversions service allows users to seamlessly exchange balances between different currencies within the Juno platform. This feature offers a streamlined way to convert between MXNB and USD stablecoins without manual intervention.

Integrating with the Conversions Service

To integrate with the Conversions service, you will primarily use a set of dedicated API endpoints. You will also need to subscribe to webhook events to receive updates on your transactions.

API Endpoints

The following endpoints are available for managing conversions:

  • Get Available Pairs: Use this endpoint to retrieve the supported currency pairs for conversion and their associated limits. This ensures you only request quotes for valid exchanges and stay within the platform's constraints.
  • Request Quote: Send a request with your desired currency pair and amount to receive a real-time quote for the conversion. The quote will include the exchange rate and the final amount you will receive.
  • Execute Quote: Once you have a valid quote, you can use this endpoint to confirm and execute the conversion. This will trigger the automated trade.
  • Get Balances: Check your balances for all supported stablecoins.

Get Available Pairs

GET https://stage.buildwithjuno.com/mint_platform/v1/retrieve_conversion_assets

Successful Response:
If successful, you will receive a response confirming the available assets for conversion.

{
    "assets": [
        {
            "source_asset": "MXNB",
            "decimal_precision": 2,
            "min_amount": "20000",
            "max_amount": "100000",
            "convertible_assets": [
                {
                    "target_asset": "USDC",
                    "decimal_precision": 8,
                    "min_amount": "100",
                    "max_amount": "5000"
                },
                {
                    "target_asset": "USDT",
                    "decimal_precision": 8,
                    "min_amount": "1000",
                    "max_amount": "3000000"
                }
            ]
        },
        {
            "source_asset": "USDC",
            "decimal_precision": 8,
            "min_amount": "100",
            "max_amount": "5000",
            "convertible_assets": [
                {
                    "target_asset": "MXNB",
                    "decimal_precision": 2,
                    "min_amount": "20000",
                    "max_amount": "100000"
                }
            ]
        },
        {
            "source_asset": "USDT",
            "decimal_precision": 8,
            "min_amount": "1000",
            "max_amount": "3000000",
            "convertible_assets": [
                {
                    "target_asset": "MXNB",
                    "decimal_precision": 2,
                    "min_amount": "20000",
                    "max_amount": "100000"
                }
            ]
        }
    ]
}

Request Quote

To request a quote, make an HTTP POST call to the endpoint below. You must specify either the source_amount or target_amount.

POST https://stage.buildwithjuno.com/mint_platform/v1/quotes

Body Parameters

  • source_asset(string): The asset to be converted.
  • target_asset(string): The asset to receive.
  • target_amount(string): The amount of the source_asset to be converted.
  • source_amount(string): The amount of the target_asset to be received.

Example Request:

{
    "source_asset": "MXNB",
    "target_asset": "USDT",
    "target_amount": "2000"
}

Successful Response:

If successful, you will receive the requested quote with either the source_amount or target_amount provided.

{
    "quote_id": "d7472203-548a-4fc8-8a66-906769f19c9f",
    "source_asset": "MXNB",
    "target_asset": "USDT",
    "source_amount": "38885",
    "target_amount": "2000",
    "exchange_rate": "19.4425000000",
    "expires_at": "2025-08-28T00:00:00Z",
    "created_at": "2025-08-28T00:00:00Z"
}
📘

Important Considerations

A quote has a defined expiration time. If the quote is not executed before it expires, it will be considered invalid, and a new quote must be requested.


Execute Quote

To execute a quote, make an HTTP POST call to the endpoint below.

POST https://stage.buildwithjuno.com/mint_platform/v2/transactions

Body Parameters

  • type(string): The transaction type. It must be CONVERSION.
  • external_ref(string): A user-specified reference that allows you to assign your own internal references for the transaction.
  • conversion(object): A nested object containing the quote_id.
    • quote_id(string): The quote ID to be executed.

Example Request:

{
    "type": "CONVERSION",
    "external_ref": "user reference",
    "conversion": {
        "quote_id": "d7472203-548a-4fc8-8a66-906769f19c9f"
    }
}

Successful Response:

If the request was successful, you will receive a 202 response with the following body.

{
    "id": "384e51bd-f61c-425a-ba72-60abb8e4924f",
    "created_at": "2025-08-28T00:00:00Z",
    "updated_at": "2025-08-28T00:00:00Z",
    "status": "PENDING",
    "external_ref": "user reference",
    "type": "CONVERSION",
    "conversion": {
        "quote_id": "d7472203-548a-4fc8-8a66-906769f19c9f"
    }
}

Failure Response

If the quote was already executed, you will receive an error like this one:

{
    "errors": [
        {
            "code": "quote_id_already_executed",
            "message": "Quote ID already executed for conversion transaction."
        }
    ]
}