Close Trade Validation

post
Close trade validation

https://api.futureswap.gg/prod/api/v1/exchange/0x8fA7490cedB7207281a5ceabee12773046dE664E/validation/closeTrade/USER_ADDRESS
This endpoint allows you to get free cakes.
Request
Response
Request
Path Parameters
USER_ADDRESS
required
string
User address that is closing the trade
Query Parameters
percentToClose
required
string
1 ether (18 decimal places) would be to close 100% 0.5 ether would close 50%
tradeId
required
string
The tradeId to close
Response
200: OK
Cake successfully retrieved.
{
assetMarketPrice: "100000000000000000000",
gasCostValue: "1000000000000000000",
profitLoss: {
isProfitable: boolean,
value: "100000000000000000000",
percent: "1000000000000000000",
},
positionDetails: {
remainingAssetAmount: "1000000000000000000",
remainingCollateralAmount: "100000000000000000000",
forcedFullClose: boolean,
},
hasFundsForGas: boolean,
tradeFeeStable: "1000000000000000000",
})
404: Not Found
Could not find a cake matching this query.
{ "message": "Trade not found"}

‚Äč