Skip to content

Commit

Permalink
feat: add volume to mark price candles (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt authored Oct 6, 2023
1 parent 8e41998 commit aaee27f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/indexer-nibi/src/defaultObjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ export const defaultMarkPriceCandles: MarkPriceCandle = {
high: 0,
low: 0,
open: 0,
volume: 0,
pair: "",
period: 0,
periodStartTs: "",
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-nibi/src/gql/generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ 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"]
Expand Down
1 change: 1 addition & 0 deletions packages/indexer-nibi/src/gql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ type MarkPriceCandle {
high: Float!
low: Float!
open: Float!
volume: Float!
pair: String!
period: Int!
periodStartTs: Time!
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 aaee27f

Please sign in to comment.