feat(perps): expose server time - #273
Open
kartojal wants to merge 2 commits into
Open
Conversation
kartojal
marked this pull request as ready for review
August 14, 2026 10:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DEV-467: Exposes the Perps server clock.
Tests: lint/format, typecheck, build, unit PASS; public live PASS.
Note
Low Risk
Additive experimental read-only API with no auth or trading-path changes; main risk is callers depending on strict epoch-ms parsing behavior.
Overview
Adds
get_server_time()onAsyncPublicClientandAsyncSecureClient, backed by a new Perps public action that callsGET /v1/info/timeand returns an timezone-aware UTCdatetime.The JSON
timefield is parsed through a small response model that accepts epoch milliseconds only (reusing_require_epoch_ms); invalid shapes raiseUnexpectedResponseError.datetimeimports were moved out ofTYPE_CHECKINGso the public return type is runtime-resolvable.Coverage includes mocked unit tests for parsing/endpoint path and a live integration test that the clock is within a few seconds of local UTC.
Reviewed by Cursor Bugbot for commit 00423d9. Bugbot is set up for automated code reviews on this repo. Configure here.