Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add receivedAmount in Order struct #685

Open
hilmarx opened this issue Apr 22, 2020 · 0 comments
Open

Add receivedAmount in Order struct #685

hilmarx opened this issue Apr 22, 2020 · 0 comments

Comments

@hilmarx
Copy link

hilmarx commented Apr 22, 2020

For some use cases, it would be quite helpful to know on-chain how many buyTokens were received from a given order, as the Order Struct currently only stores the usedAmount.

Maybe something like that:

struct Order {
        uint16 buyToken;
        uint16 sellToken;
        uint32 validFrom; // order is valid from auction collection period: validFrom inclusive
        uint32 validUntil; // order is valid till auction collection period: validUntil inclusive
        uint128 priceNumerator;
        uint128 priceDenominator;
        uint128 usedAmount; // remainingAmount = priceDenominator - usedAmount
        uint128 receivedAmount; 
}

An example of such use case would be if someone would like to know on-chain how much of the buyTokens were sold and hence can safely be requested to be withdrawn at a later time without potentially overriding another concurrent order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant