diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..93cf9c97 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# Intuition Chrome Extension - Environment Variables + +# Network Configuration +# Set to "testnet" to use testnet, otherwise defaults to "mainnet" +#PLASMO_PUBLIC_NETWORK=testnet + +# Development +# NODE_ENV=development diff --git a/MIGRATION-MAINNET.md b/MIGRATION-MAINNET.md new file mode 100644 index 00000000..2be0d019 --- /dev/null +++ b/MIGRATION-MAINNET.md @@ -0,0 +1,139 @@ +# Migration Mainnet - Documentation + +## Vue d'ensemble + +Cette branche `migration-mainnet` configure l'application pour fonctionner sur le réseau Mainnet par défaut, avec la possibilité de basculer en Testnet via une variable d'environnement. + +## Configuration réseau + +### Par défaut : Mainnet +L'application est configurée pour utiliser le réseau **Mainnet** en production. + +### Passer en Testnet +Pour utiliser le testnet, définir la variable d'environnement : +```bash +PLASMO_PUBLIC_NETWORK=testnet pnpm dev +``` + +Ou créer un fichier `.env` : +```env +PLASMO_PUBLIC_NETWORK=testnet +``` + +## Fichiers ajoutés + +### 1. `src/lib/atoms.ts` +Centralise tous les IDs d'atoms utilisés dans l'application : +- `I_SUBJECT` - Atom d'identité "I" +- `FOLLOWS_PREDICATE` - Prédicat "follows" +- `IS` - Prédicat "is" +- `SCAM` - Prédicat "scam" +- `TRUSTWORTHY` - Prédicat "trustworthy" +- `HASHTAG_PREDICATE` - Prédicat pour les hashtags/tags + +**Important** : Les IDs mainnet sont actuellement des placeholders et doivent être mis à jour avec les vraies valeurs une fois le protocole déployé sur mainnet. + +### 2. `src/hooks/useAtomIds.ts` +Hook pour obtenir les IDs d'atoms en fonction du réseau configuré. + +### 3. `src/types/images.d.ts` +Déclarations TypeScript pour l'import d'images (jpg, png, svg, etc.) + +### 4. `.env.example` +Template de configuration des variables d'environnement. + +## Fichiers modifiés + +### `src/lib/config.ts` +- Ajout de la définition du réseau `intuitionMainnet` +- Fonction `getSelectedNetwork()` basée sur `process.env.PLASMO_PUBLIC_NETWORK` +- `getChainByNetwork()` - Obtenir la configuration de chaîne +- `getGraphQLEndpoints()` - Obtenir les endpoints GraphQL +- `getMultiVaultAddress()` - Obtenir l'adresse du contrat MultiVault +- Variable `CURRENT_NETWORK` déterminée au démarrage + +### `src/lib/apolo-client.ts` +- Client Apollo configuré statiquement selon `CURRENT_NETWORK` +- Endpoints GraphQL déterminés au build + +### Fichiers utilisant les IDs d'atoms (avec `useAtomIds`) +- `src/pages/Feed.tsx` +- `src/pages/RecentActivity.tsx` +- `src/components/profile/FollowingTab.tsx` +- `src/contents/plasmo-inline.tsx` +- `src/components/SubjectTag.tsx` +- `src/pages/TagsPage.tsx` +- `src/pages/AtomDetailPage.tsx` + +## Configuration réseau + +### Mainnet (par défaut) +- **Chain ID** : 13378 +- **RPC** : https://rpc.intuition.systems +- **GraphQL** : https://mainnet.intuition.sh/v1/graphql +- **Explorer** : https://explorer.intuition.systems +- **MultiVault** : ⚠️ **À CONFIGURER** dans `src/lib/config.ts` + +### Testnet (via variable d'environnement) +- **Chain ID** : 13579 +- **RPC** : https://testnet.rpc.intuition.systems +- **GraphQL** : https://testnet.intuition.sh/v1/graphql +- **Explorer** : https://testnet.explorer.intuition.systems +- **MultiVault** : 0x2Ece8D4dEdcB9918A398528f3fa4688b1d2CAB91 + +## TODO avant production + +1. **⚠️ URGENT : Vérifier que le contrat MultiVault est déployé sur mainnet** + - L'adresse actuelle `0x6E35cF57A41fA15eA0EaE9C33e751b01A784Fe7e` doit être validée + - Vérifier sur https://explorer.intuition.systems + +2. **Mettre à jour les IDs d'atoms mainnet** dans `src/lib/atoms.ts` + - Remplacer les valeurs placeholders par les vrais IDs déployés sur mainnet + +3. **Activer le mainnet par défaut** dans `src/lib/config.ts` + - Ligne 52 : changer `return "testnet"` en `return "mainnet"` + - Actuellement en testnet par sécurité + +4. **Vérifier les endpoints GraphQL mainnet** + - S'assurer que `https://mainnet.intuition.sh/v1/graphql` est accessible + +5. **Tester sur mainnet** + - Vérifier que toutes les queries/mutations fonctionnent + - Tester les dépôts et créations de triples + +## Utilisation + +### Build pour production (Mainnet) +```bash +pnpm build +``` + +### Développement avec Testnet +```bash +PLASMO_PUBLIC_NETWORK=testnet pnpm dev +``` + +### Dans le code +```typescript +// Obtenir les IDs d'atoms en fonction du réseau +const atomIds = useAtomIds() + +// Utiliser dans une query +const { data } = useQuery({ + variables: { + predicate_id: atomIds.FOLLOWS_PREDICATE + } +}) + +// Vérifier le réseau actuel +import { CURRENT_NETWORK } from '~src/lib/config' +console.log('Current network:', CURRENT_NETWORK) // "mainnet" ou "testnet" +``` + +## Sécurité + +⚠️ **Important** : +- L'application est en **mainnet par défaut** et utilise de vrais tokens TRUST +- Toujours vérifier le réseau avant les transactions financières +- Pour les tests, utiliser `PLASMO_PUBLIC_NETWORK=testnet` + diff --git a/package.json b/package.json index 4299a8de..dd635a3d 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,12 @@ { "name": "intuition-chrome-extension", "displayName": "Intuition Chrome Extension", - "version": "0.1.49", + "version": "0.1.50", "description": "", "author": "THP-Lab.org", "scripts": { + "dev": "plasmo dev --hmr-host=0.0.0.0 --hmr-port=1815 --serve-host=0.0.0.0 --serve-port=1012", + "graphql:build": " cd src/graphql && NODE_ENV=production graphql-codegen --config codegen.ts", "prebuild": "pnpm --filter @warzieram/graphql build", "build": "cross-env NODE_ENV=production PARCEL_WORKER_BACKEND=process plasmo build --target=chrome-mv3", "prebuild:firefox": "pnpm --filter @warzieram/graphql build", @@ -81,6 +83,7 @@ "https://analytics.thp.box/*", "https://testnet.rpc.intuition.systems", "https://rpc.intuition.systems", + "https://mainnet.intuition.sh/v1/graphql", "https://testnet.intuition.sh/v1/graphql", "chrome-extension://*/*", "ws://localhost:*/*", diff --git a/packages/graphql/schema.graphql b/packages/graphql/schema.graphql index c40a0cf2..df8d4ca9 100644 --- a/packages/graphql/schema.graphql +++ b/packages/graphql/schema.graphql @@ -18,6 +18,53 @@ directive @cached( ttl: Int! = 60 ) on QUERY +type AccountPnlChartOutput { + account_id: String! + count: Int! + data: [AccountPnlChartPoint!]! + interval: String! +} + +type AccountPnlChartPoint { + equity_value: String! + net_invested: String! + pnl_pct: String! + timestamp: String! + total_assets_in: String! + total_assets_out: String! + total_pnl: String! + unrealized_pnl: String! +} + +type AccountPnlRealizedEntry { + assets_out: String! + cost_basis: String! + curve_id: String! + realized_pnl: String! + realized_pnl_pct: String! + shares_redeemed: String! + term_id: String! + timestamp: String! +} + +type AccountPnlRealizedOutput { + account_id: String! + count: Int! + data: [AccountPnlRealizedEntry!]! +} + +type AccountPnlSnapshotOutput { + account_id: String! + equity_value: String! + net_invested: String! + pnl_pct: String! + timestamp: String! + total_assets_in: String! + total_assets_out: String! + total_pnl: String! + unrealized_pnl: String! +} + """ Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. """ @@ -60,6 +107,23 @@ type ChartSvgOutput { svg: String! } +input GetAccountPnlChartInput { + account_id: String! + end_time: String! + interval: String! + start_time: String! +} + +input GetAccountPnlCurrentInput { + account_id: String! +} + +input GetAccountPnlRealizedInput { + account_id: String! + end_time: String! + start_time: String! +} + input GetChartJsonInput { curve_id: String! end_time: String! @@ -82,6 +146,15 @@ input GetChartSvgInput { width: Int } +input GetPositionPnlChartInput { + account_id: String! + curve_id: String! + end_time: String! + interval: String! + start_time: String! + term_id: String! +} + """ Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. """ @@ -125,6 +198,28 @@ input PinThingInput { url: String } +type PositionPnlChartOutput { + account_id: String! + count: Int! + curve_id: String! + data: [PositionPnlChartPoint!]! + interval: String! + term_id: String! +} + +type PositionPnlChartPoint { + equity_value: String! + net_invested: String! + pnl_pct: String! + share_price: String! + shares_total: String! + timestamp: String! + total_assets_in: String! + total_assets_out: String! + total_pnl: String! + unrealized_pnl: String! +} + """ Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. """ @@ -4335,30 +4430,25 @@ input persons_stream_cursor_value_input { } """ -columns and relationships of "position" +columns and relationships of "position_change_daily" """ -type positions { +type position_change_daily { """ An object relationship """ account: accounts - account_id: String! - block_number: bigint! - created_at: timestamptz! - curve_id: numeric! - id: String! - log_index: bigint! - shares: numeric! + account_id: String + assets_in_period: numeric + assets_out_period: numeric + bucket: timestamptz + curve_id: numeric + shares_delta_period: numeric """ An object relationship """ term: terms - term_id: String! - total_deposit_assets_after_total_fees: numeric! - total_redeem_assets_for_receiver: numeric! - transaction_hash: String! - transaction_index: bigint! - updated_at: timestamptz! + term_id: String + transaction_count: numeric """ An object relationship """ @@ -4366,155 +4456,1204 @@ type positions { } """ -aggregated selection of "position" +Boolean expression to filter rows from the table "position_change_daily". All fields are combined with a logical 'AND'. """ -type positions_aggregate { - aggregate: positions_aggregate_fields - nodes: [positions!]! -} - -input positions_aggregate_bool_exp { - count: positions_aggregate_bool_exp_count +input position_change_daily_bool_exp { + _and: [position_change_daily_bool_exp!] + _not: position_change_daily_bool_exp + _or: [position_change_daily_bool_exp!] + account: accounts_bool_exp + account_id: String_comparison_exp + assets_in_period: numeric_comparison_exp + assets_out_period: numeric_comparison_exp + bucket: timestamptz_comparison_exp + curve_id: numeric_comparison_exp + shares_delta_period: numeric_comparison_exp + term: terms_bool_exp + term_id: String_comparison_exp + transaction_count: numeric_comparison_exp + vault: vaults_bool_exp } -input positions_aggregate_bool_exp_count { - arguments: [positions_select_column!] - distinct: Boolean - filter: positions_bool_exp - predicate: Int_comparison_exp! +""" +Ordering options when selecting data from "position_change_daily". +""" +input position_change_daily_order_by { + account: accounts_order_by + account_id: order_by + assets_in_period: order_by + assets_out_period: order_by + bucket: order_by + curve_id: order_by + shares_delta_period: order_by + term: terms_order_by + term_id: order_by + transaction_count: order_by + vault: vaults_order_by } """ -aggregate fields of "position" +select columns of table "position_change_daily" """ -type positions_aggregate_fields { - avg: positions_avg_fields - count(columns: [positions_select_column!], distinct: Boolean): Int! - max: positions_max_fields - min: positions_min_fields - stddev: positions_stddev_fields - stddev_pop: positions_stddev_pop_fields - stddev_samp: positions_stddev_samp_fields - sum: positions_sum_fields - var_pop: positions_var_pop_fields - var_samp: positions_var_samp_fields - variance: positions_variance_fields +enum position_change_daily_select_column { + """ + column name + """ + account_id + """ + column name + """ + assets_in_period + """ + column name + """ + assets_out_period + """ + column name + """ + bucket + """ + column name + """ + curve_id + """ + column name + """ + shares_delta_period + """ + column name + """ + term_id + """ + column name + """ + transaction_count } """ -order by aggregate values of table "position" +Streaming cursor of the table "position_change_daily" """ -input positions_aggregate_order_by { - avg: positions_avg_order_by - count: order_by - max: positions_max_order_by - min: positions_min_order_by - stddev: positions_stddev_order_by - stddev_pop: positions_stddev_pop_order_by - stddev_samp: positions_stddev_samp_order_by - sum: positions_sum_order_by - var_pop: positions_var_pop_order_by - var_samp: positions_var_samp_order_by - variance: positions_variance_order_by +input position_change_daily_stream_cursor_input { + """ + Stream column input with initial value + """ + initial_value: position_change_daily_stream_cursor_value_input! + """ + cursor ordering + """ + ordering: cursor_ordering } """ -aggregate avg on columns +Initial value of the column from where the streaming should start """ -type positions_avg_fields { - block_number: Float - curve_id: Float - log_index: Float - shares: Float - total_deposit_assets_after_total_fees: Float - total_redeem_assets_for_receiver: Float - transaction_index: Float +input position_change_daily_stream_cursor_value_input { + account_id: String + assets_in_period: numeric + assets_out_period: numeric + bucket: timestamptz + curve_id: numeric + shares_delta_period: numeric + term_id: String + transaction_count: numeric } """ -order by avg() on columns of table "position" +columns and relationships of "position_change_hourly" """ -input positions_avg_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by +type position_change_hourly { + """ + An object relationship + """ + account: accounts + account_id: String + assets_in_period: numeric + assets_out_period: numeric + bucket: timestamptz + curve_id: numeric + shares_delta_period: numeric + """ + An object relationship + """ + term: terms + term_id: String + transaction_count: bigint + """ + An object relationship + """ + vault: vaults } """ -Boolean expression to filter rows from the table "position". All fields are combined with a logical 'AND'. +Boolean expression to filter rows from the table "position_change_hourly". All fields are combined with a logical 'AND'. """ -input positions_bool_exp { - _and: [positions_bool_exp!] - _not: positions_bool_exp - _or: [positions_bool_exp!] +input position_change_hourly_bool_exp { + _and: [position_change_hourly_bool_exp!] + _not: position_change_hourly_bool_exp + _or: [position_change_hourly_bool_exp!] account: accounts_bool_exp account_id: String_comparison_exp - block_number: bigint_comparison_exp - created_at: timestamptz_comparison_exp + assets_in_period: numeric_comparison_exp + assets_out_period: numeric_comparison_exp + bucket: timestamptz_comparison_exp curve_id: numeric_comparison_exp - id: String_comparison_exp - log_index: bigint_comparison_exp - shares: numeric_comparison_exp + shares_delta_period: numeric_comparison_exp term: terms_bool_exp term_id: String_comparison_exp - total_deposit_assets_after_total_fees: numeric_comparison_exp - total_redeem_assets_for_receiver: numeric_comparison_exp - transaction_hash: String_comparison_exp - transaction_index: bigint_comparison_exp - updated_at: timestamptz_comparison_exp + transaction_count: bigint_comparison_exp vault: vaults_bool_exp } -input positions_from_following_args { - address: String -} - -""" -aggregate max on columns -""" -type positions_max_fields { - account_id: String - block_number: bigint - created_at: timestamptz - curve_id: numeric - id: String - log_index: bigint - shares: numeric - term_id: String - total_deposit_assets_after_total_fees: numeric - total_redeem_assets_for_receiver: numeric - transaction_hash: String - transaction_index: bigint - updated_at: timestamptz -} - """ -order by max() on columns of table "position" +Ordering options when selecting data from "position_change_hourly". """ -input positions_max_order_by { +input position_change_hourly_order_by { + account: accounts_order_by account_id: order_by - block_number: order_by - created_at: order_by + assets_in_period: order_by + assets_out_period: order_by + bucket: order_by curve_id: order_by - id: order_by - log_index: order_by - shares: order_by + shares_delta_period: order_by + term: terms_order_by term_id: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_hash: order_by - transaction_index: order_by - updated_at: order_by + transaction_count: order_by + vault: vaults_order_by +} + +""" +select columns of table "position_change_hourly" +""" +enum position_change_hourly_select_column { + """ + column name + """ + account_id + """ + column name + """ + assets_in_period + """ + column name + """ + assets_out_period + """ + column name + """ + bucket + """ + column name + """ + curve_id + """ + column name + """ + shares_delta_period + """ + column name + """ + term_id + """ + column name + """ + transaction_count +} + +""" +Streaming cursor of the table "position_change_hourly" +""" +input position_change_hourly_stream_cursor_input { + """ + Stream column input with initial value + """ + initial_value: position_change_hourly_stream_cursor_value_input! + """ + cursor ordering + """ + ordering: cursor_ordering +} + +""" +Initial value of the column from where the streaming should start +""" +input position_change_hourly_stream_cursor_value_input { + account_id: String + assets_in_period: numeric + assets_out_period: numeric + bucket: timestamptz + curve_id: numeric + shares_delta_period: numeric + term_id: String + transaction_count: bigint +} + +""" +columns and relationships of "position_change" +""" +type position_changes { + """ + An object relationship + """ + account: accounts + account_id: String! + assets_in: numeric! + assets_out: numeric! + block_number: numeric! + created_at: timestamptz! + curve_id: numeric! + event_id: String! + event_type: String! + id: bigint! + log_index: bigint! + shares_delta: numeric! + """ + An object relationship + """ + term: terms + term_id: String! + transaction_hash: String! + """ + An object relationship + """ + vault: vaults +} + +""" +aggregated selection of "position_change" +""" +type position_changes_aggregate { + aggregate: position_changes_aggregate_fields + nodes: [position_changes!]! +} + +""" +aggregate fields of "position_change" +""" +type position_changes_aggregate_fields { + avg: position_changes_avg_fields + count(columns: [position_changes_select_column!], distinct: Boolean): Int! + max: position_changes_max_fields + min: position_changes_min_fields + stddev: position_changes_stddev_fields + stddev_pop: position_changes_stddev_pop_fields + stddev_samp: position_changes_stddev_samp_fields + sum: position_changes_sum_fields + var_pop: position_changes_var_pop_fields + var_samp: position_changes_var_samp_fields + variance: position_changes_variance_fields +} + +""" +aggregate avg on columns +""" +type position_changes_avg_fields { + assets_in: Float + assets_out: Float + block_number: Float + curve_id: Float + id: Float + log_index: Float + shares_delta: Float +} + +""" +Boolean expression to filter rows from the table "position_change". All fields are combined with a logical 'AND'. +""" +input position_changes_bool_exp { + _and: [position_changes_bool_exp!] + _not: position_changes_bool_exp + _or: [position_changes_bool_exp!] + account: accounts_bool_exp + account_id: String_comparison_exp + assets_in: numeric_comparison_exp + assets_out: numeric_comparison_exp + block_number: numeric_comparison_exp + created_at: timestamptz_comparison_exp + curve_id: numeric_comparison_exp + event_id: String_comparison_exp + event_type: String_comparison_exp + id: bigint_comparison_exp + log_index: bigint_comparison_exp + shares_delta: numeric_comparison_exp + term: terms_bool_exp + term_id: String_comparison_exp + transaction_hash: String_comparison_exp + vault: vaults_bool_exp +} + +""" +aggregate max on columns +""" +type position_changes_max_fields { + account_id: String + assets_in: numeric + assets_out: numeric + block_number: numeric + created_at: timestamptz + curve_id: numeric + event_id: String + event_type: String + id: bigint + log_index: bigint + shares_delta: numeric + term_id: String + transaction_hash: String +} + +""" +aggregate min on columns +""" +type position_changes_min_fields { + account_id: String + assets_in: numeric + assets_out: numeric + block_number: numeric + created_at: timestamptz + curve_id: numeric + event_id: String + event_type: String + id: bigint + log_index: bigint + shares_delta: numeric + term_id: String + transaction_hash: String +} + +""" +Ordering options when selecting data from "position_change". +""" +input position_changes_order_by { + account: accounts_order_by + account_id: order_by + assets_in: order_by + assets_out: order_by + block_number: order_by + created_at: order_by + curve_id: order_by + event_id: order_by + event_type: order_by + id: order_by + log_index: order_by + shares_delta: order_by + term: terms_order_by + term_id: order_by + transaction_hash: order_by + vault: vaults_order_by +} + +""" +select columns of table "position_change" +""" +enum position_changes_select_column { + """ + column name + """ + account_id + """ + column name + """ + assets_in + """ + column name + """ + assets_out + """ + column name + """ + block_number + """ + column name + """ + created_at + """ + column name + """ + curve_id + """ + column name + """ + event_id + """ + column name + """ + event_type + """ + column name + """ + id + """ + column name + """ + log_index + """ + column name + """ + shares_delta + """ + column name + """ + term_id + """ + column name + """ + transaction_hash +} + +""" +aggregate stddev on columns +""" +type position_changes_stddev_fields { + assets_in: Float + assets_out: Float + block_number: Float + curve_id: Float + id: Float + log_index: Float + shares_delta: Float +} + +""" +aggregate stddev_pop on columns +""" +type position_changes_stddev_pop_fields { + assets_in: Float + assets_out: Float + block_number: Float + curve_id: Float + id: Float + log_index: Float + shares_delta: Float +} + +""" +aggregate stddev_samp on columns +""" +type position_changes_stddev_samp_fields { + assets_in: Float + assets_out: Float + block_number: Float + curve_id: Float + id: Float + log_index: Float + shares_delta: Float +} + +""" +Streaming cursor of the table "position_changes" +""" +input position_changes_stream_cursor_input { + """ + Stream column input with initial value + """ + initial_value: position_changes_stream_cursor_value_input! + """ + cursor ordering + """ + ordering: cursor_ordering +} + +""" +Initial value of the column from where the streaming should start +""" +input position_changes_stream_cursor_value_input { + account_id: String + assets_in: numeric + assets_out: numeric + block_number: numeric + created_at: timestamptz + curve_id: numeric + event_id: String + event_type: String + id: bigint + log_index: bigint + shares_delta: numeric + term_id: String + transaction_hash: String +} + +""" +aggregate sum on columns +""" +type position_changes_sum_fields { + assets_in: numeric + assets_out: numeric + block_number: numeric + curve_id: numeric + id: bigint + log_index: bigint + shares_delta: numeric +} + +""" +aggregate var_pop on columns +""" +type position_changes_var_pop_fields { + assets_in: Float + assets_out: Float + block_number: Float + curve_id: Float + id: Float + log_index: Float + shares_delta: Float +} + +""" +aggregate var_samp on columns +""" +type position_changes_var_samp_fields { + assets_in: Float + assets_out: Float + block_number: Float + curve_id: Float + id: Float + log_index: Float + shares_delta: Float +} + +""" +aggregate variance on columns +""" +type position_changes_variance_fields { + assets_in: Float + assets_out: Float + block_number: Float + curve_id: Float + id: Float + log_index: Float + shares_delta: Float +} + +""" +columns and relationships of "position" +""" +type positions { + """ + An object relationship + """ + account: accounts + account_id: String! + block_number: bigint! + created_at: timestamptz! + curve_id: numeric! + id: String! + log_index: bigint! + shares: numeric! + """ + An object relationship + """ + term: terms + term_id: String! + total_deposit_assets_after_total_fees: numeric! + total_redeem_assets_for_receiver: numeric! + transaction_hash: String! + transaction_index: bigint! + updated_at: timestamptz! + """ + An object relationship + """ + vault: vaults +} + +""" +aggregated selection of "position" +""" +type positions_aggregate { + aggregate: positions_aggregate_fields + nodes: [positions!]! +} + +input positions_aggregate_bool_exp { + count: positions_aggregate_bool_exp_count +} + +input positions_aggregate_bool_exp_count { + arguments: [positions_select_column!] + distinct: Boolean + filter: positions_bool_exp + predicate: Int_comparison_exp! +} + +""" +aggregate fields of "position" +""" +type positions_aggregate_fields { + avg: positions_avg_fields + count(columns: [positions_select_column!], distinct: Boolean): Int! + max: positions_max_fields + min: positions_min_fields + stddev: positions_stddev_fields + stddev_pop: positions_stddev_pop_fields + stddev_samp: positions_stddev_samp_fields + sum: positions_sum_fields + var_pop: positions_var_pop_fields + var_samp: positions_var_samp_fields + variance: positions_variance_fields +} + +""" +order by aggregate values of table "position" +""" +input positions_aggregate_order_by { + avg: positions_avg_order_by + count: order_by + max: positions_max_order_by + min: positions_min_order_by + stddev: positions_stddev_order_by + stddev_pop: positions_stddev_pop_order_by + stddev_samp: positions_stddev_samp_order_by + sum: positions_sum_order_by + var_pop: positions_var_pop_order_by + var_samp: positions_var_samp_order_by + variance: positions_variance_order_by +} + +""" +aggregate avg on columns +""" +type positions_avg_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +order by avg() on columns of table "position" +""" +input positions_avg_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +Boolean expression to filter rows from the table "position". All fields are combined with a logical 'AND'. +""" +input positions_bool_exp { + _and: [positions_bool_exp!] + _not: positions_bool_exp + _or: [positions_bool_exp!] + account: accounts_bool_exp + account_id: String_comparison_exp + block_number: bigint_comparison_exp + created_at: timestamptz_comparison_exp + curve_id: numeric_comparison_exp + id: String_comparison_exp + log_index: bigint_comparison_exp + shares: numeric_comparison_exp + term: terms_bool_exp + term_id: String_comparison_exp + total_deposit_assets_after_total_fees: numeric_comparison_exp + total_redeem_assets_for_receiver: numeric_comparison_exp + transaction_hash: String_comparison_exp + transaction_index: bigint_comparison_exp + updated_at: timestamptz_comparison_exp + vault: vaults_bool_exp +} + +input positions_from_following_args { + address: String +} + +""" +aggregate max on columns +""" +type positions_max_fields { + account_id: String + block_number: bigint + created_at: timestamptz + curve_id: numeric + id: String + log_index: bigint + shares: numeric + term_id: String + total_deposit_assets_after_total_fees: numeric + total_redeem_assets_for_receiver: numeric + transaction_hash: String + transaction_index: bigint + updated_at: timestamptz +} + +""" +order by max() on columns of table "position" +""" +input positions_max_order_by { + account_id: order_by + block_number: order_by + created_at: order_by + curve_id: order_by + id: order_by + log_index: order_by + shares: order_by + term_id: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_hash: order_by + transaction_index: order_by + updated_at: order_by +} + +""" +aggregate min on columns +""" +type positions_min_fields { + account_id: String + block_number: bigint + created_at: timestamptz + curve_id: numeric + id: String + log_index: bigint + shares: numeric + term_id: String + total_deposit_assets_after_total_fees: numeric + total_redeem_assets_for_receiver: numeric + transaction_hash: String + transaction_index: bigint + updated_at: timestamptz +} + +""" +order by min() on columns of table "position" +""" +input positions_min_order_by { + account_id: order_by + block_number: order_by + created_at: order_by + curve_id: order_by + id: order_by + log_index: order_by + shares: order_by + term_id: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_hash: order_by + transaction_index: order_by + updated_at: order_by +} + +""" +Ordering options when selecting data from "position". +""" +input positions_order_by { + account: accounts_order_by + account_id: order_by + block_number: order_by + created_at: order_by + curve_id: order_by + id: order_by + log_index: order_by + shares: order_by + term: terms_order_by + term_id: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_hash: order_by + transaction_index: order_by + updated_at: order_by + vault: vaults_order_by +} + +""" +select columns of table "position" +""" +enum positions_select_column { + """ + column name + """ + account_id + """ + column name + """ + block_number + """ + column name + """ + created_at + """ + column name + """ + curve_id + """ + column name + """ + id + """ + column name + """ + log_index + """ + column name + """ + shares + """ + column name + """ + term_id + """ + column name + """ + total_deposit_assets_after_total_fees + """ + column name + """ + total_redeem_assets_for_receiver + """ + column name + """ + transaction_hash + """ + column name + """ + transaction_index + """ + column name + """ + updated_at +} + +""" +aggregate stddev on columns +""" +type positions_stddev_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +order by stddev() on columns of table "position" +""" +input positions_stddev_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +aggregate stddev_pop on columns +""" +type positions_stddev_pop_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +order by stddev_pop() on columns of table "position" +""" +input positions_stddev_pop_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +aggregate stddev_samp on columns +""" +type positions_stddev_samp_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +order by stddev_samp() on columns of table "position" +""" +input positions_stddev_samp_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +Streaming cursor of the table "positions" +""" +input positions_stream_cursor_input { + """ + Stream column input with initial value + """ + initial_value: positions_stream_cursor_value_input! + """ + cursor ordering + """ + ordering: cursor_ordering +} + +""" +Initial value of the column from where the streaming should start +""" +input positions_stream_cursor_value_input { + account_id: String + block_number: bigint + created_at: timestamptz + curve_id: numeric + id: String + log_index: bigint + shares: numeric + term_id: String + total_deposit_assets_after_total_fees: numeric + total_redeem_assets_for_receiver: numeric + transaction_hash: String + transaction_index: bigint + updated_at: timestamptz +} + +""" +aggregate sum on columns +""" +type positions_sum_fields { + block_number: bigint + curve_id: numeric + log_index: bigint + shares: numeric + total_deposit_assets_after_total_fees: numeric + total_redeem_assets_for_receiver: numeric + transaction_index: bigint +} + +""" +order by sum() on columns of table "position" +""" +input positions_sum_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +aggregate var_pop on columns +""" +type positions_var_pop_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +order by var_pop() on columns of table "position" +""" +input positions_var_pop_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +aggregate var_samp on columns +""" +type positions_var_samp_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +order by var_samp() on columns of table "position" +""" +input positions_var_samp_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +aggregate variance on columns +""" +type positions_variance_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +order by variance() on columns of table "position" +""" +input positions_variance_order_by { + block_number: order_by + curve_id: order_by + log_index: order_by + shares: order_by + total_deposit_assets_after_total_fees: order_by + total_redeem_assets_for_receiver: order_by + transaction_index: order_by +} + +""" +columns and relationships of "position_with_value" +""" +type positions_with_value { + """ + An object relationship + """ + account: accounts + account_id: String + block_number: bigint + created_at: timestamptz + curve_id: numeric + id: String + log_index: bigint + shares: numeric + """ + An object relationship + """ + term: terms + term_id: String + theoretical_value: numeric + total_deposit_assets_after_total_fees: numeric + total_redeem_assets_for_receiver: numeric + transaction_hash: String + transaction_index: bigint + updated_at: timestamptz + """ + An object relationship + """ + vault: vaults +} + +""" +aggregated selection of "position_with_value" +""" +type positions_with_value_aggregate { + aggregate: positions_with_value_aggregate_fields + nodes: [positions_with_value!]! +} + +""" +aggregate fields of "position_with_value" +""" +type positions_with_value_aggregate_fields { + avg: positions_with_value_avg_fields + count(columns: [positions_with_value_select_column!], distinct: Boolean): Int! + max: positions_with_value_max_fields + min: positions_with_value_min_fields + stddev: positions_with_value_stddev_fields + stddev_pop: positions_with_value_stddev_pop_fields + stddev_samp: positions_with_value_stddev_samp_fields + sum: positions_with_value_sum_fields + var_pop: positions_with_value_var_pop_fields + var_samp: positions_with_value_var_samp_fields + variance: positions_with_value_variance_fields +} + +""" +aggregate avg on columns +""" +type positions_with_value_avg_fields { + block_number: Float + curve_id: Float + log_index: Float + shares: Float + theoretical_value: Float + total_deposit_assets_after_total_fees: Float + total_redeem_assets_for_receiver: Float + transaction_index: Float +} + +""" +Boolean expression to filter rows from the table "position_with_value". All fields are combined with a logical 'AND'. +""" +input positions_with_value_bool_exp { + _and: [positions_with_value_bool_exp!] + _not: positions_with_value_bool_exp + _or: [positions_with_value_bool_exp!] + account: accounts_bool_exp + account_id: String_comparison_exp + block_number: bigint_comparison_exp + created_at: timestamptz_comparison_exp + curve_id: numeric_comparison_exp + id: String_comparison_exp + log_index: bigint_comparison_exp + shares: numeric_comparison_exp + term: terms_bool_exp + term_id: String_comparison_exp + theoretical_value: numeric_comparison_exp + total_deposit_assets_after_total_fees: numeric_comparison_exp + total_redeem_assets_for_receiver: numeric_comparison_exp + transaction_hash: String_comparison_exp + transaction_index: bigint_comparison_exp + updated_at: timestamptz_comparison_exp + vault: vaults_bool_exp +} + +""" +aggregate max on columns +""" +type positions_with_value_max_fields { + account_id: String + block_number: bigint + created_at: timestamptz + curve_id: numeric + id: String + log_index: bigint + shares: numeric + term_id: String + theoretical_value: numeric + total_deposit_assets_after_total_fees: numeric + total_redeem_assets_for_receiver: numeric + transaction_hash: String + transaction_index: bigint + updated_at: timestamptz } """ aggregate min on columns """ -type positions_min_fields { +type positions_with_value_min_fields { account_id: String block_number: bigint created_at: timestamptz @@ -4523,6 +5662,7 @@ type positions_min_fields { log_index: bigint shares: numeric term_id: String + theoretical_value: numeric total_deposit_assets_after_total_fees: numeric total_redeem_assets_for_receiver: numeric transaction_hash: String @@ -4531,28 +5671,9 @@ type positions_min_fields { } """ -order by min() on columns of table "position" -""" -input positions_min_order_by { - account_id: order_by - block_number: order_by - created_at: order_by - curve_id: order_by - id: order_by - log_index: order_by - shares: order_by - term_id: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_hash: order_by - transaction_index: order_by - updated_at: order_by -} - -""" -Ordering options when selecting data from "position". +Ordering options when selecting data from "position_with_value". """ -input positions_order_by { +input positions_with_value_order_by { account: accounts_order_by account_id: order_by block_number: order_by @@ -4563,6 +5684,7 @@ input positions_order_by { shares: order_by term: terms_order_by term_id: order_by + theoretical_value: order_by total_deposit_assets_after_total_fees: order_by total_redeem_assets_for_receiver: order_by transaction_hash: order_by @@ -4572,9 +5694,9 @@ input positions_order_by { } """ -select columns of table "position" +select columns of table "position_with_value" """ -enum positions_select_column { +enum positions_with_value_select_column { """ column name """ @@ -4610,6 +5732,10 @@ enum positions_select_column { """ column name """ + theoretical_value + """ + column name + """ total_deposit_assets_after_total_fees """ column name @@ -4632,89 +5758,53 @@ enum positions_select_column { """ aggregate stddev on columns """ -type positions_stddev_fields { +type positions_with_value_stddev_fields { block_number: Float curve_id: Float log_index: Float shares: Float + theoretical_value: Float total_deposit_assets_after_total_fees: Float total_redeem_assets_for_receiver: Float transaction_index: Float } -""" -order by stddev() on columns of table "position" -""" -input positions_stddev_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by -} - """ aggregate stddev_pop on columns """ -type positions_stddev_pop_fields { +type positions_with_value_stddev_pop_fields { block_number: Float curve_id: Float log_index: Float shares: Float + theoretical_value: Float total_deposit_assets_after_total_fees: Float total_redeem_assets_for_receiver: Float transaction_index: Float } -""" -order by stddev_pop() on columns of table "position" -""" -input positions_stddev_pop_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by -} - """ aggregate stddev_samp on columns """ -type positions_stddev_samp_fields { +type positions_with_value_stddev_samp_fields { block_number: Float curve_id: Float log_index: Float shares: Float + theoretical_value: Float total_deposit_assets_after_total_fees: Float total_redeem_assets_for_receiver: Float transaction_index: Float } """ -order by stddev_samp() on columns of table "position" -""" -input positions_stddev_samp_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by -} - -""" -Streaming cursor of the table "positions" +Streaming cursor of the table "positions_with_value" """ -input positions_stream_cursor_input { +input positions_with_value_stream_cursor_input { """ Stream column input with initial value """ - initial_value: positions_stream_cursor_value_input! + initial_value: positions_with_value_stream_cursor_value_input! """ cursor ordering """ @@ -4724,7 +5814,7 @@ input positions_stream_cursor_input { """ Initial value of the column from where the streaming should start """ -input positions_stream_cursor_value_input { +input positions_with_value_stream_cursor_value_input { account_id: String block_number: bigint created_at: timestamptz @@ -4733,6 +5823,7 @@ input positions_stream_cursor_value_input { log_index: bigint shares: numeric term_id: String + theoretical_value: numeric total_deposit_assets_after_total_fees: numeric total_redeem_assets_for_receiver: numeric transaction_hash: String @@ -4743,107 +5834,59 @@ input positions_stream_cursor_value_input { """ aggregate sum on columns """ -type positions_sum_fields { +type positions_with_value_sum_fields { block_number: bigint curve_id: numeric log_index: bigint shares: numeric + theoretical_value: numeric total_deposit_assets_after_total_fees: numeric total_redeem_assets_for_receiver: numeric transaction_index: bigint } -""" -order by sum() on columns of table "position" -""" -input positions_sum_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by -} - """ aggregate var_pop on columns """ -type positions_var_pop_fields { +type positions_with_value_var_pop_fields { block_number: Float curve_id: Float log_index: Float shares: Float + theoretical_value: Float total_deposit_assets_after_total_fees: Float total_redeem_assets_for_receiver: Float transaction_index: Float } -""" -order by var_pop() on columns of table "position" -""" -input positions_var_pop_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by -} - """ aggregate var_samp on columns """ -type positions_var_samp_fields { +type positions_with_value_var_samp_fields { block_number: Float curve_id: Float log_index: Float shares: Float + theoretical_value: Float total_deposit_assets_after_total_fees: Float total_redeem_assets_for_receiver: Float transaction_index: Float } -""" -order by var_samp() on columns of table "position" -""" -input positions_var_samp_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by -} - """ aggregate variance on columns """ -type positions_variance_fields { +type positions_with_value_variance_fields { block_number: Float curve_id: Float log_index: Float shares: Float + theoretical_value: Float total_deposit_assets_after_total_fees: Float total_redeem_assets_for_receiver: Float transaction_index: Float } -""" -order by variance() on columns of table "position" -""" -input positions_variance_order_by { - block_number: order_by - curve_id: order_by - log_index: order_by - shares: order_by - total_deposit_assets_after_total_fees: order_by - total_redeem_assets_for_receiver: order_by - transaction_index: order_by -} - """ columns and relationships of "predicate_object" """ @@ -5841,14 +6884,42 @@ type query_root { where: accounts_bool_exp ): accounts_aggregate! """ + Fetches account-level PnL chart data + """ + getAccountPnlChart(input: GetAccountPnlChartInput!): AccountPnlChartOutput + """ + Fetches current account PnL snapshot + """ + getAccountPnlCurrent( + input: GetAccountPnlCurrentInput! + ): AccountPnlSnapshotOutput + """ + Fetches realized PnL breakdown for an account + """ + getAccountPnlRealized( + input: GetAccountPnlRealizedInput! + ): AccountPnlRealizedOutput + """ Fetches chart data (JSON) for a term/curve combination """ getChartJson(input: GetChartJsonInput!): ChartDataOutput """ + Fetches raw share price chart data (JSON) from share_price_change + """ + getChartRawJson(input: GetChartJsonInput!): ChartDataOutput + """ + Fetches raw share price chart SVG from share_price_change + """ + getChartRawSvg(input: GetChartSvgInput!): ChartSvgOutput + """ Fetches chart SVG for a term/curve combination """ getChartSvg(input: GetChartSvgInput!): ChartSvgOutput """ + Fetches position PnL chart data + """ + getPositionPnlChart(input: GetPositionPnlChartInput!): PositionPnlChartOutput + """ fetch data from the table: "json_object" using primary key columns """ json_object(id: String!): json_objects @@ -5859,7 +6930,115 @@ type query_root { """ distinct select on columns """ - distinct_on: [json_objects_select_column!] + distinct_on: [json_objects_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [json_objects_order_by!] + """ + filter the rows returned + """ + where: json_objects_bool_exp + ): [json_objects!]! + """ + fetch aggregated fields from the table: "json_object" + """ + json_objects_aggregate( + """ + distinct select on columns + """ + distinct_on: [json_objects_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [json_objects_order_by!] + """ + filter the rows returned + """ + where: json_objects_bool_exp + ): json_objects_aggregate! + """ + fetch data from the table: "organization" using primary key columns + """ + organization(id: String!): organizations + """ + fetch data from the table: "organization" + """ + organizations( + """ + distinct select on columns + """ + distinct_on: [organizations_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [organizations_order_by!] + """ + filter the rows returned + """ + where: organizations_bool_exp + ): [organizations!]! + """ + fetch aggregated fields from the table: "organization" + """ + organizations_aggregate( + """ + distinct select on columns + """ + distinct_on: [organizations_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [organizations_order_by!] + """ + filter the rows returned + """ + where: organizations_bool_exp + ): organizations_aggregate! + """ + fetch data from the table: "person" using primary key columns + """ + person(id: String!): persons + """ + fetch data from the table: "person" + """ + persons( + """ + distinct select on columns + """ + distinct_on: [persons_select_column!] """ limit the number of rows returned """ @@ -5871,20 +7050,20 @@ type query_root { """ sort the rows by one or more columns """ - order_by: [json_objects_order_by!] + order_by: [persons_order_by!] """ filter the rows returned """ - where: json_objects_bool_exp - ): [json_objects!]! + where: persons_bool_exp + ): [persons!]! """ - fetch aggregated fields from the table: "json_object" + fetch aggregated fields from the table: "person" """ - json_objects_aggregate( + persons_aggregate( """ distinct select on columns """ - distinct_on: [json_objects_select_column!] + distinct_on: [persons_select_column!] """ limit the number of rows returned """ @@ -5896,24 +7075,24 @@ type query_root { """ sort the rows by one or more columns """ - order_by: [json_objects_order_by!] + order_by: [persons_order_by!] """ filter the rows returned """ - where: json_objects_bool_exp - ): json_objects_aggregate! + where: persons_bool_exp + ): persons_aggregate! """ - fetch data from the table: "organization" using primary key columns + fetch data from the table: "position" using primary key columns """ - organization(id: String!): organizations + position(id: String!): positions """ - fetch data from the table: "organization" + fetch data from the table: "position_change_daily" """ - organizations( + position_change_daily( """ distinct select on columns """ - distinct_on: [organizations_select_column!] + distinct_on: [position_change_daily_select_column!] """ limit the number of rows returned """ @@ -5925,20 +7104,20 @@ type query_root { """ sort the rows by one or more columns """ - order_by: [organizations_order_by!] + order_by: [position_change_daily_order_by!] """ filter the rows returned """ - where: organizations_bool_exp - ): [organizations!]! + where: position_change_daily_bool_exp + ): [position_change_daily!]! """ - fetch aggregated fields from the table: "organization" + fetch data from the table: "position_change_hourly" """ - organizations_aggregate( + position_change_hourly( """ distinct select on columns """ - distinct_on: [organizations_select_column!] + distinct_on: [position_change_hourly_select_column!] """ limit the number of rows returned """ @@ -5950,24 +7129,20 @@ type query_root { """ sort the rows by one or more columns """ - order_by: [organizations_order_by!] + order_by: [position_change_hourly_order_by!] """ filter the rows returned """ - where: organizations_bool_exp - ): organizations_aggregate! - """ - fetch data from the table: "person" using primary key columns - """ - person(id: String!): persons + where: position_change_hourly_bool_exp + ): [position_change_hourly!]! """ - fetch data from the table: "person" + fetch data from the table: "position_change" """ - persons( + position_changes( """ distinct select on columns """ - distinct_on: [persons_select_column!] + distinct_on: [position_changes_select_column!] """ limit the number of rows returned """ @@ -5979,20 +7154,20 @@ type query_root { """ sort the rows by one or more columns """ - order_by: [persons_order_by!] + order_by: [position_changes_order_by!] """ filter the rows returned """ - where: persons_bool_exp - ): [persons!]! + where: position_changes_bool_exp + ): [position_changes!]! """ - fetch aggregated fields from the table: "person" + fetch aggregated fields from the table: "position_change" """ - persons_aggregate( + position_changes_aggregate( """ distinct select on columns """ - distinct_on: [persons_select_column!] + distinct_on: [position_changes_select_column!] """ limit the number of rows returned """ @@ -6004,16 +7179,12 @@ type query_root { """ sort the rows by one or more columns """ - order_by: [persons_order_by!] + order_by: [position_changes_order_by!] """ filter the rows returned """ - where: persons_bool_exp - ): persons_aggregate! - """ - fetch data from the table: "position" using primary key columns - """ - position(id: String!): positions + where: position_changes_bool_exp + ): position_changes_aggregate! """ An array relationship """ @@ -6123,6 +7294,56 @@ type query_root { where: positions_bool_exp ): positions_aggregate! """ + fetch data from the table: "position_with_value" + """ + positions_with_value( + """ + distinct select on columns + """ + distinct_on: [positions_with_value_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [positions_with_value_order_by!] + """ + filter the rows returned + """ + where: positions_with_value_bool_exp + ): [positions_with_value!]! + """ + fetch aggregated fields from the table: "position_with_value" + """ + positions_with_value_aggregate( + """ + distinct select on columns + """ + distinct_on: [positions_with_value_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [positions_with_value_order_by!] + """ + filter the rows returned + """ + where: positions_with_value_bool_exp + ): positions_with_value_aggregate! + """ fetch data from the table: "predicate_object" """ predicate_objects( @@ -11892,6 +13113,157 @@ type subscription_root { """ position(id: String!): positions """ + fetch data from the table: "position_change_daily" + """ + position_change_daily( + """ + distinct select on columns + """ + distinct_on: [position_change_daily_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [position_change_daily_order_by!] + """ + filter the rows returned + """ + where: position_change_daily_bool_exp + ): [position_change_daily!]! + """ + fetch data from the table in a streaming manner: "position_change_daily" + """ + position_change_daily_stream( + """ + maximum number of rows returned in a single batch + """ + batch_size: Int! + """ + cursor to stream the results returned by the query + """ + cursor: [position_change_daily_stream_cursor_input]! + """ + filter the rows returned + """ + where: position_change_daily_bool_exp + ): [position_change_daily!]! + """ + fetch data from the table: "position_change_hourly" + """ + position_change_hourly( + """ + distinct select on columns + """ + distinct_on: [position_change_hourly_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [position_change_hourly_order_by!] + """ + filter the rows returned + """ + where: position_change_hourly_bool_exp + ): [position_change_hourly!]! + """ + fetch data from the table in a streaming manner: "position_change_hourly" + """ + position_change_hourly_stream( + """ + maximum number of rows returned in a single batch + """ + batch_size: Int! + """ + cursor to stream the results returned by the query + """ + cursor: [position_change_hourly_stream_cursor_input]! + """ + filter the rows returned + """ + where: position_change_hourly_bool_exp + ): [position_change_hourly!]! + """ + fetch data from the table: "position_change" + """ + position_changes( + """ + distinct select on columns + """ + distinct_on: [position_changes_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [position_changes_order_by!] + """ + filter the rows returned + """ + where: position_changes_bool_exp + ): [position_changes!]! + """ + fetch aggregated fields from the table: "position_change" + """ + position_changes_aggregate( + """ + distinct select on columns + """ + distinct_on: [position_changes_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [position_changes_order_by!] + """ + filter the rows returned + """ + where: position_changes_bool_exp + ): position_changes_aggregate! + """ + fetch data from the table in a streaming manner: "position_change" + """ + position_changes_stream( + """ + maximum number of rows returned in a single batch + """ + batch_size: Int! + """ + cursor to stream the results returned by the query + """ + cursor: [position_changes_stream_cursor_input]! + """ + filter the rows returned + """ + where: position_changes_bool_exp + ): [position_changes!]! + """ An array relationship """ positions( @@ -12017,6 +13389,73 @@ type subscription_root { where: positions_bool_exp ): [positions!]! """ + fetch data from the table: "position_with_value" + """ + positions_with_value( + """ + distinct select on columns + """ + distinct_on: [positions_with_value_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [positions_with_value_order_by!] + """ + filter the rows returned + """ + where: positions_with_value_bool_exp + ): [positions_with_value!]! + """ + fetch aggregated fields from the table: "position_with_value" + """ + positions_with_value_aggregate( + """ + distinct select on columns + """ + distinct_on: [positions_with_value_select_column!] + """ + limit the number of rows returned + """ + limit: Int + """ + skip the first n rows. Use only with order_by + """ + offset: Int + """ + sort the rows by one or more columns + """ + order_by: [positions_with_value_order_by!] + """ + filter the rows returned + """ + where: positions_with_value_bool_exp + ): positions_with_value_aggregate! + """ + fetch data from the table in a streaming manner: "position_with_value" + """ + positions_with_value_stream( + """ + maximum number of rows returned in a single batch + """ + batch_size: Int! + """ + cursor to stream the results returned by the query + """ + cursor: [positions_with_value_stream_cursor_input]! + """ + filter the rows returned + """ + where: positions_with_value_bool_exp + ): [positions_with_value!]! + """ fetch data from the table: "predicate_object" """ predicate_objects( diff --git a/packages/graphql/src/constants.ts b/packages/graphql/src/constants.ts index a015bc87..3b3a7870 100644 --- a/packages/graphql/src/constants.ts +++ b/packages/graphql/src/constants.ts @@ -1,7 +1,3 @@ export const API_URL_LOCAL = 'http://localhost:8080/v1/graphql' -export const API_URL_DEV = - 'https://testnet.intuition.sh/v1/graphql' -// export const API_URL_PROD = 'https://prod.base.intuition-api.com/v1/graphql' -export const API_URL_PROD = 'https://testnet.intuition.sh/v1/graphql' -//'https://prod.base-sepolia.intuition-api.com/v1/graphql' -//'https://prod.base-mainnet-v-1-0.intuition.sh/v1/graphql' \ No newline at end of file +export const API_URL_DEV = 'https://testnet.intuition.sh/v1/graphql' +export const API_URL_PROD = 'https://mainnet.intuition.sh/v1/graphql' \ No newline at end of file diff --git a/packages/graphql/src/generated/index.ts b/packages/graphql/src/generated/index.ts index 00e37491..322ac41b 100644 --- a/packages/graphql/src/generated/index.ts +++ b/packages/graphql/src/generated/index.ts @@ -44,6 +44,58 @@ export type Scalars = { vault_type: { input: any; output: any } } +export type AccountPnlChartOutput = { + __typename?: "AccountPnlChartOutput" + account_id: Scalars["String"]["output"] + count: Scalars["Int"]["output"] + data: Array + interval: Scalars["String"]["output"] +} + +export type AccountPnlChartPoint = { + __typename?: "AccountPnlChartPoint" + equity_value: Scalars["String"]["output"] + net_invested: Scalars["String"]["output"] + pnl_pct: Scalars["String"]["output"] + timestamp: Scalars["String"]["output"] + total_assets_in: Scalars["String"]["output"] + total_assets_out: Scalars["String"]["output"] + total_pnl: Scalars["String"]["output"] + unrealized_pnl: Scalars["String"]["output"] +} + +export type AccountPnlRealizedEntry = { + __typename?: "AccountPnlRealizedEntry" + assets_out: Scalars["String"]["output"] + cost_basis: Scalars["String"]["output"] + curve_id: Scalars["String"]["output"] + realized_pnl: Scalars["String"]["output"] + realized_pnl_pct: Scalars["String"]["output"] + shares_redeemed: Scalars["String"]["output"] + term_id: Scalars["String"]["output"] + timestamp: Scalars["String"]["output"] +} + +export type AccountPnlRealizedOutput = { + __typename?: "AccountPnlRealizedOutput" + account_id: Scalars["String"]["output"] + count: Scalars["Int"]["output"] + data: Array +} + +export type AccountPnlSnapshotOutput = { + __typename?: "AccountPnlSnapshotOutput" + account_id: Scalars["String"]["output"] + equity_value: Scalars["String"]["output"] + net_invested: Scalars["String"]["output"] + pnl_pct: Scalars["String"]["output"] + timestamp: Scalars["String"]["output"] + total_assets_in: Scalars["String"]["output"] + total_assets_out: Scalars["String"]["output"] + total_pnl: Scalars["String"]["output"] + unrealized_pnl: Scalars["String"]["output"] +} + /** Boolean expression to compare columns of type "Boolean". All fields are combined with logical 'AND'. */ export type Boolean_Comparison_Exp = { _eq?: InputMaybe @@ -88,6 +140,23 @@ export type ChartSvgOutput = { svg: Scalars["String"]["output"] } +export type GetAccountPnlChartInput = { + account_id: Scalars["String"]["input"] + end_time: Scalars["String"]["input"] + interval: Scalars["String"]["input"] + start_time: Scalars["String"]["input"] +} + +export type GetAccountPnlCurrentInput = { + account_id: Scalars["String"]["input"] +} + +export type GetAccountPnlRealizedInput = { + account_id: Scalars["String"]["input"] + end_time: Scalars["String"]["input"] + start_time: Scalars["String"]["input"] +} + export type GetChartJsonInput = { curve_id: Scalars["String"]["input"] end_time: Scalars["String"]["input"] @@ -110,6 +179,15 @@ export type GetChartSvgInput = { width?: InputMaybe } +export type GetPositionPnlChartInput = { + account_id: Scalars["String"]["input"] + curve_id: Scalars["String"]["input"] + end_time: Scalars["String"]["input"] + interval: Scalars["String"]["input"] + start_time: Scalars["String"]["input"] + term_id: Scalars["String"]["input"] +} + /** Boolean expression to compare columns of type "Int". All fields are combined with logical 'AND'. */ export type Int_Comparison_Exp = { _eq?: InputMaybe @@ -152,6 +230,30 @@ export type PinThingInput = { url?: InputMaybe } +export type PositionPnlChartOutput = { + __typename?: "PositionPnlChartOutput" + account_id: Scalars["String"]["output"] + count: Scalars["Int"]["output"] + curve_id: Scalars["String"]["output"] + data: Array + interval: Scalars["String"]["output"] + term_id: Scalars["String"]["output"] +} + +export type PositionPnlChartPoint = { + __typename?: "PositionPnlChartPoint" + equity_value: Scalars["String"]["output"] + net_invested: Scalars["String"]["output"] + pnl_pct: Scalars["String"]["output"] + share_price: Scalars["String"]["output"] + shares_total: Scalars["String"]["output"] + timestamp: Scalars["String"]["output"] + total_assets_in: Scalars["String"]["output"] + total_assets_out: Scalars["String"]["output"] + total_pnl: Scalars["String"]["output"] + unrealized_pnl: Scalars["String"]["output"] +} + /** Boolean expression to compare columns of type "String". All fields are combined with logical 'AND'. */ export type String_Comparison_Exp = { _eq?: InputMaybe @@ -3246,113 +3348,978 @@ export type Persons_Stream_Cursor_Value_Input = { url?: InputMaybe } -/** columns and relationships of "position" */ -export type Positions = { - __typename?: "positions" +/** columns and relationships of "position_change_daily" */ +export type Position_Change_Daily = { + __typename?: "position_change_daily" + /** An object relationship */ + account?: Maybe + account_id?: Maybe + assets_in_period?: Maybe + assets_out_period?: Maybe + bucket?: Maybe + curve_id?: Maybe + shares_delta_period?: Maybe + /** An object relationship */ + term?: Maybe + term_id?: Maybe + transaction_count?: Maybe + /** An object relationship */ + vault?: Maybe +} + +/** Boolean expression to filter rows from the table "position_change_daily". All fields are combined with a logical 'AND'. */ +export type Position_Change_Daily_Bool_Exp = { + _and?: InputMaybe> + _not?: InputMaybe + _or?: InputMaybe> + account?: InputMaybe + account_id?: InputMaybe + assets_in_period?: InputMaybe + assets_out_period?: InputMaybe + bucket?: InputMaybe + curve_id?: InputMaybe + shares_delta_period?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + transaction_count?: InputMaybe + vault?: InputMaybe +} + +/** Ordering options when selecting data from "position_change_daily". */ +export type Position_Change_Daily_Order_By = { + account?: InputMaybe + account_id?: InputMaybe + assets_in_period?: InputMaybe + assets_out_period?: InputMaybe + bucket?: InputMaybe + curve_id?: InputMaybe + shares_delta_period?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + transaction_count?: InputMaybe + vault?: InputMaybe +} + +/** select columns of table "position_change_daily" */ +export type Position_Change_Daily_Select_Column = + /** column name */ + | "account_id" + /** column name */ + | "assets_in_period" + /** column name */ + | "assets_out_period" + /** column name */ + | "bucket" + /** column name */ + | "curve_id" + /** column name */ + | "shares_delta_period" + /** column name */ + | "term_id" + /** column name */ + | "transaction_count" + +/** Streaming cursor of the table "position_change_daily" */ +export type Position_Change_Daily_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Position_Change_Daily_Stream_Cursor_Value_Input + /** cursor ordering */ + ordering?: InputMaybe +} + +/** Initial value of the column from where the streaming should start */ +export type Position_Change_Daily_Stream_Cursor_Value_Input = { + account_id?: InputMaybe + assets_in_period?: InputMaybe + assets_out_period?: InputMaybe + bucket?: InputMaybe + curve_id?: InputMaybe + shares_delta_period?: InputMaybe + term_id?: InputMaybe + transaction_count?: InputMaybe +} + +/** columns and relationships of "position_change_hourly" */ +export type Position_Change_Hourly = { + __typename?: "position_change_hourly" + /** An object relationship */ + account?: Maybe + account_id?: Maybe + assets_in_period?: Maybe + assets_out_period?: Maybe + bucket?: Maybe + curve_id?: Maybe + shares_delta_period?: Maybe + /** An object relationship */ + term?: Maybe + term_id?: Maybe + transaction_count?: Maybe + /** An object relationship */ + vault?: Maybe +} + +/** Boolean expression to filter rows from the table "position_change_hourly". All fields are combined with a logical 'AND'. */ +export type Position_Change_Hourly_Bool_Exp = { + _and?: InputMaybe> + _not?: InputMaybe + _or?: InputMaybe> + account?: InputMaybe + account_id?: InputMaybe + assets_in_period?: InputMaybe + assets_out_period?: InputMaybe + bucket?: InputMaybe + curve_id?: InputMaybe + shares_delta_period?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + transaction_count?: InputMaybe + vault?: InputMaybe +} + +/** Ordering options when selecting data from "position_change_hourly". */ +export type Position_Change_Hourly_Order_By = { + account?: InputMaybe + account_id?: InputMaybe + assets_in_period?: InputMaybe + assets_out_period?: InputMaybe + bucket?: InputMaybe + curve_id?: InputMaybe + shares_delta_period?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + transaction_count?: InputMaybe + vault?: InputMaybe +} + +/** select columns of table "position_change_hourly" */ +export type Position_Change_Hourly_Select_Column = + /** column name */ + | "account_id" + /** column name */ + | "assets_in_period" + /** column name */ + | "assets_out_period" + /** column name */ + | "bucket" + /** column name */ + | "curve_id" + /** column name */ + | "shares_delta_period" + /** column name */ + | "term_id" + /** column name */ + | "transaction_count" + +/** Streaming cursor of the table "position_change_hourly" */ +export type Position_Change_Hourly_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Position_Change_Hourly_Stream_Cursor_Value_Input + /** cursor ordering */ + ordering?: InputMaybe +} + +/** Initial value of the column from where the streaming should start */ +export type Position_Change_Hourly_Stream_Cursor_Value_Input = { + account_id?: InputMaybe + assets_in_period?: InputMaybe + assets_out_period?: InputMaybe + bucket?: InputMaybe + curve_id?: InputMaybe + shares_delta_period?: InputMaybe + term_id?: InputMaybe + transaction_count?: InputMaybe +} + +/** columns and relationships of "position_change" */ +export type Position_Changes = { + __typename?: "position_changes" /** An object relationship */ account?: Maybe account_id: Scalars["String"]["output"] - block_number: Scalars["bigint"]["output"] + assets_in: Scalars["numeric"]["output"] + assets_out: Scalars["numeric"]["output"] + block_number: Scalars["numeric"]["output"] created_at: Scalars["timestamptz"]["output"] curve_id: Scalars["numeric"]["output"] - id: Scalars["String"]["output"] + event_id: Scalars["String"]["output"] + event_type: Scalars["String"]["output"] + id: Scalars["bigint"]["output"] log_index: Scalars["bigint"]["output"] - shares: Scalars["numeric"]["output"] + shares_delta: Scalars["numeric"]["output"] /** An object relationship */ term?: Maybe term_id: Scalars["String"]["output"] - total_deposit_assets_after_total_fees: Scalars["numeric"]["output"] - total_redeem_assets_for_receiver: Scalars["numeric"]["output"] transaction_hash: Scalars["String"]["output"] - transaction_index: Scalars["bigint"]["output"] - updated_at: Scalars["timestamptz"]["output"] /** An object relationship */ vault?: Maybe } -/** aggregated selection of "position" */ -export type Positions_Aggregate = { - __typename?: "positions_aggregate" - aggregate?: Maybe - nodes: Array +/** aggregated selection of "position_change" */ +export type Position_Changes_Aggregate = { + __typename?: "position_changes_aggregate" + aggregate?: Maybe + nodes: Array } -export type Positions_Aggregate_Bool_Exp = { - count?: InputMaybe +/** aggregate fields of "position_change" */ +export type Position_Changes_Aggregate_Fields = { + __typename?: "position_changes_aggregate_fields" + avg?: Maybe + count: Scalars["Int"]["output"] + max?: Maybe + min?: Maybe + stddev?: Maybe + stddev_pop?: Maybe + stddev_samp?: Maybe + sum?: Maybe + var_pop?: Maybe + var_samp?: Maybe + variance?: Maybe +} + +/** aggregate fields of "position_change" */ +export type Position_Changes_Aggregate_FieldsCountArgs = { + columns?: InputMaybe> + distinct?: InputMaybe } -export type Positions_Aggregate_Bool_Exp_Count = { - arguments?: InputMaybe> - distinct?: InputMaybe - filter?: InputMaybe - predicate: Int_Comparison_Exp +/** aggregate avg on columns */ +export type Position_Changes_Avg_Fields = { + __typename?: "position_changes_avg_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe } -/** aggregate fields of "position" */ -export type Positions_Aggregate_Fields = { - __typename?: "positions_aggregate_fields" - avg?: Maybe - count: Scalars["Int"]["output"] - max?: Maybe - min?: Maybe - stddev?: Maybe - stddev_pop?: Maybe - stddev_samp?: Maybe - sum?: Maybe - var_pop?: Maybe - var_samp?: Maybe - variance?: Maybe +/** Boolean expression to filter rows from the table "position_change". All fields are combined with a logical 'AND'. */ +export type Position_Changes_Bool_Exp = { + _and?: InputMaybe> + _not?: InputMaybe + _or?: InputMaybe> + account?: InputMaybe + account_id?: InputMaybe + assets_in?: InputMaybe + assets_out?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + event_id?: InputMaybe + event_type?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares_delta?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + transaction_hash?: InputMaybe + vault?: InputMaybe +} + +/** aggregate max on columns */ +export type Position_Changes_Max_Fields = { + __typename?: "position_changes_max_fields" + account_id?: Maybe + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + created_at?: Maybe + curve_id?: Maybe + event_id?: Maybe + event_type?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe + term_id?: Maybe + transaction_hash?: Maybe +} + +/** aggregate min on columns */ +export type Position_Changes_Min_Fields = { + __typename?: "position_changes_min_fields" + account_id?: Maybe + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + created_at?: Maybe + curve_id?: Maybe + event_id?: Maybe + event_type?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe + term_id?: Maybe + transaction_hash?: Maybe +} + +/** Ordering options when selecting data from "position_change". */ +export type Position_Changes_Order_By = { + account?: InputMaybe + account_id?: InputMaybe + assets_in?: InputMaybe + assets_out?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + event_id?: InputMaybe + event_type?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares_delta?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + transaction_hash?: InputMaybe + vault?: InputMaybe +} + +/** select columns of table "position_change" */ +export type Position_Changes_Select_Column = + /** column name */ + | "account_id" + /** column name */ + | "assets_in" + /** column name */ + | "assets_out" + /** column name */ + | "block_number" + /** column name */ + | "created_at" + /** column name */ + | "curve_id" + /** column name */ + | "event_id" + /** column name */ + | "event_type" + /** column name */ + | "id" + /** column name */ + | "log_index" + /** column name */ + | "shares_delta" + /** column name */ + | "term_id" + /** column name */ + | "transaction_hash" + +/** aggregate stddev on columns */ +export type Position_Changes_Stddev_Fields = { + __typename?: "position_changes_stddev_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe +} + +/** aggregate stddev_pop on columns */ +export type Position_Changes_Stddev_Pop_Fields = { + __typename?: "position_changes_stddev_pop_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe +} + +/** aggregate stddev_samp on columns */ +export type Position_Changes_Stddev_Samp_Fields = { + __typename?: "position_changes_stddev_samp_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe +} + +/** Streaming cursor of the table "position_changes" */ +export type Position_Changes_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Position_Changes_Stream_Cursor_Value_Input + /** cursor ordering */ + ordering?: InputMaybe +} + +/** Initial value of the column from where the streaming should start */ +export type Position_Changes_Stream_Cursor_Value_Input = { + account_id?: InputMaybe + assets_in?: InputMaybe + assets_out?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + event_id?: InputMaybe + event_type?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares_delta?: InputMaybe + term_id?: InputMaybe + transaction_hash?: InputMaybe +} + +/** aggregate sum on columns */ +export type Position_Changes_Sum_Fields = { + __typename?: "position_changes_sum_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe +} + +/** aggregate var_pop on columns */ +export type Position_Changes_Var_Pop_Fields = { + __typename?: "position_changes_var_pop_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe +} + +/** aggregate var_samp on columns */ +export type Position_Changes_Var_Samp_Fields = { + __typename?: "position_changes_var_samp_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe +} + +/** aggregate variance on columns */ +export type Position_Changes_Variance_Fields = { + __typename?: "position_changes_variance_fields" + assets_in?: Maybe + assets_out?: Maybe + block_number?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares_delta?: Maybe +} + +/** columns and relationships of "position" */ +export type Positions = { + __typename?: "positions" + /** An object relationship */ + account?: Maybe + account_id: Scalars["String"]["output"] + block_number: Scalars["bigint"]["output"] + created_at: Scalars["timestamptz"]["output"] + curve_id: Scalars["numeric"]["output"] + id: Scalars["String"]["output"] + log_index: Scalars["bigint"]["output"] + shares: Scalars["numeric"]["output"] + /** An object relationship */ + term?: Maybe + term_id: Scalars["String"]["output"] + total_deposit_assets_after_total_fees: Scalars["numeric"]["output"] + total_redeem_assets_for_receiver: Scalars["numeric"]["output"] + transaction_hash: Scalars["String"]["output"] + transaction_index: Scalars["bigint"]["output"] + updated_at: Scalars["timestamptz"]["output"] + /** An object relationship */ + vault?: Maybe +} + +/** aggregated selection of "position" */ +export type Positions_Aggregate = { + __typename?: "positions_aggregate" + aggregate?: Maybe + nodes: Array +} + +export type Positions_Aggregate_Bool_Exp = { + count?: InputMaybe +} + +export type Positions_Aggregate_Bool_Exp_Count = { + arguments?: InputMaybe> + distinct?: InputMaybe + filter?: InputMaybe + predicate: Int_Comparison_Exp +} + +/** aggregate fields of "position" */ +export type Positions_Aggregate_Fields = { + __typename?: "positions_aggregate_fields" + avg?: Maybe + count: Scalars["Int"]["output"] + max?: Maybe + min?: Maybe + stddev?: Maybe + stddev_pop?: Maybe + stddev_samp?: Maybe + sum?: Maybe + var_pop?: Maybe + var_samp?: Maybe + variance?: Maybe +} + +/** aggregate fields of "position" */ +export type Positions_Aggregate_FieldsCountArgs = { + columns?: InputMaybe> + distinct?: InputMaybe +} + +/** order by aggregate values of table "position" */ +export type Positions_Aggregate_Order_By = { + avg?: InputMaybe + count?: InputMaybe + max?: InputMaybe + min?: InputMaybe + stddev?: InputMaybe + stddev_pop?: InputMaybe + stddev_samp?: InputMaybe + sum?: InputMaybe + var_pop?: InputMaybe + var_samp?: InputMaybe + variance?: InputMaybe +} + +/** aggregate avg on columns */ +export type Positions_Avg_Fields = { + __typename?: "positions_avg_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by avg() on columns of table "position" */ +export type Positions_Avg_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** Boolean expression to filter rows from the table "position". All fields are combined with a logical 'AND'. */ +export type Positions_Bool_Exp = { + _and?: InputMaybe> + _not?: InputMaybe + _or?: InputMaybe> + account?: InputMaybe + account_id?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_hash?: InputMaybe + transaction_index?: InputMaybe + updated_at?: InputMaybe + vault?: InputMaybe +} + +export type Positions_From_Following_Args = { + address?: InputMaybe +} + +/** aggregate max on columns */ +export type Positions_Max_Fields = { + __typename?: "positions_max_fields" + account_id?: Maybe + block_number?: Maybe + created_at?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares?: Maybe + term_id?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_hash?: Maybe + transaction_index?: Maybe + updated_at?: Maybe +} + +/** order by max() on columns of table "position" */ +export type Positions_Max_Order_By = { + account_id?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + term_id?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_hash?: InputMaybe + transaction_index?: InputMaybe + updated_at?: InputMaybe +} + +/** aggregate min on columns */ +export type Positions_Min_Fields = { + __typename?: "positions_min_fields" + account_id?: Maybe + block_number?: Maybe + created_at?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares?: Maybe + term_id?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_hash?: Maybe + transaction_index?: Maybe + updated_at?: Maybe +} + +/** order by min() on columns of table "position" */ +export type Positions_Min_Order_By = { + account_id?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + term_id?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_hash?: InputMaybe + transaction_index?: InputMaybe + updated_at?: InputMaybe +} + +/** Ordering options when selecting data from "position". */ +export type Positions_Order_By = { + account?: InputMaybe + account_id?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + term?: InputMaybe + term_id?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_hash?: InputMaybe + transaction_index?: InputMaybe + updated_at?: InputMaybe + vault?: InputMaybe +} + +/** select columns of table "position" */ +export type Positions_Select_Column = + /** column name */ + | "account_id" + /** column name */ + | "block_number" + /** column name */ + | "created_at" + /** column name */ + | "curve_id" + /** column name */ + | "id" + /** column name */ + | "log_index" + /** column name */ + | "shares" + /** column name */ + | "term_id" + /** column name */ + | "total_deposit_assets_after_total_fees" + /** column name */ + | "total_redeem_assets_for_receiver" + /** column name */ + | "transaction_hash" + /** column name */ + | "transaction_index" + /** column name */ + | "updated_at" + +/** aggregate stddev on columns */ +export type Positions_Stddev_Fields = { + __typename?: "positions_stddev_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by stddev() on columns of table "position" */ +export type Positions_Stddev_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** aggregate stddev_pop on columns */ +export type Positions_Stddev_Pop_Fields = { + __typename?: "positions_stddev_pop_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by stddev_pop() on columns of table "position" */ +export type Positions_Stddev_Pop_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** aggregate stddev_samp on columns */ +export type Positions_Stddev_Samp_Fields = { + __typename?: "positions_stddev_samp_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by stddev_samp() on columns of table "position" */ +export type Positions_Stddev_Samp_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** Streaming cursor of the table "positions" */ +export type Positions_Stream_Cursor_Input = { + /** Stream column input with initial value */ + initial_value: Positions_Stream_Cursor_Value_Input + /** cursor ordering */ + ordering?: InputMaybe +} + +/** Initial value of the column from where the streaming should start */ +export type Positions_Stream_Cursor_Value_Input = { + account_id?: InputMaybe + block_number?: InputMaybe + created_at?: InputMaybe + curve_id?: InputMaybe + id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + term_id?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe< + Scalars["numeric"]["input"] + > + total_redeem_assets_for_receiver?: InputMaybe + transaction_hash?: InputMaybe + transaction_index?: InputMaybe + updated_at?: InputMaybe +} + +/** aggregate sum on columns */ +export type Positions_Sum_Fields = { + __typename?: "positions_sum_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by sum() on columns of table "position" */ +export type Positions_Sum_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** aggregate var_pop on columns */ +export type Positions_Var_Pop_Fields = { + __typename?: "positions_var_pop_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by var_pop() on columns of table "position" */ +export type Positions_Var_Pop_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** aggregate var_samp on columns */ +export type Positions_Var_Samp_Fields = { + __typename?: "positions_var_samp_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by var_samp() on columns of table "position" */ +export type Positions_Var_Samp_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** aggregate variance on columns */ +export type Positions_Variance_Fields = { + __typename?: "positions_variance_fields" + block_number?: Maybe + curve_id?: Maybe + log_index?: Maybe + shares?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_index?: Maybe +} + +/** order by variance() on columns of table "position" */ +export type Positions_Variance_Order_By = { + block_number?: InputMaybe + curve_id?: InputMaybe + log_index?: InputMaybe + shares?: InputMaybe + total_deposit_assets_after_total_fees?: InputMaybe + total_redeem_assets_for_receiver?: InputMaybe + transaction_index?: InputMaybe +} + +/** columns and relationships of "position_with_value" */ +export type Positions_With_Value = { + __typename?: "positions_with_value" + /** An object relationship */ + account?: Maybe + account_id?: Maybe + block_number?: Maybe + created_at?: Maybe + curve_id?: Maybe + id?: Maybe + log_index?: Maybe + shares?: Maybe + /** An object relationship */ + term?: Maybe + term_id?: Maybe + theoretical_value?: Maybe + total_deposit_assets_after_total_fees?: Maybe + total_redeem_assets_for_receiver?: Maybe + transaction_hash?: Maybe + transaction_index?: Maybe + updated_at?: Maybe + /** An object relationship */ + vault?: Maybe } -/** aggregate fields of "position" */ -export type Positions_Aggregate_FieldsCountArgs = { - columns?: InputMaybe> - distinct?: InputMaybe +/** aggregated selection of "position_with_value" */ +export type Positions_With_Value_Aggregate = { + __typename?: "positions_with_value_aggregate" + aggregate?: Maybe + nodes: Array } -/** order by aggregate values of table "position" */ -export type Positions_Aggregate_Order_By = { - avg?: InputMaybe - count?: InputMaybe - max?: InputMaybe - min?: InputMaybe - stddev?: InputMaybe - stddev_pop?: InputMaybe - stddev_samp?: InputMaybe - sum?: InputMaybe - var_pop?: InputMaybe - var_samp?: InputMaybe - variance?: InputMaybe +/** aggregate fields of "position_with_value" */ +export type Positions_With_Value_Aggregate_Fields = { + __typename?: "positions_with_value_aggregate_fields" + avg?: Maybe + count: Scalars["Int"]["output"] + max?: Maybe + min?: Maybe + stddev?: Maybe + stddev_pop?: Maybe + stddev_samp?: Maybe + sum?: Maybe + var_pop?: Maybe + var_samp?: Maybe + variance?: Maybe +} + +/** aggregate fields of "position_with_value" */ +export type Positions_With_Value_Aggregate_FieldsCountArgs = { + columns?: InputMaybe> + distinct?: InputMaybe } /** aggregate avg on columns */ -export type Positions_Avg_Fields = { - __typename?: "positions_avg_fields" +export type Positions_With_Value_Avg_Fields = { + __typename?: "positions_with_value_avg_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by avg() on columns of table "position" */ -export type Positions_Avg_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - -/** Boolean expression to filter rows from the table "position". All fields are combined with a logical 'AND'. */ -export type Positions_Bool_Exp = { - _and?: InputMaybe> - _not?: InputMaybe - _or?: InputMaybe> +/** Boolean expression to filter rows from the table "position_with_value". All fields are combined with a logical 'AND'. */ +export type Positions_With_Value_Bool_Exp = { + _and?: InputMaybe> + _not?: InputMaybe + _or?: InputMaybe> account?: InputMaybe account_id?: InputMaybe block_number?: InputMaybe @@ -3363,6 +4330,7 @@ export type Positions_Bool_Exp = { shares?: InputMaybe term?: InputMaybe term_id?: InputMaybe + theoretical_value?: InputMaybe total_deposit_assets_after_total_fees?: InputMaybe total_redeem_assets_for_receiver?: InputMaybe transaction_hash?: InputMaybe @@ -3371,13 +4339,9 @@ export type Positions_Bool_Exp = { vault?: InputMaybe } -export type Positions_From_Following_Args = { - address?: InputMaybe -} - /** aggregate max on columns */ -export type Positions_Max_Fields = { - __typename?: "positions_max_fields" +export type Positions_With_Value_Max_Fields = { + __typename?: "positions_with_value_max_fields" account_id?: Maybe block_number?: Maybe created_at?: Maybe @@ -3386,6 +4350,7 @@ export type Positions_Max_Fields = { log_index?: Maybe shares?: Maybe term_id?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_hash?: Maybe @@ -3393,26 +4358,9 @@ export type Positions_Max_Fields = { updated_at?: Maybe } -/** order by max() on columns of table "position" */ -export type Positions_Max_Order_By = { - account_id?: InputMaybe - block_number?: InputMaybe - created_at?: InputMaybe - curve_id?: InputMaybe - id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - term_id?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_hash?: InputMaybe - transaction_index?: InputMaybe - updated_at?: InputMaybe -} - /** aggregate min on columns */ -export type Positions_Min_Fields = { - __typename?: "positions_min_fields" +export type Positions_With_Value_Min_Fields = { + __typename?: "positions_with_value_min_fields" account_id?: Maybe block_number?: Maybe created_at?: Maybe @@ -3421,6 +4369,7 @@ export type Positions_Min_Fields = { log_index?: Maybe shares?: Maybe term_id?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_hash?: Maybe @@ -3428,25 +4377,8 @@ export type Positions_Min_Fields = { updated_at?: Maybe } -/** order by min() on columns of table "position" */ -export type Positions_Min_Order_By = { - account_id?: InputMaybe - block_number?: InputMaybe - created_at?: InputMaybe - curve_id?: InputMaybe - id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - term_id?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_hash?: InputMaybe - transaction_index?: InputMaybe - updated_at?: InputMaybe -} - -/** Ordering options when selecting data from "position". */ -export type Positions_Order_By = { +/** Ordering options when selecting data from "position_with_value". */ +export type Positions_With_Value_Order_By = { account?: InputMaybe account_id?: InputMaybe block_number?: InputMaybe @@ -3457,6 +4389,7 @@ export type Positions_Order_By = { shares?: InputMaybe term?: InputMaybe term_id?: InputMaybe + theoretical_value?: InputMaybe total_deposit_assets_after_total_fees?: InputMaybe total_redeem_assets_for_receiver?: InputMaybe transaction_hash?: InputMaybe @@ -3465,8 +4398,8 @@ export type Positions_Order_By = { vault?: InputMaybe } -/** select columns of table "position" */ -export type Positions_Select_Column = +/** select columns of table "position_with_value" */ +export type Positions_With_Value_Select_Column = /** column name */ | "account_id" /** column name */ @@ -3484,6 +4417,8 @@ export type Positions_Select_Column = /** column name */ | "term_id" /** column name */ + | "theoretical_value" + /** column name */ | "total_deposit_assets_after_total_fees" /** column name */ | "total_redeem_assets_for_receiver" @@ -3495,84 +4430,54 @@ export type Positions_Select_Column = | "updated_at" /** aggregate stddev on columns */ -export type Positions_Stddev_Fields = { - __typename?: "positions_stddev_fields" +export type Positions_With_Value_Stddev_Fields = { + __typename?: "positions_with_value_stddev_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by stddev() on columns of table "position" */ -export type Positions_Stddev_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - /** aggregate stddev_pop on columns */ -export type Positions_Stddev_Pop_Fields = { - __typename?: "positions_stddev_pop_fields" +export type Positions_With_Value_Stddev_Pop_Fields = { + __typename?: "positions_with_value_stddev_pop_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by stddev_pop() on columns of table "position" */ -export type Positions_Stddev_Pop_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - /** aggregate stddev_samp on columns */ -export type Positions_Stddev_Samp_Fields = { - __typename?: "positions_stddev_samp_fields" +export type Positions_With_Value_Stddev_Samp_Fields = { + __typename?: "positions_with_value_stddev_samp_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by stddev_samp() on columns of table "position" */ -export type Positions_Stddev_Samp_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - -/** Streaming cursor of the table "positions" */ -export type Positions_Stream_Cursor_Input = { +/** Streaming cursor of the table "positions_with_value" */ +export type Positions_With_Value_Stream_Cursor_Input = { /** Stream column input with initial value */ - initial_value: Positions_Stream_Cursor_Value_Input + initial_value: Positions_With_Value_Stream_Cursor_Value_Input /** cursor ordering */ ordering?: InputMaybe } /** Initial value of the column from where the streaming should start */ -export type Positions_Stream_Cursor_Value_Input = { +export type Positions_With_Value_Stream_Cursor_Value_Input = { account_id?: InputMaybe block_number?: InputMaybe created_at?: InputMaybe @@ -3581,6 +4486,7 @@ export type Positions_Stream_Cursor_Value_Input = { log_index?: InputMaybe shares?: InputMaybe term_id?: InputMaybe + theoretical_value?: InputMaybe total_deposit_assets_after_total_fees?: InputMaybe< Scalars["numeric"]["input"] > @@ -3591,97 +4497,57 @@ export type Positions_Stream_Cursor_Value_Input = { } /** aggregate sum on columns */ -export type Positions_Sum_Fields = { - __typename?: "positions_sum_fields" +export type Positions_With_Value_Sum_Fields = { + __typename?: "positions_with_value_sum_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by sum() on columns of table "position" */ -export type Positions_Sum_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - /** aggregate var_pop on columns */ -export type Positions_Var_Pop_Fields = { - __typename?: "positions_var_pop_fields" +export type Positions_With_Value_Var_Pop_Fields = { + __typename?: "positions_with_value_var_pop_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by var_pop() on columns of table "position" */ -export type Positions_Var_Pop_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - /** aggregate var_samp on columns */ -export type Positions_Var_Samp_Fields = { - __typename?: "positions_var_samp_fields" +export type Positions_With_Value_Var_Samp_Fields = { + __typename?: "positions_with_value_var_samp_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by var_samp() on columns of table "position" */ -export type Positions_Var_Samp_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - /** aggregate variance on columns */ -export type Positions_Variance_Fields = { - __typename?: "positions_variance_fields" +export type Positions_With_Value_Variance_Fields = { + __typename?: "positions_with_value_variance_fields" block_number?: Maybe curve_id?: Maybe log_index?: Maybe shares?: Maybe + theoretical_value?: Maybe total_deposit_assets_after_total_fees?: Maybe total_redeem_assets_for_receiver?: Maybe transaction_index?: Maybe } -/** order by variance() on columns of table "position" */ -export type Positions_Variance_Order_By = { - block_number?: InputMaybe - curve_id?: InputMaybe - log_index?: InputMaybe - shares?: InputMaybe - total_deposit_assets_after_total_fees?: InputMaybe - total_redeem_assets_for_receiver?: InputMaybe - transaction_index?: InputMaybe -} - /** columns and relationships of "predicate_object" */ export type Predicate_Objects = { __typename?: "predicate_objects" @@ -4057,10 +4923,22 @@ export type Query_Root = { following: Array /** execute function "following" and query aggregates on result of table type "account" */ following_aggregate: Accounts_Aggregate + /** Fetches account-level PnL chart data */ + getAccountPnlChart?: Maybe + /** Fetches current account PnL snapshot */ + getAccountPnlCurrent?: Maybe + /** Fetches realized PnL breakdown for an account */ + getAccountPnlRealized?: Maybe /** Fetches chart data (JSON) for a term/curve combination */ getChartJson?: Maybe + /** Fetches raw share price chart data (JSON) from share_price_change */ + getChartRawJson?: Maybe + /** Fetches raw share price chart SVG from share_price_change */ + getChartRawSvg?: Maybe /** Fetches chart SVG for a term/curve combination */ getChartSvg?: Maybe + /** Fetches position PnL chart data */ + getPositionPnlChart?: Maybe /** fetch data from the table: "json_object" using primary key columns */ json_object?: Maybe /** fetch data from the table: "json_object" */ @@ -4081,6 +4959,14 @@ export type Query_Root = { persons_aggregate: Persons_Aggregate /** fetch data from the table: "position" using primary key columns */ position?: Maybe + /** fetch data from the table: "position_change_daily" */ + position_change_daily: Array + /** fetch data from the table: "position_change_hourly" */ + position_change_hourly: Array + /** fetch data from the table: "position_change" */ + position_changes: Array + /** fetch aggregated fields from the table: "position_change" */ + position_changes_aggregate: Position_Changes_Aggregate /** An array relationship */ positions: Array /** An aggregate relationship */ @@ -4089,6 +4975,10 @@ export type Query_Root = { positions_from_following: Array /** execute function "positions_from_following" and query aggregates on result of table type "position" */ positions_from_following_aggregate: Positions_Aggregate + /** fetch data from the table: "position_with_value" */ + positions_with_value: Array + /** fetch aggregated fields from the table: "position_with_value" */ + positions_with_value_aggregate: Positions_With_Value_Aggregate /** fetch data from the table: "predicate_object" */ predicate_objects: Array /** fetch aggregated fields from the table: "predicate_object" */ @@ -4429,14 +5319,38 @@ export type Query_RootFollowing_AggregateArgs = { where?: InputMaybe } +export type Query_RootGetAccountPnlChartArgs = { + input: GetAccountPnlChartInput +} + +export type Query_RootGetAccountPnlCurrentArgs = { + input: GetAccountPnlCurrentInput +} + +export type Query_RootGetAccountPnlRealizedArgs = { + input: GetAccountPnlRealizedInput +} + export type Query_RootGetChartJsonArgs = { input: GetChartJsonInput } +export type Query_RootGetChartRawJsonArgs = { + input: GetChartJsonInput +} + +export type Query_RootGetChartRawSvgArgs = { + input: GetChartSvgInput +} + export type Query_RootGetChartSvgArgs = { input: GetChartSvgInput } +export type Query_RootGetPositionPnlChartArgs = { + input: GetPositionPnlChartInput +} + export type Query_RootJson_ObjectArgs = { id: Scalars["String"]["input"] } @@ -4501,6 +5415,38 @@ export type Query_RootPositionArgs = { id: Scalars["String"]["input"] } +export type Query_RootPosition_Change_DailyArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Query_RootPosition_Change_HourlyArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Query_RootPosition_ChangesArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Query_RootPosition_Changes_AggregateArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + export type Query_RootPositionsArgs = { distinct_on?: InputMaybe> limit?: InputMaybe @@ -4535,6 +5481,22 @@ export type Query_RootPositions_From_Following_AggregateArgs = { where?: InputMaybe } +export type Query_RootPositions_With_ValueArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Query_RootPositions_With_Value_AggregateArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + export type Query_RootPredicate_ObjectsArgs = { distinct_on?: InputMaybe> limit?: InputMaybe @@ -7913,6 +8875,20 @@ export type Subscription_Root = { persons_stream: Array /** fetch data from the table: "position" using primary key columns */ position?: Maybe + /** fetch data from the table: "position_change_daily" */ + position_change_daily: Array + /** fetch data from the table in a streaming manner: "position_change_daily" */ + position_change_daily_stream: Array + /** fetch data from the table: "position_change_hourly" */ + position_change_hourly: Array + /** fetch data from the table in a streaming manner: "position_change_hourly" */ + position_change_hourly_stream: Array + /** fetch data from the table: "position_change" */ + position_changes: Array + /** fetch aggregated fields from the table: "position_change" */ + position_changes_aggregate: Position_Changes_Aggregate + /** fetch data from the table in a streaming manner: "position_change" */ + position_changes_stream: Array /** An array relationship */ positions: Array /** An aggregate relationship */ @@ -7923,6 +8899,12 @@ export type Subscription_Root = { positions_from_following_aggregate: Positions_Aggregate /** fetch data from the table in a streaming manner: "position" */ positions_stream: Array + /** fetch data from the table: "position_with_value" */ + positions_with_value: Array + /** fetch aggregated fields from the table: "position_with_value" */ + positions_with_value_aggregate: Positions_With_Value_Aggregate + /** fetch data from the table in a streaming manner: "position_with_value" */ + positions_with_value_stream: Array /** fetch data from the table: "predicate_object" */ predicate_objects: Array /** fetch aggregated fields from the table: "predicate_object" */ @@ -8465,6 +9447,56 @@ export type Subscription_RootPositionArgs = { id: Scalars["String"]["input"] } +export type Subscription_RootPosition_Change_DailyArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Subscription_RootPosition_Change_Daily_StreamArgs = { + batch_size: Scalars["Int"]["input"] + cursor: Array> + where?: InputMaybe +} + +export type Subscription_RootPosition_Change_HourlyArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Subscription_RootPosition_Change_Hourly_StreamArgs = { + batch_size: Scalars["Int"]["input"] + cursor: Array> + where?: InputMaybe +} + +export type Subscription_RootPosition_ChangesArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Subscription_RootPosition_Changes_AggregateArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Subscription_RootPosition_Changes_StreamArgs = { + batch_size: Scalars["Int"]["input"] + cursor: Array> + where?: InputMaybe +} + export type Subscription_RootPositionsArgs = { distinct_on?: InputMaybe> limit?: InputMaybe @@ -8505,6 +9537,28 @@ export type Subscription_RootPositions_StreamArgs = { where?: InputMaybe } +export type Subscription_RootPositions_With_ValueArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Subscription_RootPositions_With_Value_AggregateArgs = { + distinct_on?: InputMaybe> + limit?: InputMaybe + offset?: InputMaybe + order_by?: InputMaybe> + where?: InputMaybe +} + +export type Subscription_RootPositions_With_Value_StreamArgs = { + batch_size: Scalars["Int"]["input"] + cursor: Array> + where?: InputMaybe +} + export type Subscription_RootPredicate_ObjectsArgs = { distinct_on?: InputMaybe> limit?: InputMaybe diff --git a/src/abi/MultiVaultAbiExtended.ts b/src/abi/MultiVaultAbiExtended.ts index 5fb4261f..1eaf7681 100644 --- a/src/abi/MultiVaultAbiExtended.ts +++ b/src/abi/MultiVaultAbiExtended.ts @@ -10,4 +10,5 @@ export const MultiVaultAbiExtended = [ { type: "error", name: "StandardNotOpen", inputs: [{ name: "termId", type: "bytes32" }] }, { type: "error", name: "VaultClosed", inputs: [{ name: "termId", type: "bytes32" }] }, { type: "error", name: "TermNotFound", inputs: [{ name: "termId", type: "bytes32" }] }, + { type: "error", name: "MultiVault_DepositBelowMinimumDeposit", inputs: [] }, ] as const; diff --git a/src/assets/gold_fingerprint.jpg b/src/assets/gold_fingerprint.jpg new file mode 100644 index 00000000..46714a6b Binary files /dev/null and b/src/assets/gold_fingerprint.jpg differ diff --git a/src/components/AtomCard.tsx b/src/components/AtomCard.tsx index 7efafff9..760b444a 100644 --- a/src/components/AtomCard.tsx +++ b/src/components/AtomCard.tsx @@ -91,7 +91,7 @@ export const AtomCard: React.FC = ({ atom, tags }) => {

- {Math.max(positionCount - 1, 0)} + {Math.max(positionCount, 0)}