Skip to content

Commit

Permalink
feat: add volume notional to candle chart (#239)
Browse files Browse the repository at this point in the history
* feat: add volume to mark price candles

* feat: add volume notional to candle object

* fix: fix duplicate volum column
  • Loading branch information
matthiasmatt authored Oct 6, 2023
1 parent 010cb95 commit d147d43
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/indexer-nibi/src/defaultObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export const defaultMarkPriceCandles: MarkPriceCandle = {
low: 0,
open: 0,
volume: 0,
volumeNotional: 0,
pair: "",
period: 0,
periodStartTs: "",
Expand Down
4 changes: 3 additions & 1 deletion packages/indexer-nibi/src/gql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,11 @@ export type MarkPriceCandle = {
readonly high: Scalars["Float"]["output"]
readonly low: Scalars["Float"]["output"]
readonly open: Scalars["Float"]["output"]
readonly volume: Scalars["Float"]["output"]
readonly pair: Scalars["String"]["output"]
readonly period: Scalars["Int"]["output"]
readonly periodStartTs: Scalars["Time"]["output"]
readonly volume: Scalars["Float"]["output"]
readonly volumeNotional: Scalars["Float"]["output"]
}

export type MarkPriceCandlesFilter = {
Expand Down Expand Up @@ -1175,6 +1176,7 @@ export enum ValidatorOrder {
Moniker = "moniker",
OperatorAddress = "operator_address",
Status = "status",
Tokens = "tokens",
}

export enum ValidatorStatus {
Expand Down
4 changes: 3 additions & 1 deletion packages/indexer-nibi/src/gql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ type MarkPriceCandle {
high: Float!
low: Float!
open: Float!
volume: Float!
pair: String!
period: Int!
periodStartTs: Time!
volume: Float!
volumeNotional: Float!
}

input MarkPriceCandlesFilter {
Expand Down Expand Up @@ -1012,6 +1013,7 @@ enum ValidatorOrder {
moniker
operator_address
status
tokens
}

enum ValidatorStatus {
Expand Down
2 changes: 1 addition & 1 deletion packages/nibijs/docs/classes/StableSwap.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ y()
Calculate x[j] if one makes x[i] = x

Done by solving quadratic equation iteratively.
x*1**2 + x1 * (sum' - (A*n**n - 1) * D / (A _ n**n)) = D ** (n+1)/(n \*\* (2 _ n) \_ prod' \* A)
x*1\*\*2 + x1 * (sum' - (A*n\*\*n - 1) * D / (A _ n**n)) = D ** (n+1)/(n \*\* (2 _ n) \_ prod' \* A)
x_1\*\*2 + b\*x_1 = c

x_1 = (x_1\**2 + c) / (2*x_1 + b)
Expand Down

0 comments on commit d147d43

Please sign in to comment.