---
title: "GetEstimatedFees"
method: POST
path: "/order_service.v1.OrderService/GetEstimatedFees"
tags: ["Orders"]
---

# GetEstimatedFees

`POST /order_service.v1.OrderService/GetEstimatedFees`

Estimates the trading fee for opening a position, given the margin
 you plan to post and the leverage you intend to use. The fee is
 computed as if it were deducted from `margin` upfront, before the
 position opens: `fee = (rate / (1 + rate)) * margin`, where `rate`
 is the market's configured trade-fee rate multiplied by `leverage`.

 If the market has no trade-fee percentage configured, this returns
 a successful response with `fees: -1` rather than an error.

## Headers

- `Connect-Protocol-Version` 1, required — Define the version of the Connect protocol. If omitted, use 1.
- `Connect-Timeout-Ms` number — Define the timeout, in ms

## Request body

- OrderServiceV1GetEstimatedFeesRequest
  - `marketId` string, int64 — Market to estimate the fee for.
  - `margin` number, float — Collateral you plan to post for the position, in quote asset units.
  - `leverage` number, float — Leverage multiplier you intend to use. Combined with the market's configured trade-fee rate to compute the effective fee rate.
  - `size` number, float — Currently unused by the server. Reserved for future fee calculations that account for position size.
  - `price` number, float — Currently unused by the server. Reserved for future fee calculations that account for entry price.

## Response `200`

Success

- OrderServiceV1GetEstimatedFeesResponse
  - `fees` number, float — Estimated fee in USDC, deducted from `margin` upfront. `-1` if the market has no trade-fee percentage configured.

---

[API](https://skmtc.dev/fairground/apis/fairground-fi-api.md) · [All operations](https://skmtc.dev/fairground/apis/fairground-fi-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fairground/fairground-fi-api/revisions/be66e6dc0ac0/schema)
