Fuseswap Service
​

Fuseswap Backend API v0.1.0

The Fuseswap Backend REST API is used for generating trading data for frontend clients

PriceChange

Get price change for token over last 24 hours

​Back to top​
1
GET /pricechange
Copied!

Parameter Parameters

Name
Type
Description
tokenAddress
String
The currency address

Success Response

Success-Response:
1
​
2
{
3
"data": {
4
"priceChange": "4.761727644165598",
5
"currentPrice": "3760.8426158182515",
6
"previousPrice": "3589.901293526158"
7
}
8
}
Copied!

Success 200

Name
Type
Description
priceChange
String
The price change ratio of the token
currentPrice
String
The current price of the token
previousPrice
String
The previous price of the token

Get price change for token over time duration

​Back to top​
1
POST /pricechange
Copied!

Parameter Parameters

Name
Type
Description
tokenAddress
String
The currency address
duration
Object
The duration object to calculate the price change over the timeframe duration should be passed as an object according to https://day.js.org/docs/en/durations/creating for example duration of {days: 1} means a duration of one day

Success Response

Success-Response:
1
​
2
{
3
"data": {
4
"priceChange": "4.761727644165598",
5
"currentPrice": "3760.8426158182515",
6
"previousPrice": "3589.901293526158"
7
}
8
}
Copied!

Success 200

Name
Type
Description
priceChange
String
The price change ratio of the token
currentPrice
String
The current price of the token
previousPrice
Object
The previous price of the token

Price

Get latest price for a token

​Back to top​
1
GET /price
Copied!

Parameter Parameters

Name
Type
Description
tokenAddress
String
The currency address

Success Response

Success-Response:
1
​
2
{
3
"data": {
4
"price":1.009884197756788
5
}
6
}
Copied!

Success 200

Name
Type
Description
price
Number
The price of the token

Stats

Get historical statistics of the token

​Back to top​
1
GET /stats/:tokenAddress?=limit={limit}
Copied!

Parameter Parameters

Name
Type
Description
tokenAddress
String
The currency address
limit
String
The number of days to return statistics for (query param)

Success Response

