Positions
Create, update, or close perpetual trading positions and limit orders
Creates a leveraged perpetual trading position.
Body
Responses
200
Successfully created position transaction
application/json
400
Invalid request
application/json
500
Server error
application/json
post
POST /api/perpetuals/openPosition HTTP/1.1
Host: app.strikefinance.org
Content-Type: application/json
Accept: */*
Content-Length: 191
{
"request": {
"address": "text",
"asset": {
"policyId": "text",
"assetName": "text"
},
"collateralAmount": 1,
"leverage": 1,
"position": "Long",
"stopLossPrice": 1,
"takeProfitPrice": 1,
"partnerAddress": "text"
}
}
{
"cbor": "text"
}
Creates a leveraged perpetual position but only executes when the limit price is met.
Body
requestall ofRequired
Responses
200
Successfully created limit order transaction
application/json
400
Invalid request
application/json
500
Server error
application/json
post
POST /api/perpetuals/openLimitOrder HTTP/1.1
Host: app.strikefinance.org
Content-Type: application/json
Accept: */*
Content-Length: 209
{
"request": {
"address": "text",
"asset": {
"policyId": "text",
"assetName": "text"
},
"collateralAmount": 1,
"leverage": 1,
"position": "Long",
"stopLossPrice": 1,
"takeProfitPrice": 1,
"partnerAddress": "text",
"limitUSDPrice": 1
}
}
{
"cbor": "text"
}
Closes a perpetual trading position and calculates PnL.
Body
Responses
200
Successfully closed position transaction
application/json
400
Invalid request
application/json
500
Server error
application/json
post
POST /api/perpetuals/closePosition HTTP/1.1
Host: app.strikefinance.org
Content-Type: application/json
Accept: */*
Content-Length: 120
{
"request": {
"address": "text",
"asset": {
"policyId": "text",
"assetName": "text"
},
"outRef": {
"txHash": "text",
"outputIndex": 1
}
}
}
{
"cbor": "text"
}
Cancels an existing limit order for perpetual trading.
Body
Responses
200
Successfully cancelled limit order
application/json
405
Method not allowed
application/json
500
Internal server error
application/json
post
POST /api/perpetuals/cancelLimitOrder HTTP/1.1
Host: app.strikefinance.org
Content-Type: application/json
Accept: */*
Content-Length: 120
{
"request": {
"address": "text",
"asset": {
"policyId": "text",
"assetName": "text"
},
"outRef": {
"txHash": "text",
"outputIndex": 1
}
}
}
{
"cbor": "text"
}
Updates stop loss and take profit prices for an existing perpetual position.
Body
Responses
200
Successfully updated position
application/json
405
Method not allowed
application/json
500
Internal server error
application/json
post
POST /api/perpetuals/updatePosition HTTP/1.1
Host: app.strikefinance.org
Content-Type: application/json
Accept: */*
Content-Length: 172
{
"request": {
"address": "text",
"asset": {
"policyId": "text",
"assetName": "text"
},
"outRef": {
"txHash": "text",
"outputIndex": 1
},
"stopLossPrice": 1,
"takeProfitPrice": 1,
"side": "Long"
}
}
{
"cbor": "text"
}