/getprice
Returns the swap quotation for a given token pair.
GET
https://api.expand.network/dex/getprice
Query Parameter
Remote procedural call URL.
Refer to the DEX ID page for details.
Comma separated values of token addresses whose price is to be fetched.
Sample Request Sample Response
Copy https://api.expand.network/dex/getprice?dexId=2400&amountIn=100000000000000000&path=yUSDC%3AGDGTVWSM4MGS4T7Z6W4RPWOCHE2I6RDFCIFZGS3DOA63LWQTRNZNTTFF%2CXLM
Copy {
"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
Remote procedural call URL.
Refer to the DEX ID page for details.
Public address of liquidity provider.
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.
Sample Request Sample Response
Copy https://api.expand.network/dex/getuserliquidity?address=GDZUSPMPAWY3JF6J4BEC7RVVVOUKCQZJRVA4NAA6HCS2GRG57DIMGCW3&dexId=2400&path=XBTC%3AGA7JNTXAHMMDUTLX72UM5PWHOAMJEDUQ6GREQZBLMAPVF5WM2JH4XBTC%2CyXLM%3AGARDNV3Q7YGT4AKSDF25LT32YSCCW4EV22Y2TV3I2PU2MMXJTEDL5T55
Copy {
"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
Remote procedural call URL.
Refer to the DEX ID page for details.
Pool address whose liquidity is to be fetched.
Sample Request Sample Response
Copy https://api.expand.network/dex/getpoolliquidity?poolAddress=ffff7fe3743b3c63b12e80f22aed5e8799aa986e25fe155a19277b660d547e71&dexId=2400
Copy {
"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
Remote procedural call URL.
Refer to the DEX ID page for details.
Pool address whose liquidity is to be fetched.
Sample Request Sample Response
Copy https://api.expand.network/dex/gettokenliquidity?poolAddress=843659d3962c3193a16388d60702e725940d36ec534727dc2308e8e7e427dbdd&dexId=2400
Copy {
"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
Remote procedural call URL.
Refer to the DEX ID page for details.
Pool address whose liquidity is to be fetched.
Sample Request Sample Response
Copy https://api.expand.network/dex/getliquidityholders?poolAddress=66b2286fa2cabdf1914abea058e3a18b1267643d818ae76dc1a5994fb22b9886&dexId=2400
Copy {
"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
Remote procedural call URL.
Refer to the DEX ID page for details.
Comma-separated values of token addresses, inside an array, to swap.
Note: For assets other than XLM (Native token), the token issuer is required.
Amount of token to be swapped.
Minimum amount accepted as the result of swap.
Address of the sender of the token.
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
Sample Request Sample Response
Copy {
"amountIn" : "150000000" ,
"amountOutMin" : "12" ,
"from" : "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ" ,
"slippage" : "10" ,
"dexId" : "2400" ,
"path" : [
"XLM" ,
"apUSDC:GALLBRBQHAPW5FOVXXHYWR6J4ZDAQ35BMSNADYGBW25VOUHUYRZM4XIL"
]
}
Copy {
"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
Remote procedural call URL.
Refer to the DEX ID page for details.
Comma-separated values of token addresses, inside an array, to swap.
Note: For assets other than XLM (Native token), the token issuer is required.
Amount of token to be swapped.
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
Address of the sender of the token.
Sample Request Sample Response
Copy {
"dexId" : "2400" ,
"amountIn" : [
"1000000" ,
"1000000"
] ,
"from" : "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ" ,
"path" : [
"XBTC:GA7JNTXAHMMDUTLX72UM5PWHOAMJEDUQ6GREQZBLMAPVF5WM2JH4XBTC" ,
"yXLM:GARDNV3Q7YGT4AKSDF25LT32YSCCW4EV22Y2TV3I2PU2MMXJTEDL5T55"
] ,
"slippage" : "10"
}
Copy {
"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
Remote procedural call URL.
Refer to the DEX ID page for details.
Comma-separated values of token addresses, inside an array, to swap.
Note: For assets other than XLM (Native token), the token issuer is required.
Minimum amount to be received.
Percentage of total swap value. By default, 1.
0 <= slippage value <= 10
Address of the sender of the token.
The liquidity to be removed.
Sample Request Sample Response
Copy {
"dexId" : "2400" ,
"from" : "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ" ,
"path" : [
"XBTC:GA7JNTXAHMMDUTLX72UM5PWHOAMJEDUQ6GREQZBLMAPVF5WM2JH4XBTC" ,
"yXLM:GARDNV3Q7YGT4AKSDF25LT32YSCCW4EV22Y2TV3I2PU2MMXJTEDL5T55"
] ,
"liquidity" : "100000" ,
"amountOutMin" : [
"32" ,
"32"
] ,
"slippage" : "10"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1500" ,
"from" : "GARNHXH36IUZE4F5MON5XBQX37OGVFGCOPOPN7CPQL3TP7VX2XI35QUJ" ,
"gas" : "100" ,
"data" : "AAAAAgAAAAAi09z78imScL1jm9uGF9/capTCc9z2/E+C9zf+t9XRvgAAAGQDC8UiAAAACQAAAAEAAAAAAAAAAAAAAABmxhUUAAAAAAAAAAEAAAAAAAAAF/0rTbuA/n4qk8r4/0Kxxsx0wcK5wLfMQeHCGVWwH8H1AAAAAAABhqAAAAAAAAAAHQAAAAAAAAAdAAAAAAAAAAA=" ,
"referenceId" : "83a42ff85f7045829ec2f8809102caa6"
}
}