### GENERIC TYPES *** """ Represents a collateral or debt position. """ type Position @entity { "User Ethereum address concatenated with token contract address" id: ID! "Token amount" amount: BigDecimal! "Token details" token: Token! } """ Represents a basic ERC20 token. """ type Token @entity { "Contract address" id: ID! "Token decimals" decimals: Int! "Token name" name: String! "Token symbol" symbol: String! } """ High-level overview. """ type Hifi @entity { "Always set to 1" id: ID! "Array of all listed bonds" listedBonds: [Token!]! "Array of all listed collaterals" listedCollaterals: [Token!]! "Array of all AMM pools" pools: [Pool!]! "Array of all user vaults" vaults: [Vault!]! } """ Stores the collaterals deposited by the user, along with the debts. """ type Vault @entity { "User Ethereum address" id: ID! "Collaterals deposited" collaterals: [Position!]! "Creation block timestamp" createTime: BigInt! "Debts owed by the vault owner" debts: [Position!]! } """ Stores the pool reserves, along with the swaps. """ type Pool @entity { "Pool contract address" id: ID! "HToken in pool" hToken: Token! "Pool reserve of hToken" hTokenReserve: BigDecimal! "The hToken maturity timestamp" maturity: BigInt! "Array of all pool trades" swaps: [Swap!]! @derivedFrom(field: "pool") "Underlying in pool" underlying: Token! "Pool reserve of underlying token" underlyingReserve: BigDecimal! } type Swap @entity { "Sequential id" id: ID! "Account that sends token being sold" from: Bytes! "hTokens swapped" hTokenAmount: BigDecimal! "Pool where swap occurred" pool: Pool! "Fee paid by user for swap (in underlying)" swapFee: BigDecimal! "Timestamp for when the swap happened" timestamp: BigInt! "Account that receives token being bought" to: Bytes! "Underlying tokens swapped" underlyingAmount: BigDecimal! }