aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities/token_order.ts
blob: 5577057671848247e5b9425a9250b318ae9116e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { BigNumber } from '@0x/utils';
import { Column, Entity, PrimaryColumn } from 'typeorm';

import { OrderType } from '../types';
import { bigNumberTransformer, numberToBigIntTransformer } from '../utils';

@Entity({ name: 'token_orderbook_snapshots', schema: 'raw' })
export class TokenOrderbookSnapshot {
    @PrimaryColumn({ name: 'observed_timestamp', type: 'bigint', transformer: numberToBigIntTransformer })
    public observedTimestamp!: number;
    @PrimaryColumn({ name: 'source' })
    public source!: string;
    @Column({ name: 'order_type' })
    public orderType!: OrderType;
    @PrimaryColumn({ name: 'price', type: 'numeric', transformer: bigNumberTransformer })
    public price!: BigNumber;
    @PrimaryColumn({ name: 'base_asset_symbol' })
    public baseAssetSymbol!: string;
    @Column({ name: 'base_asset_address' })
    public baseAssetAddress!: string;
    @Column({ name: 'base_volume', type: 'numeric', transformer: bigNumberTransformer })
    public baseVolume!: BigNumber;
    @PrimaryColumn({ name: 'quote_asset_symbol' })
    public quoteAssetSymbol!: string;
    @Column({ name: 'quote_asset_address' })
    public quoteAssetAddress!: string;
    @Column({ name: 'quote_volume', type: 'numeric', transformer: bigNumberTransformer })
    public quoteVolume!: BigNumber;
}