1. CRX
  2. API reference
  3. Account
  4. List your open positions

List your open positions

GET/positions

Lists your open positions. Granted viewers can call it.

Authentication

  • x-crx-address x-crx-ts x-crx-sig
  • x-crx-address x-crx-signer x-crx-ts x-crx-sig
  • x-crx-session

Parameters

NameInTypeDescription
chainquerystring

Filter: a chains[].key from GET /health, such as ethereum.

pairquerystring

Filter: USDBRL or USD/BRL.

Responses

200

OK.

FieldTypeDescription
positions requiredarray of object
positions[].trade_id requiredstring
positions[].rfq_id requiredstring
positions[].chain requiredstring
positions[].pair requiredstring

Pair, such as USD/BRL.

positions[].notional requiredstring

Decimal string.

positions[].rate requiredstring

Decimal string.

positions[].entry_price requiredstring or null

The forward rate at which the position opened, as a decimal string with six decimal places. It is the same value as rate.

positions[].mark_price requiredstring or null

The current forward rate for the position: CRX's latest on-chain forward curve for the pair, applied to the live spot rate, at the position's settlement date. It is a decimal string with six decimal places. null until the trade is open, after the settlement date, while the pair is paused or delisted, or when no current price is available.

positions[].mark_time requiredinteger or null

The time of the price behind mark_price, as Unix time in milliseconds: the time of the live spot rate, or of the forward curve when no live spot rate is available. null when mark_price is null.

positions[].unrealized_pnl requiredstring or null

Your profit or loss on the position if it settled at mark_price, in USDC, by the rule CRX applies at settlement. It is a signed decimal string with six decimal places; a positive value is a gain to you. null when mark_price is null.

positions[].settlement requiredintegerminimum 0

Settlement time.

positions[].premium_bps requiredinteger
positions[].status requiredstring or null

pending (on chain, not yet open), open or refused. An open trade is final once GET /trades shows trade.opened with no provisional key.

positions[].awaiting_fixing requiredboolean

true if past its fixing date and waiting for its price.

positions[].pair_status requiredstring active paused delisted
positions[].delisting_atintegerminimum 0

Scheduled delisting time. Omitted if none.

positions[].as_of_block requiredinteger or null

Block number, or null.

positions[].leg_id requiredstring

Your leg ID.

positions[].side requiredinteger 1 -1

Your side: 1 buys the base, -1 sells it.

positions[].fixing_adjustmentobject

Your Fixing adjustment, on a trade you requested with settlement_fixing. Omitted on every other position.

The Fixing adjustment of a trade that settles at an official fixing: the result at the fixing less the result at the market price, in USDC, when the fixing gives the better result. Your trade only.

positions[].fixing_adjustment.reference requiredstring BRL PTAX Banxico FIX PHP BAP

The fixing.

positions[].fixing_adjustment.fixing requiredstring or null

The fixing as published. null until it is known.

positions[].fixing_adjustment.amount requiredstring or null

The adjustment CRX pays you, in USDC, a decimal string with six decimal places. 0.000000 if none is due. null until it is known.

positions[].fixing_adjustment.outstanding requiredstring or null

Always 0.000000. Kept for clients that read it.

positions[].fixing_adjustment.paid requiredstring or null

USDC CRX sent for this trade. null if not known.

positions[].fixing_adjustment.status requiredstring pending paid held none

pending: not yet paid. paid: paid in full. held: under review by CRX. none: no adjustment applies, for example when the fixing does not give the better result or after an early close.

positions[].fixing_adjustment.tx requiredstring or null

The USDC transfer, once sent. null before.

net_positions requiredarray of object

Your positions netted by chain, pair and settlement date, one row for each. A close is a trade on the opposite side at the same settlement date; the row shows what remains.

net_positions[].chain requiredstring

Chain key, such as ethereum.

net_positions[].pair requiredstring

Pair, such as USD/BRL.

net_positions[].settlement requiredintegerminimum 0

Settlement date of the netted trades, as Unix time in milliseconds.

net_positions[].side requiredinteger or null 1 -1 null

Your net side: 1 buys the base, -1 sells it. null when the trades offset in full.

net_positions[].notional requiredstring

Net notional in the base currency, as a decimal string with six decimal places. 0.000000 when the trades offset in full.

net_positions[].rate requiredstring or null

Average rate of the trades on the net side, weighted by notional, as a decimal string with six decimal places. null when the trades offset in full.

net_positions[].entry_price requiredstring or null

The average forward rate at which the net position opened, as a decimal string with six decimal places. It is the same value as rate, and null when rate is null.

net_positions[].mark_price requiredstring or null

The current forward rate for the pair at the row's settlement date, as on positions. null when none of the row's trades has a mark_price.

net_positions[].mark_time requiredinteger or null

The time of the price behind mark_price, as Unix time in milliseconds. null when mark_price is null.

net_positions[].unrealized_pnl requiredstring or null

The sum of the unrealized_pnl of the row's trades, in USDC, as a signed decimal string with six decimal places. null when any of the row's trades has a null value.

net_positions[].status requiredstring

open when every trade is open, and closed when the trades offset in full and every trade is open. Otherwise, the status of a trade that is not yet open.

net_positions[].final requiredboolean

true when every trade in the row is final.

net_positions[].awaiting_fixing requiredboolean

true if past its fixing date and waiting for its price.

net_positions[].pair_status requiredstring active paused delisted
net_positions[].delisting_atintegerminimum 0

Delisting time, when one is scheduled.

net_positions[].trades requiredarray of object

The trades the row nets, each with trade_id, rfq_id, side, notional, rate and status as on positions.

net_positions[].trades[].trade_idstring
net_positions[].trades[].rfq_idstring
net_positions[].trades[].sideinteger 1 -1
net_positions[].trades[].notionalstring

Decimal string.

net_positions[].trades[].ratestring

Decimal string.

net_positions[].trades[].statusstring or null

400

bad_request, invalid_signature.

code bad_request invalid_signature

401

unauthorized: a header is missing or malformed, x-crx-ts is out of range, the call was already used, the signature does not match, or the caller lacks access.

code unauthorized

403

not_whitelisted: the account is not approved for this call.

code not_whitelisted

408

timeout: no answer within 30 seconds.

code timeout

429

rate_limited: retry after Retry-After seconds.

code rate_limited

HeaderTypeDescription
Retry-Afterinteger

Seconds until the next call is accepted.

ratelimit-limitinteger

Maximum calls in a burst.

ratelimit-remaininginteger

Calls remaining before the limit.

ratelimit-resetinteger

Seconds until the full limit is restored.

ratelimit-refillinteger

Calls restored per minute.

502

upstream: a chain read failed. Retry shortly.

code upstream