Skip to content

Instantly share code, notes, and snippets.

@adrake33
Last active March 18, 2019 00:13
Show Gist options
  • Save adrake33/d192651a004684cfcd8d347bc5a9bff6 to your computer and use it in GitHub Desktop.
Save adrake33/d192651a004684cfcd8d347bc5a9bff6 to your computer and use it in GitHub Desktop.
// Should updates to a user's trading positions in a specific market be emitted as an event?
export interface GetTradingPositionsResult {
averagePrice: string,
cost: string,
marketId: Address,
netPosition: string,
numEscrowed: string,
outcome: number,
position: string,
realized: string,
timestamp: number,
total: string,
totalPosition: string,
unrealized: string
}
export interface GetTradingPositionsResults {
Array: GetTradingPositionsResult
}
@nuevoalex
Copy link

We will have this data from the OrderFilled logs except for the unrealized profit which will need to look at the last price of the outcome. I think it would be nice to add a new log for outcome price so that no logic is needed for when a market finalizes and the payout for that outcome should be used.

The latest OrderFilled log for a give account/market/outcome is what should be used.

@adrake33
Copy link
Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment