From aaee27f655ad1bb88d4121a691211dd0335f96a5 Mon Sep 17 00:00:00 2001 From: Matthias <97468149+matthiasmatt@users.noreply.github.com> Date: Fri, 6 Oct 2023 18:06:35 +0200 Subject: [PATCH] feat: add volume to mark price candles (#238) --- packages/indexer-nibi/src/defaultObjects.ts | 1 + packages/indexer-nibi/src/gql/generated.ts | 1 + packages/indexer-nibi/src/gql/schema.graphql | 1 + packages/nibijs/docs/classes/StableSwap.md | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/indexer-nibi/src/defaultObjects.ts b/packages/indexer-nibi/src/defaultObjects.ts index dbff153d..97e28efb 100644 --- a/packages/indexer-nibi/src/defaultObjects.ts +++ b/packages/indexer-nibi/src/defaultObjects.ts @@ -174,6 +174,7 @@ export const defaultMarkPriceCandles: MarkPriceCandle = { high: 0, low: 0, open: 0, + volume: 0, pair: "", period: 0, periodStartTs: "", diff --git a/packages/indexer-nibi/src/gql/generated.ts b/packages/indexer-nibi/src/gql/generated.ts index e451baa1..f51ab1a4 100644 --- a/packages/indexer-nibi/src/gql/generated.ts +++ b/packages/indexer-nibi/src/gql/generated.ts @@ -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"] diff --git a/packages/indexer-nibi/src/gql/schema.graphql b/packages/indexer-nibi/src/gql/schema.graphql index 82368c8d..5ed54e34 100644 --- a/packages/indexer-nibi/src/gql/schema.graphql +++ b/packages/indexer-nibi/src/gql/schema.graphql @@ -178,6 +178,7 @@ type MarkPriceCandle { high: Float! low: Float! open: Float! + volume: Float! pair: String! period: Int! periodStartTs: Time! diff --git a/packages/nibijs/docs/classes/StableSwap.md b/packages/nibijs/docs/classes/StableSwap.md index af15c1a4..3c80d21e 100644 --- a/packages/nibijs/docs/classes/StableSwap.md +++ b/packages/nibijs/docs/classes/StableSwap.md @@ -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)