Skip to main content

Get swaps

Retrieves the swap list.

HTTP request

GET /v1/swaps

Request

Header parameters

Requires authentication.

Query paramaters

NameTypeRequiredDescription
from_token_idNumberOptionalSender token ID. Use together with to_token_id.
to_token_idNumberOptionalReceiver token ID. Use together with from_token_id.
from_network_idNumberOptionalSender network relation. Use together with to_network_id.
to_network_idNumberOptionalReceiver network relation. Use together with from_network_id.
from_contract_addressStringOptionalSender contract address. Use together with to_contract_address.
to_contract_addressStringOptionalReceiver contract address. Use together with from_contract_address.
swap_created_fromTimestamp (microseconds)OptionalTimestamp for swaps created at the time or later. Use together with swap_created_to.
swap_created_toTimestamp (microseconds)OptionalTimestamp for swaps created at the time or earlier. Use together with swap_created_from.
statusStringOptionalThe swap status.
limitNumberOptionalNumber of records to retrieve. The maximum limit is 100. Default value is 10.
offsetNumberOptionalRecords cursor.

Body parameters

Doesn't require setting any body parameters.

Sample query

https://defiapi.changelly.com/v1/swaps?from_network_id=3&to_network_id=177

Response

Successful response

NameTypeRequiredDescription
intent_idNumberRequiredSwap intent ID.
statusStringRequiredSwap intent status. Possible values.
approval_mechanismStringRequiredType of intent approval mechanism.
fromObjectRequiredBase token information.
from.addressStringRequiredPart of the from object. Sender address.
from.txStringOptionalPart of the from object. Sender hash.
from.network_idNumberRequiredPart of the from object. Sender network relation.
from.token_idNumberRequiredPart of the from object. Sender token ID.
from.contract_addressStringRequiredPart of the from object. Sender contract address.
from.decimalsNumberRequiredPart of the from object. Sender token decimals to adjust amount.
from.amountDecimals in stringRequiredPart of the from object. Amount to swap.
toObjectRequiredQuote token information.
to.addressStringRequiredPart of the to object. Receiver address.
to.txStringOptionalPart of the to object. Receiver hash.
to.network_idNumberRequiredPart of the to object. Network relation.
to.token_idNumberRequiredPart of the to object. Receiver token ID.
to.contract_addressStringRequiredPart of the to object. Receiver contract address.
to.decimalsNumberRequiredPart of the to object. Receiver token decimals to adjust amount.
to.min_amountDecimals in stringRequiredPart of the to object. Minimal quote amount expressed in basis points.
to.max_amountDecimals in stringRequiredPart of the to object. Maximum quote amount expressed in basis points.
to.amount_expectedDecimals in stringRequiredPart of the to object. Expected minimal quote amount expressed in basis points.
refundObjectRequiredRefund information.
refund.addressStringOptionalPart of the refund object. Address for potential refund.
refund.txStringOptionalPart of the refund object. Refund hash.
refund.tx_atStringOptionalPart of the refund object. Time of refund hash creation.
feesObjectRequiredApplied fees for current quote.
fees.changellyObjectOptionalPart of the fees object. Changelly fee information.
fees.changelly.network_idNumberOptionalPart of the fees.changelly object. Network relation.
fees.changelly.contract_addressStringOptionalPart of the fees.changelly object. Token contract address.
fees.changelly.token_idNumberOptionalPart of the fees.changelly object. Token ID.
fees.changelly.decimalsNumberOptionalPart of the fees.changelly object. Token decimals to adjust amount.
fees.changelly.amountDecimals in stringOptionalPart of the fees.changelly object. Changelly fee amount.
fees.changelly.bpsStringOptionalPart of the fees.changelly object. Amount of basis points.
fees.affiliateObjectOptionalPart of the fees object. Affiliate fee information.
fees.affiliate.network_idNumberOptionalPart of the fees.affiliate object. Affiliate network relation.
fees.affiliate.contract_addressStringOptionalPart of the fees.affiliate object. Affiliate token contract address.
fees.affiliate.token_idNumberOptionalPart of the fees.affiliate object. Affiliate token ID.
fees.affiliate.decimalsNumberOptionalPart of the fees.affiliate object. Affiliate token decimals to adjust amount.
fees.affiliate.amountDecimals in stringOptionalPart of the fees.affiliate object. Affiliate fee amount.
fees.affiliate.bpsStringOptionalPart of the fees.affiliate object. Affiliate amount of basis points.
intent_created_atTimestamp (microseconds)RequiredSwap intent creation time.
swap_created_atTimestamp (microseconds)RequiredSwap creation time.
swap_updated_atTimestamp (microseconds)RequiredSwap update time.
Sample response
application/json
[
{
"intent_id": "2efaaa54-080d-4ac2-89c1-660b5a268eba",
"status": "created",
"approval_mechanism": "permit2",
"from": {
"address": "0xbe7A42Af09*********8a88c8EE",
"tx": null,
"network_id": 3,
"token_id": 278,
"contract_address": "0x000000000000000000000000000000000000000",
"decimals": 6,
"amount": "10000000"
},
"to": {
"address": "0xac6B52Af09*********8a88c8EE",
"tx": null,
"network_id": 3,
"token_id": 4669,
"contract_address": "1x000000000000000000000000000000000000000",
"decimals": 18,
"min_amount": "4230589541052713",
"max_amount": "4251848784977602",
"amount_expected": "4251848784977602"
},
"refund": {
"address": "0xbe7A42Af09*********8a88c8EE",
"tx": null
},
"fees": {
"changelly": {
"network_id": 1,
"token_id": 78,
"contract_address": "0xc02aaa39************083c756cc2",
"bps": "50",
"amount": "12000000000000",
"decimals": 18
},
"affiliate": {
"network_id": 1,
"token_id": 78,
"contract_address": "0xc02aaa39************083c756cc2",
"bps": "25",
"amount": "6000000000000",
"decimals": 18
}
},
"intent_created_at": 1778856025,
"swap_created_at": 1778856026,
"swap_updated_at": 1779793152
}
]

Error response

Check the error response schema.