Skip to content

Instantly share code, notes, and snippets.

View adrake33's full-sized avatar

Aaron Drake adrake33

View GitHub Profile
// Should add logging for minPrice, maxPrice, numTicks, & outcome
interface ShareTokenBalances {
marketId: Address;
minPrice: BigNumber;
maxPrice: BigNumber;
numTicks: BigNumber;
owner: Address;
outcome: number;
balance: BigNumber | null;
// Probably not any additional logging needed for this, especially since the time range can vary
export interface AccountTimeRangeResult {
positions: number;
marketsCreated: number;
numberOfTrades: number;
successfulDisputes: number;
marketsTraded: number;
redeemedPositions: number;
}
// Should not require additional logginng
export interface CompleteSetsRow<BigNumberType> extends BaseTransactionRow {
marketId: Address; // CompleteSetsPurchased.market or CompleteSetsSold.market
account: Address; // CompleteSetsPurchased.account or CompleteSetsSold.account
universe: Address; // CompleteSetsPurchased.universe or CompleteSetsSold.universe
eventName: string; // "CompleteSetsPurchased" or "CompleteSetsSold"
numPurchasedOrSold: BigNumberType; // always same as `numCompleteSets`?
numCompleteSets: BigNumberType; // CompleteSetsPurchased.numCompleteSets or CompleteSetsSold.numCompleteSets
}
// Will require getting data from multiple event types, but not sure there's a better way to do this using different logs.
export interface MarketWinnings {
marketId: Address;
winnings: BigNumber;
}
// Should add logging for `marketId`, `tokensEscrowed`, & `sharesEscrowed`?
export interface AllOrdersRow<BigNumberType> {
orderId: Address; // OrderCreated.orderId
originalTokensEscrowed: BigNumberType; // OrderCreated.moneyEscrowed
originalSharesEscrowed: BigNumberType; // OrderCreated.sharesEscrowed
tokensEscrowed: BigNumberType;
sharesEscrowed: BigNumberType;
marketId: Address;
}
// Should probably add `symbol`, `outcome`, `isInternalTransfer` to Transfer logs
export interface TransferRow<BigNumberType> {
transactionHash: Bytes32;
logIndex: number;
blockNumber: number;
blockHash: string;
timestamp: number;
sender: Address; // TokensTransferred.from
recipient: Address; // TokensTransferred.to
// May need to log some of these, such as details, fee, marketDescription, outcome, outcome description, price, quantity, & total
export interface UIAccountTransactionHistoryRow<BigNumberType> {
action: Action;
coin: string;
details: string;
fee: BigNumberType;
marketDescription: string;
outcome: number;
outcomeDescription: string;
// All of this info should already be accessible
export interface UISyncData {
version: string;
augurNodeVersion: string;
net_version: string;
netId: string;
isSyncFinished: boolean;
addresses: {};
highestBlock: {};
// Seems like we can obtain these with the logs we have. Not sure if we could add any new logs to facilitate calculating these totals?
export interface PlatformActivityResult {
activeUsers: BigNumber;
numberOfTrades: BigNumber;
openInterest: BigNumber;
marketsCreated: BigNumber;
volume: BigNumber;
amountStaked: BigNumber;
disputedMarkets: BigNumber;
// Is `repTotal` just calculated using TokensMinted events?
interface ForkMigrationTotals<BigNumberType> {
isInvalid: boolean; // UniverseCreated.payoutNumerators
payout: Array<number>; // UniverseCreated.payoutNumerators
repTotal: BigNumberType;
universe: string; // UniverseCreated.childUniverse
}
interface UIForkMigrationTotals<BigNumberType> {