Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Conversation

@jmoreira-valory
Copy link
Collaborator

@jmoreira-valory jmoreira-valory commented Aug 29, 2023

Added check for redeemed markets in trades.py script.

It should display information in this format:

------
Trades
------
Market:   https://aiomen.eth.limo/#/0xf29a2ce76935ba79caafd80bf48a56f32d679328
Question: Will the temperature in rome surpass 46 degrees celsius on 9 August 2023? [test question]
Bought:   0.1000 DAI for 0.2340 DAI 'yes' tokens
Fee:      0.0030 DAI
Earnings: 0.2340 DAI
Redeemed: True

Market:   https://aiomen.eth.limo/#/0xee4f1a5c61a6fbac9d11e237701606ee5ff78603
Question: Will the popularity of cold soups increase in New York City during the summer of 2023?
Bought:   0.0600 DAI for 0.0594 DAI 'Yes' tokens
Fee:      0.0006 DAI
Market not yet finalized.

-------
Summary
-------
Num. trades: 1 (0 pending finalization)
Invested:    0.1600 DAI
Fees:        0.0036 DAI
Earnings:    0.2340 DAI (net earnings 0.0704 DAI)
Redeemed:    0.2340 DAI

@DavidMinarsch
Copy link
Contributor

Invested: 0.1600 DAI
Fees: 0.0036 DAI
Earnings: 0.2340 DAI (net earnings 0.1310 DAI)

Should net not be 0.2340 - 0.1600 - 0.0036 = 0.0704?

position_condition_ids = position["position"]["conditionIds"]
balance = int(position["balance"])

if condition_id in position_condition_ids and balance == 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

balance == 0 won't match the trader's behaviour in case the remaining balance is dust.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if balance > 0 --> It has not been redeemed (regardless it's dust or not)
if balance == 0 --> It has been redeemed

@jmoreira-valory
Copy link
Collaborator Author

Invested: 0.1600 DAI
Fees: 0.0036 DAI
Earnings: 0.2340 DAI (net earnings 0.1310 DAI)

Should net not be 0.2340 - 0.1600 - 0.0036 = 0.0704?

@DavidMinarsch Yes, I just inserted an additional transaction manually as an example and didn't edit the numbers correctly.

@DavidMinarsch DavidMinarsch merged commit 029b66a into main Aug 29, 2023
@DavidMinarsch DavidMinarsch deleted the feat/improved-summary-script branch August 29, 2023 12:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants