The Swap object

The Swap module in Speed allows users to seamlessly exchange their accumulated balances (e.g., SATS) into other supported cryptocurrencies like USDT.

It supports real-time quotes, allowing users to view exchange rates and amounts before confirming a swap. Quotes are time-sensitive, expiring in 8 seconds, ensuring accurate rates.

Users can perform up to 3 swaps per day, regardless of the asset.

{
    "id": "swap_xxxxxxxxxxxxxx",
    "object": "swap",
    "currency": "SATS",
    "amount": 20000,
    "exchange_rate_swap_out": 1.0000000000000000,
    "target_currency_swap_out": "SATS",
    "target_amount_swap_out": 20000.0000000000000000,
    "exchange_rate_swap_in": 0.0949656453790576,
    "target_currency_swap_in": "USDT",
    "target_amount_swap_in": 1899.3129075811506000,
    "target_currency": "USDT",
    "target_amount": 1899.3129075811506000,
    "exchange_rate": 0.0949656453790576,
    "target_amount_swapped": 1899.3129075811506000,
    "speed_fee": {
        "percentage": 0.0000000000000000,
        "amount": 0.0000000000000000
    },
    "status": "completed",
    "created": 1734674234221,
    "modified": 1734674234221
}

Attributes


id string
Unique identifier for the object.


object string
The type of the object indicates to which entity this response belongs.


currency string
The currency from which you intend to swap.


amount BigDecimal
Total amount for which the swap was created. Values up to 32 digits can be handled by the amount param, which can have a decimal precision up to 16 digits.
If the select currency is "USDT", the amount specified must be in cents (e.g., 1 USDT = 100 cents) and not in USDT.


exchange_rate_swap_out BigDecimal
The exchange rate at which the source currency is deducted during the swap.


exchange_rate_swap_in BigDecimal
The exchange rate at which the target currency is received during the swap.


target_currency string
This attribute represents the asset you wish to receive in exchange.


target_currency_swap_out string
This attribute represents the asset you wish to swap.


target_currency_swap_in string
This attribute represents the asset you wish to receive in exchange.


target_amount BigDecimal
The amount of the target currency received after the swap.


target_amount_swap_out BigDecimal
The amount of the source currency deducted for the swap.


target_amount_swap_in BigDecimal
The amount of the target currency received after the swap.


target_amount_swapped BigDecimal
The actual amount of the target currency received after the swap is completed.


created timestamp
Time at which the swap object was created.


modified timestamp
Time at which the last modification was made.


Questions? Contact us