SDEX
/getprice
Returns the swap quotation for a given token pair.
GET https://api.expand.network/dex/getprice
Query Parameter
rpc
String
Remote procedural call URL.
amountIn*
String
Amount of token.
path*
String
Comma separated values of token addresses whose price is to be fetched.
https://api.expand.network/dex/getprice?dexId=2400&amountIn=100000000000000000&path=yUSDC%3AGDGTVWSM4MGS4T7Z6W4RPWOCHE2I6RDFCIFZGS3DOA63LWQTRNZNTTFF%2CXLM{
"status": 200,
"msg": "success",
"data": {
"amountIn": "100000000000000000",
"path": [
"yUSDC:GDGTVWSM4MGS4T7Z6W4RPWOCHE2I6RDFCIFZGS3DOA63LWQTRNZNTTFF",
"XLM"
],
"amountsOut": [
"100000000000000000",
"6403037405751"
]
}
}/getuserliquidity
Returns the balance of a particular token pair of an account.
GET https://api.expand.network/dex/getuserliquidity
Query Parameter
rpc
String
Remote procedural call URL.
address*
String
Public address of liquidity provider.
path*
String
Comma separated values of token addresses whose price is to be fetched. Note: 1) Assets should be in lexicographic order. 2) For assets other than XLM (Native token), the token issuer is required.
https://api.expand.network/dex/getuserliquidity?address=GDZUSPMPAWY3JF6J4BEC7RVVVOUKCQZJRVA4NAA6HCS2GRG57DIMGCW3&dexId=2400&path=XBTC%3AGA7JNTXAHMMDUTLX72UM5PWHOAMJEDUQ6GREQZBLMAPVF5WM2JH4XBTC%2CyXLM%3AGARDNV3Q7YGT4AKSDF25LT32YSCCW4EV22Y2TV3I2PU2MMXJTEDL5T55{
"status": 200,
"msg": "success",
"data": {
"pairAddress": "fd2b4dbb80fe7e2a93caf8ff42b1c6cc74c1c2b9c0b7cc41e1c21955b01fc1f5",
"liquidity": "31306548835",
"tokenA": "319735818813889",
"tokenB": "11224502"
}
}/getpoolliquidity
Returns the total liquidity for a specified pool.
GET https://api.expand.network/dex/getpoolliquidity
Query Parameter
rpc
String
Remote procedural call URL.
poolAddress*
String
Pool address whose liquidity is to be fetched.
https://api.expand.network/dex/getpoolliquidity?poolAddress=ffff7fe3743b3c63b12e80f22aed5e8799aa986e25fe155a19277b660d547e71&dexId=2400{
"status": 200,
"msg": "success",
"data": {
"totalLiquidity": "313065488356"
}
}/gettokenliquidity
Returns the individual token liquidity within the specified liquidity pool.
GET https://api.expand.network/dex/gettokenliquidity
Query Parameter
rpc
String
Remote procedural call URL.
poolAddress*
String
Pool address whose liquidity is to be fetched.
https://api.expand.network/dex/gettokenliquidity?poolAddress=843659d3962c3193a16388d60702e725940d36ec534727dc2308e8e7e427dbdd&dexId=2400{
"status": 200,
"msg": "success",
"data": {
"native": "222295315",
"BTC:GBWCFQGDIUJ35X3VTUDB2LHCJFIPZJGDE3XOGMKPWA2D3EZPL2LBNBTC": "2467709804653380"
}
}/getliquidityholders
Returns the total number of liquidity holders in the specified pool.
GET https://api.expand.network/dex/getliquidityholders
Query Parameter
rpc
String
Remote procedural call URL.
poolAddress*
String
Pool address whose liquidity is to be fetched.
https://api.expand.network/dex/getliquidityholders?poolAddress=66b2286fa2cabdf1914abea058e3a18b1267643d818ae76dc1a5994fb22b9886&dexId=2400{
"status": 200,
"msg": "success",
"data": {
"totalTokenHolders": "803"
}
}/swap
Initiate a swap transaction on a specified DEX.
POST https://api.expand.network/dex/swap
Request Body
rpc
String
Remote procedural call URL.
path*
String
Comma-separated values of token addresses, inside an array, to swap. Note: For assets other than XLM (Native token), the token issuer is required.
amountIn*
String
Amount of token to be swapped.
amountOutMin*
String
Minimum amount accepted as the result of swap.
from*
String
Address of the sender of the token.
slippage
String
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
{
"amountIn": "150000000",
"amountOutMin": "12",
"from": "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ",
"slippage": "10",
"dexId": "2400",
"path": [
"XLM",
"apUSDC:GALLBRBQHAPW5FOVXXHYWR6J4ZDAQ35BMSNADYGBW25VOUHUYRZM4XIL"
]
}{
"status": 200,
"msg": "success",
"data": {
"chainId": "1500",
"from": "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ",
"gas": "100",
"data": "AAAAAgAAAAAi09z78imScL1jm9uGF9/capTCc9z2/E+C9zf+t9XRvgAAAGQDC8UiAAAACQAAAAEAAAAAAAAAAAAAAABmxhT0AAAAAAAAAAEAAAAAAAAADQAAAAAAAAAACPDRgAAAAAAi09z78imScL1jm9uGF9/capTCc9z2/E+C9zf+t9XRvgAAAAJhcFVTREMAAAAAAAAAAAAAFrDEMDgfbpXVvc+LR8nmRghvoWSaAeDBtrtXUPTEcs4AAAAAAAAACwAAAAAAAAAAAAAAAA==",
"referenceId": "3b37b58444cf4d8fbdf81437adf4d547"
}
}/addliquidity
Add liquidity to a specified pool in a specified DEX.
POST https://api.expand.network/dex/addliquidity
Request Body
rpc
String
Remote procedural call URL.
path*
String
Comma-separated values of token addresses, inside an array, to swap. Note: For assets other than XLM (Native token), the token issuer is required.
amountIn*
String
Amount of token to be swapped.
slippage
String
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
from*
String
Address of the sender of the token.
{
"dexId": "2400",
"amountIn": [
"1000000",
"1000000"
],
"from": "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ",
"path": [
"XBTC:GA7JNTXAHMMDUTLX72UM5PWHOAMJEDUQ6GREQZBLMAPVF5WM2JH4XBTC",
"yXLM:GARDNV3Q7YGT4AKSDF25LT32YSCCW4EV22Y2TV3I2PU2MMXJTEDL5T55"
],
"slippage": "10"
}{
"status": 200,
"msg": "success",
"data": {
"chainId": "1500",
"from": "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ",
"gas": "100",
"data": "AAAAAgAAAAAi09z78imScL1jm9uGF9/capTCc9z2/E+C9zf+t9XRvgAAAZADC8UiAAAACQAAAAEAAAAAAAAAAAAAAABmxhUEAAAAAAAAAAQAAAAAAAAABgAAAAMAAAAAAAAAAVhCVEMAAAAAPpbO4DsYOk13/qjOvsdwGJIOkPGiSGQrYB9S9szST8sAAAABeVhMTQAAAAAiNtdw/g0+AVIZddXPesSEK3CV1rGp12jT6aYy6ZkGvgAAAB4AAAAAfSt1AAAAAAAAAAAGAAAAAVhCVEMAAAAAPpbO4DsYOk13/qjOvsdwGJIOkPGiSGQrYB9S9szST8sAAAAAAA9CQAAAAAAAAAAGAAAAAXlYTE0AAAAAIjbXcP4NPgFSGXXVz3rEhCtwldaxqddo0+mmMumZBr4AAAAAAA9CQAAAAAAAAAAW/StNu4D+fiqTyvj/QrHGzHTBwrnAt8xB4cIZVbAfwfUAAAAAAA9CQAAAAAAAD0JAAAAAAQAAAAoAAAATAAAACgAAAAAAAAAA",
"referenceId": "aae58191213a4f7c89e1511487e02946"
}
}/removeliquidity
Remove liquidity from a specified pool for a specified DEX.
POST https://api.expand.network/dex/removeliquidity
Request Body
rpc
String
Remote procedural call URL.
path*
String
Comma-separated values of token addresses, inside an array, to swap. Note: For assets other than XLM (Native token), the token issuer is required.
amountOutMin*
String
Minimum amount to be received.
slippage
String
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
from*
String
Address of the sender of the token.
liquidity*
String
The liquidity to be removed.
{
"dexId": "2400",
"from": "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ",
"path": [
"XBTC:GA7JNTXAHMMDUTLX72UM5PWHOAMJEDUQ6GREQZBLMAPVF5WM2JH4XBTC",
"yXLM:GARDNV3Q7YGT4AKSDF25LT32YSCCW4EV22Y2TV3I2PU2MMXJTEDL5T55"
],
"liquidity": "100000",
"amountOutMin": [
"32",
"32"
],
"slippage": "10"
}{
"status": 200,
"msg": "success",
"data": {
"chainId": "1500",
"from": "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ",
"gas": "100",
"data": "AAAAAgAAAAAi09z78imScL1jm9uGF9/capTCc9z2/E+C9zf+t9XRvgAAAGQDC8UiAAAACQAAAAEAAAAAAAAAAAAAAABmxhUUAAAAAAAAAAEAAAAAAAAAF/0rTbuA/n4qk8r4/0Kxxsx0wcK5wLfMQeHCGVWwH8H1AAAAAAABhqAAAAAAAAAAHQAAAAAAAAAdAAAAAAAAAAA=",
"referenceId": "83a42ff85f7045829ec2f8809102caa6"
}
}Last updated

