sushiswap-watcher-ts/packages/sushiswap-watcher/src/entity/LiquidityPositionSnapshot.ts
Prathamesh Musale a5d88324df Generate watcher for sushiswap subgraph (#4)
Part of [Generate watchers for sushiswap subgraphs deployed in graph-node](https://www.notion.so/Generate-watchers-for-sushiswap-subgraphs-deployed-in-graph-node-b3f2e475373d4ab1887d9f8720bd5ae6)

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Reviewed-on: cerc-io/sushiswap-watcher-ts#4
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-06-12 04:49:33 +00:00

63 lines
1.4 KiB
TypeScript

//
// Copyright 2021 Vulcanize, Inc.
//
import { Entity, PrimaryColumn, Column, Index } from 'typeorm';
import { decimalTransformer, bigintTransformer } from '@cerc-io/util';
import { Decimal } from 'decimal.js';
@Entity()
@Index(['blockNumber'])
export class LiquidityPositionSnapshot {
@PrimaryColumn('varchar')
id!: string;
@PrimaryColumn('varchar', { length: 66 })
blockHash!: string;
@Column('integer')
blockNumber!: number;
@Column('varchar')
liquidityPosition!: string;
@Column('integer')
timestamp!: number;
@Column('integer')
block!: number;
@Column('varchar')
user!: string;
@Column('varchar')
pair!: string;
@Column('numeric', { transformer: decimalTransformer })
token0PriceUSD!: Decimal;
@Column('numeric', { transformer: decimalTransformer })
token1PriceUSD!: Decimal;
@Column('numeric', { transformer: bigintTransformer })
reserve0!: bigint;
@Column('numeric', { transformer: bigintTransformer })
reserve1!: bigint;
@Column('numeric', { transformer: decimalTransformer })
reserveUSD!: Decimal;
@Column('numeric', { transformer: bigintTransformer })
liquidityTokenTotalSupply!: bigint;
@Column('numeric', { transformer: bigintTransformer })
liquidityTokenBalance!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean;
@Column('boolean', { default: false })
isRemoved!: boolean;
}