question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Implement getAccountTransactionHistory getter

See original GitHub issue

Currently in the UI, we are collecting user transactions over 4-5 endpoints, we need to consolidate this data into one new augur-node endpoint. This will allow Ui to clean up a lot of logic.

Input params:

  • universe - universe in which to query for transactions
  • account - user account address for which to find transactions
  • earliestTransactionTime - earliest timestamp to filter by
  • latestTransactionTime -latest timestamp to filter by
  • coin - currency used in transactions (can be “ETH”, “REP”, or “ALL”)
  • action - type of transactions to get (can be “BUY”, “SELL”, “CANCEL”, “CLAIM_MARKET_CREATOR_FEES”, “CLAIM_PARTICIPATION_TOKENS”, “CLAIM_TRADING_PROCEEDS”, “CLAIM_WINNING_CROWDSOURCERS”, “DISPUTE”, INITIAL_REPORT", “MARKET_CREATION”, “COMPLETE_SETS”, or “ALL”)
  • standard sort parameters, such as sortBy, isSortDescending, limit, & offset

Output params:

  • action: string
  • coin: string
  • details: string
  • fee: string
  • marketDescription: string
  • outcome: number
  • outcomeDescription: string
  • price: string
  • quantity: string
  • timestamp: number
  • total: string
  • transactionHash: string

Transaction types:

Action: Buy - queries the trades table for orders where the user created a buy order that got filled. * Price: trades.price * Quantity: trades.amount * Fees: trades.reporterFees + trades.marketCreatorFees * Total Revenue: trades.amount * (markets.maxPrice - trades.price)

Action: Sell - queries the trades table for orders where the user created a sell order that got filled. * Price: trades.price * Quantity: trades.amount * Fees: trades.reporterFees + trades.marketCreatorFees * Total Revenue: trades.amount * trades.price

Action: Canceled - queries the orders_canceled table for the user’s canceled orders. * Price: orders.price * Quantity: orders.amount * Fees: 0 * Total Revenue: 0

Action: Claim - queries crowdsourcer_redeemed, participation_token_redeemed, & trading proceeds tables. (Queries for claiming from market creator mailbox will be done in a separate ticket since this requires new AN code.) Crowdsourcer (REP): * Price: 0 * Quantity: 0 * Fees: 0 * Total Revenue: crowdsourcer_redeemed.repReceived Crowdsourcer (ETH): * Price: 0 * Quantity: 0 * Fees: 0 * Total Revenue: crowdsourcer_redeemed.reportingFeesReceived Participation Token: * Price: 0 * Quantity: 0 * Fees: 0 * Total Revenue: participation_token_redeemed.reportingFeesReceived Trading Proceeds: * Price: outcomes.price * Quantity: trading_proceeds.numShares * Fees: (trading_proceeds.numShares * outcomes.price) - trading_proceeds.numPayoutTokens * Total Revenue: trading_proceeds.numPayoutTokens Do we also need to show the REP amount redeemed for crowdsourcers & participation tokens, or just the profits?

Action: Dispute - queries disputes table for any dispute transactions where user is the reporter. * Price: 0 * Quantity: disputes.amountStaked * Fees: 0 * Total Revenue: 0

Action: Initial Report - queries initial_reports table for any initial reports where user is the reporter. * Price: 0 * Quantity: initial_reports.amountStaked * Fees: 0 * Total Revenue: 0

Action: Market Finalization - would require additional AN code. Not a high priority, so probably will be done only for v2.

Action: Market Creation - queries markets table for all markets where user is marketCreator. (Only returns ETH validity bond txs; does not return no-show REP bond txs since this info is not in the logs.) * Price: 0 * Quantity: 0 * Fees: markets.creationFee * Total Revenue: 0

Action: Complete Sets - queries completeSets table where account is user. Buying: * Price: markets.numTicks * Quantity: completeSets.numCompleteSets * Fees: 0 * Total Revenue: 0 Selling: * Price: markets.numTicks * Quantity: completeSets.numCompleteSets * Fees: (reporting fee rate * price * quantity) + (creator fee rate * price * quantity) * Total Revenue: (completeSets.numCompleteSets * markets.numTicks) - fees

We also need pagination like the other getters. This response from this getter will populate this transactions modal:

unknown.png

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pgebheimcommented, Mar 5, 2019

I’ll tackle this this week!

0reactions
adrake33commented, Mar 21, 2019

@Chwy5 I discussed the participation token txs with Alex, and he said we don’t have a good way to get the buy participation token txs from the DB right now, and they aren’t necessary for tax purposes anyway, so I’ll leave those out. For the claim participation token txs, he said the cost basis should be 0, and the total should just be the reporting fees the user got.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Complete Tutorial Ep. 20 - Getters & Setters + Bank ...
In this episode of the Java Tutorial, I take the time to show you how to use the generate tool in IntelliJ IDEA...
Read more >
Use Getters and Setters to Modify Data - Salesforce Developers
It's a best practice to annotate the getter. To hold the property value inside the getter and setter, use a field. This example...
Read more >
Java banking app with polymorphism, getter getting null
What I'm trying to do is to have a banking app where I should have SavingsAccount and CreditAccount that should inherit from Account...
Read more >
Getters and Setters Methods in Java - CodeGym
First, we use a getter to get and display the cat's original name. Then, we use a setter to assign a new name...
Read more >
Property getters and setters - The Modern JavaScript Tutorial
Accessor properties are represented by “getter” and “setter” methods. In an object literal they are denoted by get and set :.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found