API Response
Learn about Totle's API response parameters here.
The response of the swap endpoint is built in an easily understood format with the following sections:

Summary

The summary is a comprehensive breakdown of the transaction where you can get information about the trades, orders, exchanges, fees, etc. in a human-readable format.

Transactions

The transactions section is a list of complete transaction objects that the end user must sign and submit to the Ethereum blockchain. Approval transactions will be prepended to the array. Sign and submit the transactions as they are ordered in the array.
Modification of the transaction objects is strongly discouraged

Expiration

The expiration section contains the expiration block and the estimated expiration timestamp of the Totle swap. Expired transactions will be reverted by the smart contract.
JSON
Parameters List
1
{
2
"success": true,
3
"response": {
4
"id": "0x46d0648312ee4fb099117b9f9d18767ab7fcd94fde5240e59b72118a7338609e",
5
"summary": [
6
{
7
"sourceAsset": {
8
"address": "0x0000000000000000000000000000000000000000",
9
"symbol": "ETH",
10
"decimals": "18"
11
},
12
"sourceAmount": "1000000000000000000",
13
"destinationAsset": {
14
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
15
"symbol": "DAI",
16
"decimals": "18"
17
},
18
"destinationAmount": "219849000000000000000",
19
"notes": [],
20
"rate": "219.849",
21
"guaranteedRate": "198.84900000000000021",
22
"market": {
23
"rate": "219.84900000000000021",
24
"slippage": "0.000000000000000096%"
25
},
26
"runnerUpRoutes": [
27
{
28
"baseAsset": {
29
"address": "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359",
30
"symbol": "SAI",
31
"decimals": "18"
32
},
33
"sourceAsset": {
34
"address": "0x0000000000000000000000000000000000000000",
35
"symbol": "ETH",
36
"decimals": "18"
37
},
38
"sourceAmount": "1000000000000000000",
39
"destinationAsset": {
40
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
41
"symbol": "DAI",
42
"decimals": "18"
43
},
44
"destinationAmount": "211769682759420945040"
45
}
46
],
47
"trades": [
48
{
49
"sourceAsset": {
50
"address": "0x0000000000000000000000000000000000000000",
51
"symbol": "ETH",
52
"decimals": "18"
53
},
54
"sourceAmount": "1000000000000000000",
55
"destinationAsset": {
56
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
57
"symbol": "DAI",
58
"decimals": "18"
59
},
60
"destinationAmount": "219849000000000000000",
61
"orders": [
62
{
63
"sourceAsset": {
64
"address": "0x0000000000000000000000000000000000000000",
65
"symbol": "ETH",
66
"decimals": "18"
67
},
68
"sourceAmount": "1000000000000000000",
69
"destinationAsset": {
70
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
71
"symbol": "DAI",
72
"decimals": "18"
73
},
74
"destinationAmount": "220400000000000000000",
75
"exchange": {
76
"id": 19,
77
"name": "PMM"
78
},
79
"fee": {
80
"percentage": "0",
81
"amount": "0",
82
"asset": {
83
"address": "0x0000000000000000000000000000000000000000",
84
"symbol": "ETH",
85
"decimals": "18"
86
}
87
}
88
}
89
],
90
"runnerUpOrders": [
91
{
92
"sourceAsset": {
93
"address": "0x0000000000000000000000000000000000000000",
94
"symbol": "ETH",
95
"decimals": "18"
96
},
97
"sourceAmount": "5449375978333281110",
98
"destinationAsset": {
99
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
100
"symbol": "DAI",
101
"decimals": "18"
102
},
103
"destinationAmount": "1199999999999999999967",
104
"exchange": {
105
"id": 22,
106
"name": "0x V3"
107
},
108
"fee": {
109
"percentage": "0",
110
"amount": "0",
111
"asset": {
112
"address": "0xe41d2489571d322189246dafa5ebde1f4699f498",
113
"symbol": "ZRX",
114
"decimals": "18"
115
}
116
}
117
}
118
]
119
}
120
],
121
"totleFee": {
122
"asset": {
123
"address": "0x0000000000000000000000000000000000000000",
124
"symbol": "ETH",
125
"decimals": "18"
126
},
127
"percentage": "0.25",
128
"amount": "2506265664160401"
129
},
130
"partnerFee": {
131
"asset": {
132
"address": "0x0000000000000000000000000000000000000000",
133
"symbol": "ETH",
134
"decimals": "18"
135
},
136
"percentage": "0",
137
"amount": "0"
138
}
139
}
140
],
141
"transactions": [
142
{
143
"type": "swap",
144
"tx": {
145
"to": "0x3b21d6d25e7f036c8277efe9a7ebf17ca12fe4f6",
146
"from": "0x0000000000000000000000000000000000000000",
147
"value": "1000000000000000000",
148
"data": "0x5f10dffc00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000100000000000000000000000000d53799e6f0728fdfb56b746dcd7b75dfcb422d7400000000000000000000000000000000000000000000000000000000008ffd0f46d0648312ee4fb099117b9f9d18767ab7fcd94fde5240e59b72118a7338609e00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000000001c1562529900b977538f0ee87551c95cd0204ac0baeecf522e5d31caeb2403b2a61c99f9dc6b89210dbf22ebc78e63ab802ea04aa7f01ed914df6173dd75694f8700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000b8f7cbbab5c1ba00000000000000000000000000000000000000000000000000ab9ea7e9efe5e40000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000009c119a139b9edcdb65b534c5c36d15d88bda8f4200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000002000000000000000000000000056178a0d5f301baf6cf3e1cd53d9863437345bf90000000000000000000000009c119a139b9edcdb65b534c5c36d15d88bda8f4200000000000000000000000055662e225a3376759c24331a9aed764f8f0c9fbb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000bf2aa1845501800000000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005e3d863800000000000000000000000000000000000000000000000015f1292b6f0ee11b00000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000024f47261b00000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421bdf4bceee295e4f6b24467c5850290faba16e66061112c931008b09e0c6e04c4f425bf35e7364d18243d91a5392b59146d2c2e9e715f67e3a7c0aecfdce37376a030000000000000000000000000000000000000000000000000000000000000000000000000000000000002e49cab231386478c56173b744ea428f6edc94a6000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000003800000000000000000000000000000000000000000000000000000000000000020000000000000000000000000b0dd0dcada73b715e3b5567ab17bd7f37216a6370000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410d586a20a4bfffdf0000000000000000000000000000000000000000000000004ba012948c1a1b5600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005e3d8649000000000000000000000000000000000000000000000000000001702050e3aa00000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e00000000000000000000000000000000000000000000000000000000000000024f47261b00000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f47261b0000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000421cc4ee3d83de446dbd8eaf0ed7cf528c38ffe70cbc0170e906c7ae2271d5557a2e518c658895156b9eb853f30fc149c1cfeb7f4324286def67641fca54221c5d1703000000000000000000000000000000000000000000000000000000000000",
149
"gasPrice": "10000000000",
150
"gas": "1000000"
151
}
152
}
153
],
154
"expiration": {
155
"blockNumber": 9436431,
156
"estimatedTimestamp": 1581090812
157
}
158
}
159
}
Copied!

