Skip to main content
POST
/
v1
/
admin
/
settle
Trigger settlement
curl --request POST \
  --url https://api.joyride.exchange/v1/admin/settle \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expiration": 1740729600,
  "twap_prices": {
    "SOL": 180.25,
    "BTC": 97500.5,
    "ETH": 3200.75
  },
  "next_expiration": 1740816000
}
'
{
  "settled_instruments": 30,
  "settled_positions": 42,
  "cancelled_orders": 15,
  "created_instruments": 30,
  "settlements": [
    {
      "user_id": "<string>",
      "instrument_id": "<string>",
      "quantity": 123,
      "avg_price": 123,
      "settlement_price": 123,
      "payout": 123,
      "pnl": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

Admin token set via the ADMIN_TOKEN environment variable.

Body

application/json
expiration
integer
required

Expiration to settle (Unix seconds)

Example:

1740729600

twap_prices
object
required

TWAP prices per asset in dollars (e.g., {"SOL": 180.25})

Example:
{
"SOL": 180.25,
"BTC": 97500.5,
"ETH": 3200.75
}
next_expiration
integer

Optional — if set, creates instruments for the next round

Example:

1740816000

Response

Settlement completed

settled_instruments
integer
required
Example:

30

settled_positions
integer
required
Example:

42

cancelled_orders
integer
required
Example:

15

created_instruments
integer
required
Example:

30

settlements
object[]
required