Skip to navigation

Fiat Reference Rates

Fiat Reference Rates: Agent Java SDK v0.3.0 integration, examples, parameters and response semantics.

View as Markdown

This guide targets Agent Java SDK v0.3.0, Java 8+, and the tagged public contract. Examples run in a partner backend after initializing client in Quick Start.

Example prerequisites

The Java snippets share these imports. Initialize client using Quick Start and obtain platformUserId from the saved binding. Example user/order IDs must be replaced with your own persisted values.

import com.sixmm.agent.*;
import com.sixmm.agent.model.*;
import java.util.*;

FX Reference Rates

Both FX methods use the normal signed Agent API flow. Start by discovering the currently supported source currencies:

import com.sixmm.agent.model.ListSupportedFiatCurrenciesResponse;
ListSupportedFiatCurrenciesResponse supported = client.listSupportedFiatCurrencies();
System.out.println(supported.targetCurrency); // USDT
System.out.println(supported.sourceCurrencies); // AUD, BRL, CNY, EUR, USD, ...

Query all supported fiat-to-USDT reference rates:

import com.sixmm.agent.model.ExchangeRateItem;
import com.sixmm.agent.model.QueryExchangeRatesResponse;
QueryExchangeRatesResponse rates = client.queryExchangeRates();
for (ExchangeRateItem item : rates.rates) {
System.out.println("1 " + item.sourceCurrency + " = " + item.rate + " " + item.targetCurrency);
}

Query selected currencies:

import com.sixmm.agent.model.QueryExchangeRatesRequest;
QueryExchangeRatesResponse rates = client.queryExchangeRates(
QueryExchangeRatesRequest.of("CNY", "EUR", "USD"));

The request factory trims and uppercases currency codes and serializes them as the comma-separated sourceCurrencies value required by the API. Omitting the request or all effective currency values queries every supported currency.

Response fieldTypeDescription
snapshotVersionstringStable snapshot version for audit and reconciliation
providerstringUpstream provider, currently ECB
sourceDatestringUpstream observation date in yyyy-MM-dd format
fetchedAt / expiresAtint64Unix timestamps in milliseconds
pricingPolicystringCurrently FIXED_PEG
usdtUsdRatestringUSD amount per 1 USDT, currently fixed at 1
rateTypestringCurrently INDICATIVE_DAILY
usagestringCurrently REFERENCE_ONLY
rateMeaningstring1 sourceCurrency = rate USDT
rates[].ratestringUSDT amount corresponding to one unit of source fiat

These values are references for a partner multi-currency wallet to calculate the USDT amount sent to 6MM. They are not executable prices, locked quotes, or real-time USDT market prices. Use BigDecimal and strings for amount calculations; do not use double or float.