---
title: "Fill an order"
method: POST
path: "/orders/fill/v2"
tags: ["Orders"]
---

# Fill an order

`POST /orders/fill/v2`

## Request body

- object
  - `market` string, required — The market hash of the market you are filling an order on
  - `baseToken` string, required — The address of the ERC-20 token representing the currency of the fill. Token addresses vary by network — see the `addresses` field in GET /metadata or the References page for the correct address.
  - `isTakerBettingOutcomeOne` boolean, required — Whether or not taker is betting outcome 1 (team 1 wins), if false then taker is betting outcome 2 (team 2 wins)
  - `stakeWei` string, required — The stake amount for this bet in wei units - see Unit Conversion. Minimum 1 USDC.
  - `desiredOdds` string, required — The worst taker odds acceptable for filling, used as an anchor when applying oddsSlippage - note that any order found with taker odds better than the desiredOdds can still fill if found at the time of order matching
  - `oddsSlippage` integer, required — An integer between 0-100 representing the percentage of tolerance that is acceptable based on desiredOdds
  - `fillSalt` string, required — Random 32 byte string to identify this fill. Must match the fillSalt used when computing the signing payload
  - `taker` string, required — Address of the taker taking the bet
  - `takerSig` string, required — Your wallet signature over the fill payload.

## Response `201`

- object
  - `status` string — `success` or `failure` if the request succeeded or not
  - `data` object
    - `fillHash` string — Hash of the submitted fill
    - `isPartialFill` boolean — Whether the fill was only partially filled
    - `totalFilled` string — Total amount filled in wei units
    - `averageOdds` string — Average odds of the fill in SX protocol format (implied * 10^20)

## Other responses

- `400` — Error Codes: `INSUFFICIENT_KYC` — user has not registered on sx.bet `AFTER_ORDER_EXPIRY` — One of the orders have expired `BASE_TOKENS_NOT_SAME` — All orders must be for the same `baseToken` `MARKETS_NOT_SAME` — All orders must be for the same market `DIRECTIONS_NOT_SAME` — All orders must be betting on the same side `isMakerBettingOutcomeOne` `INVALID_ORDERS` — Order is now inactive `INVALID_ODDS` — Invalid desiredOdds, must be less than 10^20 `INVALID_ODDS_SLIPPAGE` — Invalid oddsSlippage, must be an integer between 0-100 `MATCH_STATE_INVALID` — The fixture for the order is in an invalid state and is not bettable anymore `TAKER_SIGNATURE_MISMATCH` — The taker signature generated for the request is invalid `PROXY_ACCOUNT_INVALID` — The proxy account is invalid (only applicable if proxyTaker was specified in request) `TAKER_AMOUNT_TOO_LOW` — The stakeWei specified is too low for the current token `META_TX_RATE_LIMIT_REACHED` — Cannot have more than 10 meta transactions at once `INSUFFICIENT_SPACE` — There is not enough space to fill the matched orders due to other pending fills `FILL_ALREADY_SUBMITTED` — The fill has already been submitted `ODDS_STALE` — No orders could be found for the desiredOdds and oddsSlippage, try again with greater oddsSlippage `FILL_TIMED_OUT` — The fill request timed out before completing `MARKET_DOESNT_EXIST` — The specified market does not exist

---

[API](https://skmtc.net/sx/apis/sx-bet-api.md) · [All operations](https://skmtc.net/sx/apis/sx-bet-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sx/sx-bet-api/versions/eb2c05c3a98e/schema)