Common Parameter Objects

Token Details

Parameter
Description
address
Address of the token
symbol
Symbol of the token
decimals
Number of decimals the token has

Fee Details

Parameter
Description
percentage
The percentage being used to calculate the fee amount
amount
The fee amount denoted in the fee.asset token
asset
Token Details of the token which the fee is denoted in

Token Amount Details

Parameter
Description
sourceAsset
Token Details of the token being sold
sourceAmount
Amount of the token being sold
destinationAsset
Token Details of the token being bought
destinationAmount
Amount of the token being bought

Route Details extends Token Amount Details

Parameter
Description
baseAsset?
Token Details of the token used for a middle trade between sourceAsset and destinationAsset

Trade Details extends Token Amount Details

Parameter
Description
orders[]
Array of Order Details for the main orders that were selected
runnerUpOrders[]
Array of Order Details for the backup orders that were selected to be used if any of the main orders fail

Order Details extends Token Amount Details

Parameter
Description
exchange
Details of the exchange the order is for
exchange.id
Id of the order's exchange. List of exchanges can be found here
exchange.name
Name of the order's exchange
fee
Fee Details of the fees taken by the exchange

API Parameters

Parameter
Description
success
Whether or not the API request was successful
response
The object that contains the response details
response.id
Unique identifier for this request/response pair
response.summary[]
Array of human-readable details of the requested swaps' best route. Contains information in Route Details
response.summary[].notes[]
Array of strings of any extra details
response.summary[].rate
The rate of this swap denoted in (destinationAmount / (10 ** destinationAsset.decimals)) / (sourceAmount / (10 ** sourceAsset.decimals))
response.summary[].guaranteedRate
Rate that is guaranteed based of the supplied maxMarketSlippagePercent
response.summary[].runnerUpRoutes[]
Array of Route Details considered by Totle that were not chosen for execution
response.summary[].trades[]
Array of Trade Details that make up the route
response.summary[].totleFee
Fee Details of the fee taken by Totle for facilitating the transaction
response.summary[].partnerFee
Fee Details of the fee taken by third-party partners who deploy a partner contract on Totle's platform
response.transactions[]
Array of transaction objects auto-generated to perform the swaps described above in the summary. If multiple transaction objects are returned, the ones preceding the swap transaction will be token approval transactions
response.transactions[].type
The type of transaction to be performed (e.g., swap or approval)
response.transactions[].tx
A full auto-generated transaction object to be signed and submitted on-chain
response.transactions[].tx.to
Contract address to which the transaction is sent to
response.transactions[].tx.from
The user's wallet address from which the transaction will originate
response.transactions[].tx.value
The Ether value to be included in the transaction
response.transactions[].tx.data
The encoded payload data the contract needs to execute the swaps
response.transactions[].tx.gas
The suggested gas price for the transaction payload (users are strongly discouraged to modify this value)
response.transactions[].tx.gasLimit
The maximum gas limit for the transaction (users are strongly discouraged to modify this value)
response.transactions[].tx.nonce
The user's wallet transaction count required in every transaction
response.expiration
Information about when the returned payload expires and is no longer valid
response.expiration.blockNumber
The block number in which the returned payload is no longer valid
response.expiration.estimatedTimestamp
The estimated timestamp (in seconds) when blockNumber is reached
Last modified 11mo ago