Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions src/generated/gql/exchange/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,23 @@ export enum ImplementationOrderBy {
wells = 'wells'
}

/**
* The severity level of a log entry.
* Log levels are ordered from most to least severe: CRITICAL > ERROR > WARNING > INFO > DEBUG
*/
export enum LogLevel {
/** Critical errors that require immediate attention */
CRITICAL = 'CRITICAL',
/** Detailed diagnostic information for debugging */
DEBUG = 'DEBUG',
/** Error conditions that indicate a failure */
ERROR = 'ERROR',
/** Informational messages about normal operations */
INFO = 'INFO',
/** Warning conditions that may require attention */
WARNING = 'WARNING'
}

/** Defines the order direction, either ascending or descending */
export enum OrderDirection {
asc = 'asc',
Expand Down Expand Up @@ -1360,6 +1377,8 @@ export enum PumpOrderBy {

export type Query = {
__typename?: 'Query';
/** Query execution logs emitted by the subgraph during indexing. Results are sorted by timestamp in descending order (newest first). */
_logs: Array<Log>;
/** Access to subgraph metadata */
_meta?: Maybe<Meta>;
aquifer?: Maybe<Aquifer>;
Expand Down Expand Up @@ -1397,6 +1416,17 @@ export type Query = {
};


export type QueryLogsArgs = {
first?: InputMaybe<Scalars['Int']['input']>;
from?: InputMaybe<Scalars['String']['input']>;
level?: InputMaybe<LogLevel>;
orderDirection?: InputMaybe<OrderDirection>;
search?: InputMaybe<Scalars['String']['input']>;
skip?: InputMaybe<Scalars['Int']['input']>;
to?: InputMaybe<Scalars['String']['input']>;
};


export type QueryMetaArgs = {
block?: InputMaybe<BlockHeight>;
};
Expand Down Expand Up @@ -3946,6 +3976,54 @@ export type Block = {
timestamp?: Maybe<Scalars['Int']['output']>;
};

/**
* A key-value pair of additional data associated with a log entry.
* These correspond to arguments passed to the log function in the subgraph code.
*/
export type LogArgument = {
__typename?: '_LogArgument_';
/** The parameter name */
key: Scalars['String']['output'];
/** The parameter value, serialized as a string */
value: Scalars['String']['output'];
};

/**
* Source code location metadata for a log entry.
* Indicates where in the subgraph's AssemblyScript code the log statement was executed.
*/
export type LogMeta = {
__typename?: '_LogMeta_';
/** The column number in the source file */
column: Scalars['Int']['output'];
/** The line number in the source file */
line: Scalars['Int']['output'];
/** The module or file path where the log was emitted */
module: Scalars['String']['output'];
};

/**
* A log entry emitted by a subgraph during indexing.
* Logs can be generated by the subgraph's AssemblyScript code using the `log.*` functions.
*/
export type Log = {
__typename?: '_Log_';
/** Additional structured data passed to the log function as key-value pairs */
arguments: Array<LogArgument>;
/** Unique identifier for this log entry */
id: Scalars['String']['output'];
/** The severity level of the log entry */
level: LogLevel;
/** Metadata about the source location in the subgraph code where the log was emitted */
meta: LogMeta;
/** The deployment hash of the subgraph that emitted this log */
subgraphId: Scalars['String']['output'];
/** The log message text */
text: Scalars['String']['output'];
/** The timestamp when the log was emitted, in RFC3339 format (e.g., '2024-01-15T10:30:00Z') */
timestamp: Scalars['String']['output'];
};

/** The type for the top-level _meta field */
export type Meta = {
__typename?: '_Meta_';
Expand Down
78 changes: 78 additions & 0 deletions src/generated/gql/pinto/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,23 @@ export enum FarmerBalanceOrderBy {
walletBalance = 'walletBalance'
}

/**
* The severity level of a log entry.
* Log levels are ordered from most to least severe: CRITICAL > ERROR > WARNING > INFO > DEBUG
*/
export enum LogLevel {
/** Critical errors that require immediate attention */
CRITICAL = 'CRITICAL',
/** Detailed diagnostic information for debugging */
DEBUG = 'DEBUG',
/** Error conditions that indicate a failure */
ERROR = 'ERROR',
/** Informational messages about normal operations */
INFO = 'INFO',
/** Warning conditions that may require attention */
WARNING = 'WARNING'
}

/** Defines the order direction, either ascending or descending */
export enum OrderDirection {
asc = 'asc',
Expand Down Expand Up @@ -2968,6 +2985,8 @@ export enum PoolOrderBy {

export type Query = {
__typename?: 'Query';
/** Query execution logs emitted by the subgraph during indexing. Results are sorted by timestamp in descending order (newest first). */
_logs: Array<Log>;
/** Access to subgraph metadata */
_meta?: Maybe<Meta>;
bean?: Maybe<Bean>;
Expand Down Expand Up @@ -3007,6 +3026,17 @@ export type Query = {
};


export type QueryLogsArgs = {
first?: InputMaybe<Scalars['Int']['input']>;
from?: InputMaybe<Scalars['String']['input']>;
level?: InputMaybe<LogLevel>;
orderDirection?: InputMaybe<OrderDirection>;
search?: InputMaybe<Scalars['String']['input']>;
skip?: InputMaybe<Scalars['Int']['input']>;
to?: InputMaybe<Scalars['String']['input']>;
};


export type QueryMetaArgs = {
block?: InputMaybe<BlockHeight>;
};
Expand Down Expand Up @@ -4432,6 +4462,54 @@ export type Block = {
timestamp?: Maybe<Scalars['Int']['output']>;
};

/**
* A key-value pair of additional data associated with a log entry.
* These correspond to arguments passed to the log function in the subgraph code.
*/
export type LogArgument = {
__typename?: '_LogArgument_';
/** The parameter name */
key: Scalars['String']['output'];
/** The parameter value, serialized as a string */
value: Scalars['String']['output'];
};

/**
* Source code location metadata for a log entry.
* Indicates where in the subgraph's AssemblyScript code the log statement was executed.
*/
export type LogMeta = {
__typename?: '_LogMeta_';
/** The column number in the source file */
column: Scalars['Int']['output'];
/** The line number in the source file */
line: Scalars['Int']['output'];
/** The module or file path where the log was emitted */
module: Scalars['String']['output'];
};

/**
* A log entry emitted by a subgraph during indexing.
* Logs can be generated by the subgraph's AssemblyScript code using the `log.*` functions.
*/
export type Log = {
__typename?: '_Log_';
/** Additional structured data passed to the log function as key-value pairs */
arguments: Array<LogArgument>;
/** Unique identifier for this log entry */
id: Scalars['String']['output'];
/** The severity level of the log entry */
level: LogLevel;
/** Metadata about the source location in the subgraph code where the log was emitted */
meta: LogMeta;
/** The deployment hash of the subgraph that emitted this log */
subgraphId: Scalars['String']['output'];
/** The log message text */
text: Scalars['String']['output'];
/** The timestamp when the log was emitted, in RFC3339 format (e.g., '2024-01-15T10:30:00Z') */
timestamp: Scalars['String']['output'];
};

/** The type for the top-level _meta field */
export type Meta = {
__typename?: '_Meta_';
Expand Down
78 changes: 78 additions & 0 deletions src/generated/gql/pintostalk/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3074,6 +3074,23 @@ export enum GerminatingOrderBy {
type = 'type'
}

/**
* The severity level of a log entry.
* Log levels are ordered from most to least severe: CRITICAL > ERROR > WARNING > INFO > DEBUG
*/
export enum LogLevel {
/** Critical errors that require immediate attention */
CRITICAL = 'CRITICAL',
/** Detailed diagnostic information for debugging */
DEBUG = 'DEBUG',
/** Error conditions that indicate a failure */
ERROR = 'ERROR',
/** Informational messages about normal operations */
INFO = 'INFO',
/** Warning conditions that may require attention */
WARNING = 'WARNING'
}

export type MarketPerformanceSeasonal = {
__typename?: 'MarketPerformanceSeasonal';
/** Cumulative percentage change in value of each deposited non-bean token. It is possible for this value to appear out of sync with cumulativeUsdChange; it does not account for the number of these tokens deposited at the time of the value changing (only their ratios). Ordering according to silo.whitelistedTokens */
Expand Down Expand Up @@ -7023,6 +7040,8 @@ export enum PrevFarmerGerminatingEventOrderBy {

export type Query = {
__typename?: 'Query';
/** Query execution logs emitted by the subgraph during indexing. Results are sorted by timestamp in descending order (newest first). */
_logs: Array<Log>;
/** Access to subgraph metadata */
_meta?: Maybe<Meta>;
beanstalk?: Maybe<Beanstalk>;
Expand Down Expand Up @@ -7140,6 +7159,17 @@ export type Query = {
};


export type QueryLogsArgs = {
first?: InputMaybe<Scalars['Int']['input']>;
from?: InputMaybe<Scalars['String']['input']>;
level?: InputMaybe<LogLevel>;
orderDirection?: InputMaybe<OrderDirection>;
search?: InputMaybe<Scalars['String']['input']>;
skip?: InputMaybe<Scalars['Int']['input']>;
to?: InputMaybe<Scalars['String']['input']>;
};


export type QueryMetaArgs = {
block?: InputMaybe<BlockHeight>;
};
Expand Down Expand Up @@ -13954,6 +13984,54 @@ export type Block = {
timestamp?: Maybe<Scalars['Int']['output']>;
};

/**
* A key-value pair of additional data associated with a log entry.
* These correspond to arguments passed to the log function in the subgraph code.
*/
export type LogArgument = {
__typename?: '_LogArgument_';
/** The parameter name */
key: Scalars['String']['output'];
/** The parameter value, serialized as a string */
value: Scalars['String']['output'];
};

/**
* Source code location metadata for a log entry.
* Indicates where in the subgraph's AssemblyScript code the log statement was executed.
*/
export type LogMeta = {
__typename?: '_LogMeta_';
/** The column number in the source file */
column: Scalars['Int']['output'];
/** The line number in the source file */
line: Scalars['Int']['output'];
/** The module or file path where the log was emitted */
module: Scalars['String']['output'];
};

/**
* A log entry emitted by a subgraph during indexing.
* Logs can be generated by the subgraph's AssemblyScript code using the `log.*` functions.
*/
export type Log = {
__typename?: '_Log_';
/** Additional structured data passed to the log function as key-value pairs */
arguments: Array<LogArgument>;
/** Unique identifier for this log entry */
id: Scalars['String']['output'];
/** The severity level of the log entry */
level: LogLevel;
/** Metadata about the source location in the subgraph code where the log was emitted */
meta: LogMeta;
/** The deployment hash of the subgraph that emitted this log */
subgraphId: Scalars['String']['output'];
/** The log message text */
text: Scalars['String']['output'];
/** The timestamp when the log was emitted, in RFC3339 format (e.g., '2024-01-15T10:30:00Z') */
timestamp: Scalars['String']['output'];
};

/** The type for the top-level _meta field */
export type Meta = {
__typename?: '_Meta_';
Expand Down
11 changes: 6 additions & 5 deletions src/pages/SiloToken.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { useSiloData } from "@/state/useSiloData";
import { useSeason } from "@/state/useSunData";
import { useChainConstant } from "@/utils/chain";
import { formatter } from "@/utils/format";
import { getTotalDepositedUsd } from "@/utils/siloValue";
import { stringEq } from "@/utils/string";
import { getTokenIndex } from "@/utils/token";
import { SiloTokenData, Token, TokenDepositData } from "@/utils/types";
Expand Down Expand Up @@ -135,7 +136,7 @@ function SiloTokenInner({ siloToken }: { siloToken: Token }) {
{(!isMobile || (!currentAction && isMobile)) && (
<SiloTokenAbout
siloToken={siloToken}
price={siloToken.isMain ? priceData.price : poolPrice}
tokenUsdPrice={siloToken.isMain ? priceData.price : pool?.lpUsd}
siloData={siloData}
/>
)}
Expand Down Expand Up @@ -341,7 +342,7 @@ const UndepositedSiloTokenInfoHeader = ({ siloToken, farmerBalanceSiloTokenAmoun
};

interface ISiloTokenAbout extends IBaseSiloToken {
price: TokenValue;
tokenUsdPrice: TokenValue | undefined;
siloData: ReturnType<typeof useSiloData>;
}

Expand All @@ -350,7 +351,7 @@ type SiloBDVs = {
liquidityTVD: TokenValue;
};

const SiloTokenAbout = ({ siloToken, price, siloData }: ISiloTokenAbout) => {
const SiloTokenAbout = ({ siloToken, tokenUsdPrice, siloData }: ISiloTokenAbout) => {
const seedGauge = useSeedGauge();
const siloTokenData = siloData.tokenData.get(siloToken);
const denomination = useDenomination();
Expand Down Expand Up @@ -378,7 +379,7 @@ const SiloTokenAbout = ({ siloToken, price, siloData }: ISiloTokenAbout) => {
const liquidityRatio = depositedBDV?.div(liquidityTVD.gt(0) ? liquidityTVD : TokenValue.ONE).mul(100);
const optimalDepositedRatio = gaugeData?.optimalPctDepositedBdv;

const tvdUSD = depositedBDV?.mul(price);
const tvdUSD = getTotalDepositedUsd(siloTokenData, tokenUsdPrice);
const depositedRatio = depositedBDV?.div(siloTVD.gt(0) ? siloTVD : TokenValue.ONE).mul(100);

return (
Expand All @@ -390,7 +391,7 @@ const SiloTokenAbout = ({ siloToken, price, siloData }: ISiloTokenAbout) => {
<div>
<div className="pinto-sm-light font-thin sm:font-light text-pinto-secondary">Total Value Deposited</div>
<div className="pinto-body sm:pinto-h4 pt-1">
{denomination === "USD" ? formatter.usd(tvdUSD) : formatter.pdv(depositedBDV)}
{denomination === "USD" ? (tvdUSD ? formatter.usd(tvdUSD) : "-") : formatter.pdv(depositedBDV)}
</div>
</div>
<div>
Expand Down
Loading
Loading