-
Notifications
You must be signed in to change notification settings - Fork 0
Fix: misc #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
petar-omni
wants to merge
10
commits into
main
Choose a base branch
from
fix/misc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix: misc #19
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
92742be
refactor: update shared vite config and deps
petar-omni b10c1a0
feat(dashboard): select market from positions list
petar-omni 88ed312
refactor: simplify tp/sl formatting output
petar-omni c2ba5c9
feat(dashboard): show positions and orders counts
petar-omni fc5f097
fix(dashboard): correct open interest display
petar-omni 73e6a59
feat(dashboard): show funding rate and fees
petar-omni 4e2d732
feat(dashboard): add column sorting to market selector
petar-omni 82e3b0f
feat: hyperliquid mids subscription
petar-omni d152918
fix: export hyperliquid atoms and add missing router plugin dep
petar-omni deb93c6
refactor: match signer selection, add managedRuntime, reset init mark…
petar-omni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { Atom } from "@effect-atom/atom-react"; | ||
| import { Effect, Schema, Stream } from "effect"; | ||
| import { | ||
| CandleIntervalSchema, | ||
| CoinSchema, | ||
| HyperliquidService, | ||
| } from "../services/hyperliquid"; | ||
| import { runtimeAtom } from "../services/runtime"; | ||
|
|
||
| export const CandleSubscriptionParams = Schema.Data( | ||
| Schema.Struct({ | ||
| coin: CoinSchema, | ||
| interval: CandleIntervalSchema, | ||
| }), | ||
| ); | ||
|
|
||
| export const candleStreamAtom = Atom.family( | ||
| (params: typeof CandleSubscriptionParams.Type) => | ||
| runtimeAtom.atom( | ||
| HyperliquidService.pipe( | ||
| Effect.andThen((service) => | ||
| service.subscribeCandle({ | ||
| coin: params.coin, | ||
| interval: params.interval, | ||
| }), | ||
| ), | ||
| Stream.unwrap, | ||
| ), | ||
| ), | ||
| ); |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import { Effect, Stream } from "effect"; | ||
| import { HyperliquidService, runtimeAtom } from "../services"; | ||
|
|
||
| export const midPriceAtom = runtimeAtom.atom( | ||
| HyperliquidService.pipe( | ||
| Effect.andThen((service) => service.subscribeMidPrice), | ||
| Stream.unwrap, | ||
| ), | ||
| ); |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { useEffect, useRef } from "react"; | ||
|
|
||
| export const PriceFlash = ({ | ||
| price, | ||
| children, | ||
| }: { | ||
| price: number; | ||
| children: React.ReactNode; | ||
| }) => { | ||
| const prevPrice = useRef(price); | ||
| const ref = useRef<HTMLElement>(null); | ||
|
|
||
| useEffect(() => { | ||
| const el = ref.current; | ||
|
|
||
| if (!el || price === prevPrice.current) { | ||
| prevPrice.current = price; | ||
| return; | ||
| } | ||
|
|
||
| const cls = | ||
| price > prevPrice.current ? "price-flash-up" : "price-flash-down"; | ||
| prevPrice.current = price; | ||
|
|
||
| el.classList.remove("price-flash-up", "price-flash-down"); | ||
| // Force reflow to restart animation when direction is the same | ||
| void el.offsetWidth; | ||
| el.classList.add(cls); | ||
| }, [price]); | ||
|
|
||
| return <span ref={ref}>{children}</span>; | ||
| }; |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.