Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update types #255

Merged
merged 1 commit into from
Jan 27, 2025
Merged
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
161 changes: 112 additions & 49 deletions packages/blue-api-sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,25 @@ export type CollateralAtRiskDataPoint = {
collateralUsd: Scalars["Float"]["output"];
};

/** Custom Warning Metadata */
export type CustomMetadata = {
__typename?: "CustomMetadata";
content: Maybe<Scalars["String"]["output"]>;
};

export type FloatDataPoint = {
__typename?: "FloatDataPoint";
x: Scalars["Float"]["output"];
y: Maybe<Scalars["Float"]["output"]>;
};

/** Hardcoded Price Metadata */
export type HardcodedPriceMetadata = {
__typename?: "HardcodedPriceMetadata";
symbolFrom: Maybe<Scalars["String"]["output"]>;
symbolTo: Maybe<Scalars["String"]["output"]>;
};

/** IRM curve data point */
export type IrmCurveDataPoint = {
__typename?: "IRMCurveDataPoint";
Expand Down Expand Up @@ -796,19 +809,13 @@ export type MarketPosition = {
collateralUsd: Maybe<Scalars["Float"]["output"]>;
/** Health factor of the position, computed as collateral value divided by borrow value. */
healthFactor: Maybe<Scalars["Float"]["output"]>;
/**
* State history
* @deprecated Not indexed yet.
*/
/** State history */
historicalState: Maybe<MarketPositionHistory>;
id: Scalars["ID"]["output"];
market: Market;
/** Price variation required for the given position to reach its liquidation threshold (scaled by WAD) */
priceVariationToLiquidationPrice: Maybe<Scalars["Float"]["output"]>;
/**
* Current state
* @deprecated Not indexed yet.
*/
/** Current state */
state: Maybe<MarketPositionState>;
/** Amount of loan asset supplied, in underlying token units. */
supplyAssets: Scalars["BigInt"]["output"];
Expand Down Expand Up @@ -855,16 +862,24 @@ export type MarketPositionHistory = {
__typename?: "MarketPositionHistory";
/** Borrow assets history. */
borrowAssets: Maybe<Array<BigIntDataPoint>>;
/** Borrow assets history, in USD. */
borrowAssetsUsd: Maybe<Array<FloatDataPoint>>;
/** Borrow shares history. */
borrowShares: Maybe<Array<BigIntDataPoint>>;
/** Collateral history. */
collateral: Maybe<Array<BigIntDataPoint>>;
/** Collateral value history, in USD. */
collateralUsd: Maybe<Array<FloatDataPoint>>;
/** Collateral value history, in loan assets. */
collateralValue: Maybe<Array<BigIntDataPoint>>;
/** Profit (from the collateral's price variation) & Loss (from the loan interest) history, in loan assets. */
pnl: Maybe<Array<BigIntDataPoint>>;
/** Profit (from the collateral's price variation) & Loss (from the loan interest) history, in USD for display purposes. */
pnlUsd: Maybe<Array<FloatDataPoint>>;
/** Supply assets history. */
supplyAssets: Maybe<Array<BigIntDataPoint>>;
/** Supply assets history, in USD. */
supplyAssetsUsd: Maybe<Array<FloatDataPoint>>;
/** Supply shares history. */
supplyShares: Maybe<Array<BigIntDataPoint>>;
};
Expand All @@ -874,6 +889,11 @@ export type MarketPositionHistoryBorrowAssetsArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Market position state history */
export type MarketPositionHistoryBorrowAssetsUsdArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Market position state history */
export type MarketPositionHistoryBorrowSharesArgs = {
options?: InputMaybe<TimeseriesOptions>;
Expand All @@ -884,6 +904,16 @@ export type MarketPositionHistoryCollateralArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Market position state history */
export type MarketPositionHistoryCollateralUsdArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Market position state history */
export type MarketPositionHistoryCollateralValueArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Market position state history */
export type MarketPositionHistoryPnlArgs = {
options?: InputMaybe<TimeseriesOptions>;
Expand All @@ -899,6 +929,11 @@ export type MarketPositionHistorySupplyAssetsArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Market position state history */
export type MarketPositionHistorySupplyAssetsUsdArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Market position state history */
export type MarketPositionHistorySupplySharesArgs = {
options?: InputMaybe<TimeseriesOptions>;
Expand All @@ -914,29 +949,31 @@ export enum MarketPositionOrderBy {
/** Market position state */
export type MarketPositionState = {
__typename?: "MarketPositionState";
/** The last borrow assets used to update the position's P&L. */
borrowAssets: Scalars["BigInt"]["output"];
/** The last borrow shares used to update the position's P&L. */
/** The latest borrow assets indexed for this position. */
borrowAssets: Maybe<Scalars["BigInt"]["output"]>;
/** The latest borrow assets indexed for this position, in USD. */
borrowAssetsUsd: Maybe<Scalars["Float"]["output"]>;
/** The latest borrow shares indexed for this position. */
borrowShares: Scalars["BigInt"]["output"];
/** The last collateral assets used to update the position's P&L. */
/** The latest collateral assets indexed for this position. */
collateral: Scalars["BigInt"]["output"];
/** The last collateral asset USD price used to update the position's P&L in USD. */
collateralAssetUsdPrice: Maybe<Scalars["Float"]["output"]>;
/** The last collateral price used to update the position's P&L. */
collateralPrice: Scalars["BigInt"]["output"];
/** The latest collateral assets indexed for this position, in USD. */
collateralUsd: Maybe<Scalars["Float"]["output"]>;
/** The latest collateral assets indexed for this position, in loan assets. */
collateralValue: Maybe<Scalars["BigInt"]["output"]>;
id: Scalars["ID"]["output"];
/** The last loan asset USD price used to update the position's P&L in USD. */
loanAssetUsdPrice: Maybe<Scalars["Float"]["output"]>;
/** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in loan assets. */
pnl: Scalars["BigInt"]["output"];
/** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in USD for display purpose */
pnl: Maybe<Scalars["BigInt"]["output"]>;
/** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in USD for display purpose. */
pnlUsd: Maybe<Scalars["Float"]["output"]>;
position: MarketPosition;
/** The last supply assets used to update the position's P&L. */
supplyAssets: Scalars["BigInt"]["output"];
/** The last supply shares used to update the position's P&L. */
/** The latest supply assets indexed for this position. */
supplyAssets: Maybe<Scalars["BigInt"]["output"]>;
/** The latest supply assets indexed for this position, in USD. */
supplyAssetsUsd: Maybe<Scalars["Float"]["output"]>;
/** The latest supply shares indexed for this position. */
supplyShares: Scalars["BigInt"]["output"];
/** Last update timestamp. */
/** The latest update timestamp. */
timestamp: Scalars["BigInt"]["output"];
};

Expand Down Expand Up @@ -1084,9 +1121,12 @@ export type MarketTransferTransactionData = {
export type MarketWarning = {
__typename?: "MarketWarning";
level: WarningLevel;
metadata: Maybe<MarketWarningMetadata>;
type: Scalars["String"]["output"];
};

export type MarketWarningMetadata = CustomMetadata | HardcodedPriceMetadata;

/** Morpho Blue deployment */
export type MorphoBlue = {
__typename?: "MorphoBlue";
Expand Down Expand Up @@ -1310,6 +1350,12 @@ export type PaginatedMarkets = {
pageInfo: Maybe<PageInfo>;
};

export type PaginatedMetaMorphoFactories = {
__typename?: "PaginatedMetaMorphoFactories";
items: Maybe<Array<VaultFactory>>;
pageInfo: Maybe<PageInfo>;
};

export type PaginatedMetaMorphoPositions = {
__typename?: "PaginatedMetaMorphoPositions";
items: Maybe<Array<VaultPosition>>;
Expand Down Expand Up @@ -1509,6 +1555,9 @@ export type Query = {
users: PaginatedUsers;
vault: Vault;
vaultByAddress: Vault;
vaultFactories: PaginatedMetaMorphoFactories;
vaultFactory: VaultFactory;
vaultFactoryByAddress: VaultFactory;
vaultPosition: VaultPosition;
vaultPositions: PaginatedMetaMorphoPositions;
vaultReallocates: PaginatedVaultReallocates;
Expand Down Expand Up @@ -1700,6 +1749,15 @@ export type QueryVaultByAddressArgs = {
chainId?: InputMaybe<Scalars["Int"]["input"]>;
};

export type QueryVaultFactoryArgs = {
id: Scalars["String"]["input"];
};

export type QueryVaultFactoryByAddressArgs = {
address: Scalars["String"]["input"];
chainId?: InputMaybe<Scalars["Int"]["input"]>;
};

export type QueryVaultPositionArgs = {
chainId?: InputMaybe<Scalars["Int"]["input"]>;
userAddress: Scalars["String"]["input"];
Expand Down Expand Up @@ -1790,8 +1848,7 @@ export type TransactionData =
| MarketCollateralTransferTransactionData
| MarketLiquidationTransactionData
| MarketTransferTransactionData
| VaultTransactionData
| VaultTransferTransactionData;
| VaultTransactionData;

/** Filtering options for transactions. AND operator is used for multiple filters, while OR operator is used for multiple values in the same filter. */
export type TransactionFilters = {
Expand Down Expand Up @@ -1990,6 +2047,7 @@ export type Vault = {
dailyApy: Maybe<Scalars["Float"]["output"]>;
/** Daily vault APYs */
dailyApys: Maybe<VaultApyAggregates>;
factory: VaultFactory;
historicalState: VaultHistory;
id: Scalars["ID"]["output"];
/** Vault liquidity */
Expand Down Expand Up @@ -2106,6 +2164,15 @@ export type VaultApyAggregates = {
netApy: Maybe<Scalars["Float"]["output"]>;
};

/** MetaMorpho Vault Factories */
export type VaultFactory = {
__typename?: "VaultFactory";
address: Scalars["Address"]["output"];
chain: Chain;
creationBlockNumber: Scalars["Int"]["output"];
id: Scalars["ID"]["output"];
};

export type VaultFilters = {
/** Filter by MetaMorpho vault address */
address_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
Expand Down Expand Up @@ -2134,6 +2201,8 @@ export type VaultFilters = {
credoraRiskScore_lte?: InputMaybe<Scalars["Float"]["input"]>;
/** Filter by MetaMorpho current curator address */
curatorAddress_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
/** Filter by MetaMorphoFactory address */
factoryAddress_in?: InputMaybe<Array<Scalars["String"]["input"]>>;
/** Filter by greater than or equal to given fee rate. */
fee_gte?: InputMaybe<Scalars["Float"]["input"]>;
/** Filter by lower than or equal to given fee rate. */
Expand Down Expand Up @@ -2418,18 +2487,12 @@ export type VaultPosition = {
assets: Scalars["BigInt"]["output"];
/** Value of vault shares held, in USD for display purpose. */
assetsUsd: Maybe<Scalars["Float"]["output"]>;
/**
* State history
* @deprecated Not indexed yet.
*/
/** State history */
historicalState: Maybe<VaultPositionHistory>;
id: Scalars["ID"]["output"];
/** Amount of vault shares */
shares: Scalars["BigInt"]["output"];
/**
* Current state
* @deprecated Not indexed yet.
*/
/** Current state */
state: Maybe<VaultPositionState>;
user: User;
vault: Vault;
Expand Down Expand Up @@ -2459,6 +2522,8 @@ export type VaultPositionHistory = {
__typename?: "VaultPositionHistory";
/** Value of the position since its inception, in underlying assets. */
assets: Maybe<Array<BigIntDataPoint>>;
/** Value of the position since its inception, in USD. */
assetsUsd: Maybe<Array<FloatDataPoint>>;
/** Profit (from the underlying asset's price variation) & Loss (from bad debt socialization) of the position since its inception, in underlying assets. */
pnl: Maybe<Array<BigIntDataPoint>>;
/** Profit (from the underlying asset's price variation) & Loss (from bad debt socialization) of the position since its inception, in USD for display purposes. */
Expand All @@ -2472,6 +2537,11 @@ export type VaultPositionHistoryAssetsArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Vault position state history */
export type VaultPositionHistoryAssetsUsdArgs = {
options?: InputMaybe<TimeseriesOptions>;
};

/** Vault position state history */
export type VaultPositionHistoryPnlArgs = {
options?: InputMaybe<TimeseriesOptions>;
Expand All @@ -2494,19 +2564,19 @@ export enum VaultPositionOrderBy {
/** Vault position state */
export type VaultPositionState = {
__typename?: "VaultPositionState";
/** The last asset USD price used to update the position's P&L in USD. */
assetUsdPrice: Maybe<Scalars["Float"]["output"]>;
/** The latest supply assets indexed for this position. */
assets: Maybe<Scalars["BigInt"]["output"]>;
/** The latest supply assets indexed for this position, in USD. */
assetsUsd: Maybe<Scalars["Float"]["output"]>;
id: Scalars["ID"]["output"];
/** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in loan assets. */
pnl: Scalars["BigInt"]["output"];
pnl: Maybe<Scalars["BigInt"]["output"]>;
/** Profit (from the collateral's price variation) & Loss (from the loan interest) of the position since its inception, in USD for display purpose */
pnlUsd: Maybe<Scalars["Float"]["output"]>;
position: VaultPosition;
/** The last supply assets used to update the position's P&L. */
supplyAssets: Scalars["BigInt"]["output"];
/** The last supply shares used to update the position's P&L. */
supplyShares: Scalars["BigInt"]["output"];
/** Last update timestamp. */
/** The latest supply shares indexed for this position. */
shares: Scalars["BigInt"]["output"];
/** The latest update timestamp. */
timestamp: Scalars["BigInt"]["output"];
};

Expand Down Expand Up @@ -2664,13 +2734,6 @@ export type VaultTransactionData = {
vault: Vault;
};

/** Meta Morpho vault transfer transaction data */
export type VaultTransferTransactionData = {
__typename?: "VaultTransferTransactionData";
shares: Scalars["BigInt"]["output"];
vault: Vault;
};

/** Vault warning */
export type VaultWarning = {
__typename?: "VaultWarning";
Expand Down
Loading