Open Trade Validation

post
Open Trade Validation

https://api.futureswap.gg/prod/api/v1/exchange/0x8fA7490cedB7207281a5ceabee12773046dE664E/validation/openTrade/USER_ADDRESS
Checks if the trade will go through and at what values
Request
Response
Request
Path Parameters
USER_ADDRESS
required
string
Address of the trader/signer
Query Parameters
leverage
required
string
An integer between 2-10 (Note: this can change based on governance)
isLong
required
boolean
True: Open Long False: OpenShort
assetAmount
required
string
In Ether, the desired asset amount. If inputting collateralAmount, assetAmount must be set to 0
collateralAmount
required
string
In Ether, the collateral amount. If inputting assetAmount, collateralAmount must be set to 0
Response
200: OK
Trade validated
{
"reason": "if an error, will have reason",
"isValid": true,
"assetMarketPrice": "485834252430521084622",
"gasCostValue": "169378561",
"tradeFeeStable": "30000000000000",
"liquidationPrice": "197709117985167888"
"collateralAmount": "12000000000000000000"
"assetAmount": "518852114246190200048"
"spreadPercentage": "1500000000000000"
}
404: Not Found
Error validating
{ "message": "invalid inputs"}

‚Äč