aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/entities/token_order.ts
diff options
context:
space:
mode:
authorzkao <zichongkao@gmail.com>2018-12-05 05:21:46 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 06:25:42 +0800
commit87ffa5d7ab19d2288bf68131a7e7ec77578c564c (patch)
tree68bb07481756ba578a89303f33d5c0ce8656f3a4 /packages/pipeline/src/entities/token_order.ts
parent7198b441e0d85785eec7244dd60bcd92269d954e (diff)
downloaddexon-sol-tools-87ffa5d7ab19d2288bf68131a7e7ec77578c564c.tar
dexon-sol-tools-87ffa5d7ab19d2288bf68131a7e7ec77578c564c.tar.gz
dexon-sol-tools-87ffa5d7ab19d2288bf68131a7e7ec77578c564c.tar.bz2
dexon-sol-tools-87ffa5d7ab19d2288bf68131a7e7ec77578c564c.tar.lz
dexon-sol-tools-87ffa5d7ab19d2288bf68131a7e7ec77578c564c.tar.xz
dexon-sol-tools-87ffa5d7ab19d2288bf68131a7e7ec77578c564c.tar.zst
dexon-sol-tools-87ffa5d7ab19d2288bf68131a7e7ec77578c564c.zip
Token_orderbook_snapshots for Ddex and Paradex(#1354)
* Implements the TokenOrderbookSnapshot Table * Scripts, Data Sources and Entities to pull Ddex and Paradex API data.
Diffstat (limited to 'packages/pipeline/src/entities/token_order.ts')
-rw-r--r--packages/pipeline/src/entities/token_order.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/pipeline/src/entities/token_order.ts b/packages/pipeline/src/entities/token_order.ts
new file mode 100644
index 000000000..557705767
--- /dev/null
+++ b/packages/pipeline/src/entities/token_order.ts
@@ -0,0 +1,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;
+}