Success-Response:
1
​
2
{
3
"data": [
4
{
5
"address": "0xa722c13135930332eb3d749b2f0906559d2c5b99",
6
"price": "2389.74779405372110747871079158035",
7
"volume": "3343.67560523501352604818272285103",
8
"timestamp": 1619395200,
9
"date": "2021-04-26T00:00:00.000Z"
10
}
11
]
Copied!

Success 200

Name
Type
Description
array
Object[]
of token stats objects, see example below

Swap

Create a quote for a token pair

​Back to top​
1
POST /swap/quote
Copied!

Parameter Parameters

Name
Type
Description
currencyIn
String
The currency to spend
currencyOut
String
The desired currency out address
inputAmount
String
The desired amount to spend

Success Response

Success-Response:
1
​
2
{
3
"data": {
4
"info": {
5
"inputAmount": "1",
6
"outputAmount": "965.616",
7
"route": [
8
"WETH",
9
"USDC"
10
],
11
"inputToken": "WETH",
12
"outputToken": "USDC",
13
"executionPrice": "965.617",
14
"nextMidPrice": "722.082",
15
"priceImpact": "25.612"
16
},
17
"trade": {
18
"route": {
19
"pairs": [
20
{
21
"liquidityToken": {
22
"decimals": 18,
23
"symbol": "UNI-V2",
24
"name": "Uniswap V2",
25
"chainId": 122,
26
"address": "0x20a680D69a5aE2677B8CF43aBF63aAD6D8d5119A"
27
},
28
"tokenAmounts": [
29
{
30
"numerator": [
31
-491531807
32
],
33
"denominator": [
34
1000000
35
],
36
"currency": {
37
"decimals": 6,
38
"symbol": "USDC",
39
"name": "USD Coin on Fuse",
40
"chainId": 122,
41
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
42
"tokenInfo": {
43
"name": "USD Coin on Fuse",
44
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
45
"symbol": "USDC",
46
"decimals": 6,
47
"chainId": 122,
48
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
49
},
50
"tags": []
51
},
52
"token": {
53
"decimals": 6,
54
"symbol": "USDC",
55
"name": "USD Coin on Fuse",
56
"chainId": 122,
57
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
58
"tokenInfo": {
59
"name": "USD Coin on Fuse",
60
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
61
"symbol": "USDC",
62
"decimals": 6,
63
"chainId": 122,
64
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
65
},
66
"tags": []
67
}
68
},
69
{
70
"numerator": [
71
-2070596893,
72
682205361
73
],
74
"denominator": [
75
-1486618624,
76
232830643
77
],
78
"currency": {
79
"decimals": 18,
80
"symbol": "WETH",
81
"name": "Wrapped Ether on Fuse",
82
"chainId": 122,
83
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
84
"tokenInfo": {
85
"name": "Wrapped Ether on Fuse",
86
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
87
"symbol": "WETH",
88
"decimals": 18,
89
"chainId": 122,
90
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
91
},
92
"tags": []
93
},
94
"token": {
95
"decimals": 18,
96
"symbol": "WETH",
97
"name": "Wrapped Ether on Fuse",
98
"chainId": 122,
99
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
100
"tokenInfo": {
101
"name": "Wrapped Ether on Fuse",
102
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
103
"symbol": "WETH",
104
"decimals": 18,
105
"chainId": 122,
106
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
107
},
108
"tags": []
109
}
110
}
111
]
112
}
113
],
114
"path": [
115
{
116
"decimals": 18,
117
"symbol": "WETH",
118
"name": "Wrapped Ether on Fuse",
119
"chainId": 122,
120
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
121
"tokenInfo": {
122
"name": "Wrapped Ether on Fuse",
123
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
124
"symbol": "WETH",
125
"decimals": 18,
126
"chainId": 122,
127
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
128
},
129
"tags": []
130
},
131
{
132
"decimals": 6,
133
"symbol": "USDC",
134
"name": "USD Coin on Fuse",
135
"chainId": 122,
136
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
137
"tokenInfo": {
138
"name": "USD Coin on Fuse",
139
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
140
"symbol": "USDC",
141
"decimals": 6,
142
"chainId": 122,
143
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
144
},
145
"tags": []
146
}
147
],
148
"midPrice": {
149
"numerator": [
150
-491531807
151
],
152
"denominator": [
153
-2070596893,
154
682205361
155
],
156
"baseCurrency": {
157
"decimals": 18,
158
"symbol": "WETH",
159
"name": "Wrapped Ether on Fuse",
160
"chainId": 122,
161
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
162
"tokenInfo": {
163
"name": "Wrapped Ether on Fuse",
164
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
165
"symbol": "WETH",
166
"decimals": 18,
167
"chainId": 122,
168
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
169
},
170
"tags": []
171
},
172
"quoteCurrency": {
173
"decimals": 6,
174
"symbol": "USDC",
175
"name": "USD Coin on Fuse",
176
"chainId": 122,
177
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
178
"tokenInfo": {
179
"name": "USD Coin on Fuse",
180
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
181
"symbol": "USDC",
182
"decimals": 6,
183
"chainId": 122,
184
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
185
},
186
"tags": []
187
},
188
"scalar": {
189
"numerator": [
190
-1486618624,
191
232830643
192
],
193
"denominator": [
194
1000000
195
]
196
}
197
},
198
"input": {
199
"decimals": 18,
200
"symbol": "WETH",
201
"name": "Wrapped Ether on Fuse",
202
"chainId": 122,
203
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
204
"tokenInfo": {
205
"name": "Wrapped Ether on Fuse",
206
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
207
"symbol": "WETH",
208
"decimals": 18,
209
"chainId": 122,
210
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
211
},
212
"tags": []
213
},
214
"output": {
215
"decimals": 6,
216
"symbol": "USDC",
217
"name": "USD Coin on Fuse",
218
"chainId": 122,
219
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
220
"tokenInfo": {
221
"name": "USD Coin on Fuse",
222
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
223
"symbol": "USDC",
224
"decimals": 6,
225
"chainId": 122,
226
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
227
},
228
"tags": []
229
}
230
},
231
"tradeType": 0,
232
"inputAmount": {
233
"numerator": [
234
-1486618624,
235
232830643
236
],
237
"denominator": [
238
-1486618624,
239
232830643
240
],
241
"currency": {
242
"decimals": 18,
243
"symbol": "WETH",
244
"name": "Wrapped Ether on Fuse",
245
"chainId": 122,
246
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
247
"tokenInfo": {
248
"name": "Wrapped Ether on Fuse",
249
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
250
"symbol": "WETH",
251
"decimals": 18,
252
"chainId": 122,
253
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
254
},
255
"tags": []
256
},
257
"token": {
258
"decimals": 18,
259
"symbol": "WETH",
260
"name": "Wrapped Ether on Fuse",
261
"chainId": 122,
262
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
263
"tokenInfo": {
264
"name": "Wrapped Ether on Fuse",
265
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
266
"symbol": "WETH",
267
"decimals": 18,
268
"chainId": 122,
269
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
270
},
271
"tags": []
272
}
273
},
274
"outputAmount": {
275
"numerator": [
276
965616800
277
],
278
"denominator": [
279
1000000
280
],
281
"currency": {
282
"decimals": 6,
283
"symbol": "USDC",
284
"name": "USD Coin on Fuse",
285
"chainId": 122,
286
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
287
"tokenInfo": {
288
"name": "USD Coin on Fuse",
289
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
290
"symbol": "USDC",
291
"decimals": 6,
292
"chainId": 122,
293
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
294
},
295
"tags": []
296
},
297
"token": {
298
"decimals": 6,
299
"symbol": "USDC",
300
"name": "USD Coin on Fuse",
301
"chainId": 122,
302
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
303
"tokenInfo": {
304
"name": "USD Coin on Fuse",
305
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
306
"symbol": "USDC",
307
"decimals": 6,
308
"chainId": 122,
309
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
310
},
311
"tags": []
312
}
313
},
314
"executionPrice": {
315
"numerator": [
316
965616800
317
],
318
"denominator": [
319
-1486618624,
320
232830643
321
],
322
"baseCurrency": {
323
"decimals": 18,
324
"symbol": "WETH",
325
"name": "Wrapped Ether on Fuse",
326
"chainId": 122,
327
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
328
"tokenInfo": {
329
"name": "Wrapped Ether on Fuse",
330
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
331
"symbol": "WETH",
332
"decimals": 18,
333
"chainId": 122,
334
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
335
},
336
"tags": []
337
},
338
"quoteCurrency": {
339
"decimals": 6,
340
"symbol": "USDC",
341
"name": "USD Coin on Fuse",
342
"chainId": 122,
343
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
344
"tokenInfo": {
345
"name": "USD Coin on Fuse",
346
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
347
"symbol": "USDC",
348
"decimals": 6,
349
"chainId": 122,
350
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
351
},
352
"tags": []
353
},
354
"scalar": {
355
"numerator": [
356
-1486618624,
357
232830643
358
],
359
"denominator": [
360
1000000
361
]
362
}
363
},
364
"nextMidPrice": {
365
"numerator": [
366
-1457148607
367
],
368
"denominator": [
369
737751779,
370
915036005
371
],
372
"baseCurrency": {
373
"decimals": 18,
374
"symbol": "WETH",
375
"name": "Wrapped Ether on Fuse",
376
"chainId": 122,
377
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
378
"tokenInfo": {
379
"name": "Wrapped Ether on Fuse",
380
"address": "0xd8Bf72f3e163B9CF0C73dFdCC316417A5ac20670",
381
"symbol": "WETH",
382
"decimals": 18,
383
"chainId": 122,
384
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png"
385
},
386
"tags": []
387
},
388
"quoteCurrency": {
389
"decimals": 6,
390
"symbol": "USDC",
391
"name": "USD Coin on Fuse",
392
"chainId": 122,
393
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
394
"tokenInfo": {
395
"name": "USD Coin on Fuse",
396
"address": "0x620fd5fa44BE6af63715Ef4E65DDFA0387aD13F5",
397
"symbol": "USDC",
398
"decimals": 6,
399
"chainId": 122,
400
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/logo.png"
401
},
402
"tags": []
403
},
404
"scalar": {
405
"numerator": [
406
-1486618624,
407
232830643
408
],
409
"denominator": [
410
1000000
411
]
412
}
413
},
414
"priceImpact": {
415
"numerator": [
416
856059488,
417
1380480455,
418
-336661329,
419
549156708,
420
8387887
421
],
422
"denominator": [
423
1479278592,
424
1664736159,
425
977444823,
426
944423004,
427
32750022
428
]
429
}
430
}
431
}
432
}
Copied!

Success 200

Name
Type
Description
info
Object
Simplied quote object containing information about the trade
trade
Object
The trade object containing information about the trade e.g price

Create swap parameters for a Trade

​Back to top​
1
POST /swap/swapcallparameters
Copied!

Parameter Parameters

Name
Type
Description
currencyIn
String
The currency to spend
currencyOut
String
The desired currency out address
inputAmount
String
The desired amount to spend
recipient
string
The address that should receive the output of the swap
allowedSlippage
Number
optional
How much the execution price is allowed to move unfavorably from the trade execution price in Basis Points(BIPS)Default value: 50
ttl
Number
optional
How long the swap is valid until it expires in secondsDefault value: 1200

Success Response

Success-Response:
1
{
2
"methodName": "swapExactETHForTokens",
3
"args": [
4
"0x8f1573df661b2f",
5
[
6
"0x0BE9e53fd7EDaC9F859882AfdDa116645287C629",
7
"0xFaDbBF8Ce7D5b7041bE672561bbA99f79c532e10",
8
"0x94Ba7A27c7A95863d1bdC7645AC2951E0cca06bA"
9
],
10
"0x5670d7076E7b3604ceb07c003ff0920490756587",
11
"0x5fdf7e43"
12
],
13
"value": "0xde0b6b3a7640000",
14
"rawTxn": {
15
"data": "0x7ff36ab5000000000000000000000000000000000000000000000000008f1573df661b2f00000000000000000000000000000000000000000000000000000000000000800000000000000000000000005670d7076e7b3604ceb07c003ff0920490756587000000000000000000000000000000000000000000000000000000005fdf7e4300000000000000000000000000000000000000000000000000000000000000030000000000000000000000000be9e53fd7edac9f859882afdda116645287c629000000000000000000000000fadbbf8ce7d5b7041be672561bba99f79c532e1000000000000000000000000094ba7a27c7a95863d1bdc7645ac2951e0cca06ba",
16
"to": "0xFB76e9E7d88E308aB530330eD90e84a952570319",
17
"value": {
18
"type": "BigNumber",
19
"hex": "0x0de0b6b3a7640000"
20
}
21
}
22
}
Copied!

Success 200

Name
Type
Description
methodName
String
The method to call on Fuseswap RouterV2
args
String[]
The arguments to pass to the method, all hex encoded
value
String
The amount of wei to send in hex
rawTxn
Object
Unsigned transaction which represents the transaction that needs to be signed and submitted to the network
Last modified 6mo ago