Leverage

POST /leverage

Adjust the leverage of your position. Only relevant for Isolated Margin users.

application/x-www-form-urlencoded

Body Required

  • pair string Required

    Market of position (e.g. "USD_BTCCALL_PERP")

  • leverage number Required

    Desired leverage for the position

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • code integer

      Response code

    • msg string

      Diagnostic message

    • result object

      Request result

      Hide result attributes Show result attributes
      • balances object

        Account balances

        Hide balances attribute Show balances attribute
        • ETH object

          ETH balance

          Hide ETH attributes Show ETH attributes
          • free number

            Available ETH balance

          • locked number

            ETH balance in use for open orders

          • ETH balance in use for pending withdrawals

          • pnl number

            ETH P&L. This number is updated every time you close an ETH-related position.

          • margin number

            ETH position margin.

          • fees number

            Fees paid since account creation.

      • Account positions

        Hide positions attribute Show positions attribute
  • 503 application/json

    Error

    Hide response attributes Show response attributes object
POST /leverage
curl \
 -X POST https://api.testnet.everstrike.io/leverage \
 -H "x-api-key: $API_KEY" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'pair=string&leverage=42.0'
Response examples (200)
{
  "code": 200,
  "msg": "null",
  "result": {
    "balances": {
      "BTC": {
        "free": 21,
        "locked": 2,
        "withdrawn": 0
      }
    },
    "positions": {
      "USD_BTCCALL_PERP": {
        "free": 1,
        "size": 1,
        "stats": {
          "lp": 3.7,
          "pnl": 0,
          "roe": 0,
          "mark": 2.1,
          "size": 1,
          "equity": 1,
          "margin": 1,
          "bankrupt": 3.78,
          "leverage": 2.82,
          "notional": 0.14,
          "avg_entry": 3.4,
          "direction": "BUY"
        },
        "locked": 0,
        "realized": 0
      }
    }
  }
}
Response examples (503)
{
  "code": 503,
  "msg": "Invalid request",
  "result": {}
}