API reference, TWAPs

TWAP history

Ended TWAPs of a market or an account, newest first: what executed, at what price, how they ended.

  • Elysium: not served
  • HyperCore
  • HyperEVM: not served
  • Not on Elysium or HyperEVM: served on HyperCore only

GET https://api.femtos.xyz/v1/hypercore/twaps/history

Parameters

ParamInExample or valuesMeaning
coinqueryBTCMarket (perp name, spot @index, HIP-3 dex:COIN); every market when absent
userquery(optional)Only this account
statusquery(empty), finished, terminated, errorOne way of ending; every one when absent
fromquery(optional)Window start (Unix ms, default `to` − 24 h)
toquery(optional)Window end (Unix ms, exclusive, default now)
limitquery50TWAPs

Example

curl -H "Authorization: Bearer $FEMTOS_KEY" "https://api.femtos.xyz/v1/hypercore/twaps/history?coin=BTC&limit=50"

Key: Authorization: Bearer $FEMTOS_KEY. Get a free key, or with no browser through agent onboarding.

Response fields

FieldTypeMeaning
twaps[]objectNewest end first: {twapId, user, entity, coin, side, status, description, sz, executedSz, executedNtl, avgPx, remainingSz, …}
twaps[].statusactivated | waitingForTrigger | finished | terminated | stopped | errorIts last status: activated (running), waitingForTrigger, or how it ended
twaps[].descriptionstring | nullWhy it stopped, for `error` (Hyperliquid's text, e.g. "Insufficient margin to place order."); null otherwise
twaps[].executedNtldecimalNotional executed so far: Σ px × sz of its slices (quote units, USDC on the main dex)
twaps[].avgPxdecimal | nullexecutedNtl ÷ executedSz (40 significant digits when it does not terminate); null before its first slice
twaps[].endedAtint | nullWhen it ended (Unix ms, the block of its end status); null while it runs
frommsStart of the window read
tomsEnd of the window read (exclusive)
next_cursorstring | nullOpaque cursor of the next page: pass it as `cursor`, unchanged. null on the last page

Next page: cursor = the next_cursor of the previous answer, the same on every list (pagination).

Related: TWAPs

  • Running TWAPs GET /v1/hypercore/twaps HyperCore
    Running TWAPs of a market or an account with their progress, and the net TWAP pressure per market.
  • Running TWAPs stream WS hc.twaps HyperCore
    The GET /v1/hypercore/twaps answer (running TWAPs, their progress, the net TWAP pressure) of a market or an account, pushed on subscribe, then when one of its TWAPs starts, fills a slice or ends (whole, or as a JSON Patch).

More

Agent guide (agents.md)llms.txtOpenAPIMCP serverGet an API keyChangelog