Swagger
Last updated
Was this helpful?
Last updated
Was this helpful?
This endpoint retrieves a list of decentralized exchanges (dexes) where the selected pair can be swapped. The list is sorted by profit, so we recommend choosing the first dex in the list.
/api/v1/swap/estimate-all
Source token. (Supported values for chainId are 1, 56, 137, 43114, 42161 and 324)
{"fromToken[address]":"0x0000000000000000000000000000000000001010","fromToken[chainId]":137,"fromToken[decimals]":18,"fromToken[name]":"Matic Token","fromToken[symbol]":"MATIC"}
Destination token. (Supported values for chainId are 1, 56, 137, 43114, 42161 and 324)
{"toToken[address]":"0x483dd3425278C1f79F377f1034d9d2CaE55648B6","toToken[chainId]":137,"toToken[decimals]":18,"toToken[name]":"Crowd Token","toToken[symbol]":"CROWD"}
An amount of fromToken
to be swapped (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
The price of the selected network's coin based on USD. Example: price of BNB = 245.82
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
Gas Price based on selected network (The unit is gwei)
filters dexes to be searched for an estimation, providing results only from these selected dexes.
CrowdswapAggregator,CrowdSwapV2,Quickswap
This endpoint returns from
, to
, data
, value
, and gasLimit
, all of which needed for executing a swap transaction
CrowdSwapV2
, Quickswap
/api/v1/swap/{dex}
The dex name which will be used for the swap transaction. This value is available in the estimation result as swapName
Source token. (Supported values for chainId are 1, 56, 137, 43114, 42161 and 324)
{"fromToken[address]":"0x0000000000000000000000000000000000001010","fromToken[chainId]":137,"fromToken[decimals]":18,"fromToken[name]":"Matic Token","fromToken[symbol]":"MATIC"}
Destination token. (Supported values for chainId are 1, 56, 137, 43114, 42161 and 324)
{"toToken[address]":"0x483dd3425278C1f79F377f1034d9d2CaE55648B6","toToken[chainId]":137,"toToken[decimals]":18,"toToken[name]":"Crowd Token","toToken[symbol]":"CROWD"}
An amount of fromToken
to be swapped (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
The price of the selected network's coin based on USD. Example: price of BNB = 245.82
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
Address of the user who initiates the swap transaction
Address of the recipient
The minimum amount out expected from a swap (This amount is available in the estimation result. Also the decimal of token must be considered in the amount)
Swap estimation will be expired after this deadline (The unit of deadline is based on minutes)
{"value":"15"}
This endpoint finds a route with the potentially best possible outcome for the requested cross-chain pair and returns an estimation.
/api/v1/crossChainSwap/estimate-all
Source token. (Supported values for chainId are 1, 56, 137, 43114, 42161 and 324)
{"fromToken[address]":"0x0000000000000000000000000000000000001010","fromToken[chainId]":137,"fromToken[decimals]":18,"fromToken[name]":"Matic Token","fromToken[symbol]":"MATIC"}
An amount of fromToken
to be swapped (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
Destination token. (Supported values for chainId are 1, 56, 137, 43114, 42161 and 324)
{"toToken[address]":"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE","toToken[chainId]":56,"toToken[decimals]":18,"toToken[name]":"Binance Coin","toToken[symbol]":"BNB"}
Address of the user who initiates the cross-chain swap transaction
This endpoint returns from
, to
, data
, value
, and gasLimit
, all of which needed for investing in an opportunity. Also it returns amountDesiredTokenA
, amountDesiredTokenB
, and amountLP
to show to the investors.
CROWD_USDT_LP_STAKE
, mai-usdc-mimatic
,and CAKE_WBNB_PANCAKE
/api/v1/opportunity/{opportunity}/investByToken
User address who submits input tokens for an investment
The token that user choose to invest with. (In investByTokenATokenB, we choose the token that user enter its amount first)
{"token[address]":"0x0000000000000000000000000000000000001010","token[chainId]":137,"token[decimals]":18,"token[name]":"Matic Token","token[symbol]":"MATIC","token[price]":0.94036}
An amount of input tokens to invest (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
The price of selected network's coin based on USD. Example: price of BNB = 279.22
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
swap estimation will be expired after this deadline (the unit of deadline is based on minutes)
{"value":"15"}
This endpoint returns from
, to
, data
, value
, and gasLimit
, all of which needed for investing in an opportunity. Also it returns amountDesiredTokenA
, amountDesiredTokenB
, and amountLP
to show to the investors.
CROWD_USDT_LP_STAKE
, mai-usdc-mimatic
,and CAKE_WBNB_PANCAKE
/api/v1/opportunity/{opportunity}/investByTokenAAndTokenB
User address who submits input tokens for an investment
The token that user choose to invest with. (In investByTokenATokenB, we choose the token that user enter its amount first)
{"token[address]":"0x0000000000000000000000000000000000001010","token[chainId]":137,"token[decimals]":18,"token[name]":"Matic Token","token[symbol]":"MATIC","token[price]":0.94036}
An amount of input tokens to invest (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
The price of selected network's coin based on USD. Example: price of BNB = 279.22
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
swap estimation will be expired after this deadline (the unit of deadline is based on minutes)
{"value":"15"}
This endpoint returns from
, to
, data
, value
, and gasLimit
, all of which needed for investing in an opportunity. Also it returns amountDesiredTokenA
, amountDesiredTokenB
, and amountLP
to show to the investors.
CROWD_USDT_LP_STAKE
, mai-usdc-mimatic
,and CAKE_WBNB_PANCAKE
/api/v1/opportunity/{opportunity}/investByTokenAOrTokenB
User address who submits input tokens for an investment
The token that user choose to invest with. (In investByTokenATokenB, we choose the token that user enter its amount first)
{"token[address]":"0x0000000000000000000000000000000000001010","token[chainId]":137,"token[decimals]":18,"token[name]":"Matic Token","token[symbol]":"MATIC","token[price]":0.94036}
An amount of input tokens to invest (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
The price of selected network's coin based on USD. Example: price of BNB = 279.22
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
swap estimation will be expired after this deadline (the unit of deadline is based on minutes)
{"value":"15"}
This endpoint returns from
, to
, data
, value
, and gasLimit
, all of which needed for investing in an opportunity. Also it returns amountDesiredTokenA
, amountDesiredTokenB
, and amountLP
to show to the investors.
CROWD_USDT_LP_STAKE
, mai-usdc-mimatic
,and CAKE_WBNB_PANCAKE
/api/v1/opportunity/{opportunity}/investByLP
User address who submits input tokens for an investment
The token that user choose to invest with. (In investByTokenATokenB, we choose the token that user enter its amount first)
{"token[address]":"0x0000000000000000000000000000000000001010","token[chainId]":137,"token[decimals]":18,"token[name]":"Matic Token","token[symbol]":"MATIC","token[price]":0.94036}
An amount of input tokens to invest (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
The price of selected network's coin based on USD. Example: price of BNB = 279.22
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
swap estimation will be expired after this deadline (the unit of deadline is based on minutes)
{"value":"15"}
This endpoint returns from
, to
, data
, value
, and gasLimit
, all of which needed for leaving from an opportunity.
CROWD_USDT_LP_STAKE
, mai-usdc-mimatic
,and CAKE_WBNB_PANCAKE
/api/v1/opportunity/{opportunity}/leaveByLP
User address who submits input tokens for an investment
The token that user choose to invest with. (In investByTokenATokenB, we choose the token that user enter its amount first)
{"token[address]":"0x0000000000000000000000000000000000001010","token[chainId]":137,"token[decimals]":18,"token[name]":"Matic Token","token[symbol]":"MATIC","token[price]":0.94036}
An amount of input tokens to invest (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
The price of selected network's coin based on USD. Example: price of BNB = 279.22
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
swap estimation will be expired after this deadline (the unit of deadline is based on minutes)
{"value":"15"}
This endpoint returns tvl
, apy
, dailyInterest
to inform users about how much the opportuniy profitable
CROWD_USDT_LP_STAKE
, mai-usdc-mimatic
,and CAKE_WBNB_PANCAKE
/api/v1/opportunity/getDetails/{opportunity}
tokenA
{"fromToken[address]":"0x0000000000000000000000000000000000001010","fromToken[chainId]":137,"fromToken[decimals]":18,"fromToken[name]":"Matic Token","fromToken[symbol]":"MATIC","fromToken[price]":0.94036}
tokenB
{"fromToken[address]":"0x0000000000000000000000000000000000001010","fromToken[chainId]":137,"fromToken[decimals]":18,"fromToken[name]":"Matic Token","fromToken[symbol]":"MATIC","fromToken[price]":0.94036}
CROWD_USDT_LP_STAKE
, mai-usdc-mimatic
,and CAKE_WBNB_PANCAKE
/api/v1/opportunity/{opportunity}/crossChainEstimation
Source Chain Id
{"value":"1"}
Source Chain Token Address
{"value":"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"}
An amount of input tokens to cross-chain swap (The decimal of token must be considered in the amount)
{"value":"1000000000000000000"}
A slippage constraint (in %) is a safeguard during swaps. It is used to calculate the minimum possible outcome during estimation.
Destination Chain Id
{"value":"1"}
Destination Chain Token Address
{"value":"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"}
User address who submits input tokens for a cross-chain swap