Search
K

Get Crypto Swap Amount Out

Get crypto swap amount out using our APIs
This endpoint helps you get the amount you will receive on swap even before initiating the swap

Crypto Swap Amount Out API

post
https://api.lazerpay.engineering/api/v1/swap/crypto/amount-out

Example : NodeJS - Request

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.lazerpay.engineering/api/v1/swap/amount-out',
'headers': {
'Authorization': 'Bearer sk_test_1DrqX9FKzUsRr7CiF0nj3xQvRmk'
},
body: '{\n "from_coin": "USDT",\n "to_coin": "BUSD",\n "amount": 100\n}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Amount after swap

Important things to note

  • The blockchain field must be "Binance Smart Chain".
  • The from_coin field must either be "BUSD", "DAI", "USDT", or "USDC".
  • The to_coin field must either be "BUSD", "DAI", "USDT", or "USDC".
  • Also to_coin and from_coin cannot be the same
we only support the Binance smart chain for swaps. we will add more networks in the future.