-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fix parsing of input and return empty solution #25
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -278,6 +278,7 @@ class AmmKindEnum(str, Enum): | |
CONSTANT_PRODUCT = "ConstantProduct" | ||
WEIGHTED_PRODUCT = "WeightedProduct" | ||
STABLE = "Stable" | ||
CONCENTRATED = "Concentrated" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it already parsed into something? If not, this should be added at some point, see #19 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Univ3 is not supported here, and I think it's a bit out of scope, at least for now. |
||
|
||
|
||
class ConstantProductReservesModel(BigInt): | ||
|
@@ -295,10 +296,12 @@ class AmmModel(BaseModel): | |
"""AMM data.""" | ||
|
||
kind: AmmKindEnum = Field(..., description="AMM type.") | ||
reserves: Dict[ | ||
TokenId, Union[ConstantProductReservesModel, WeightedProductReservesModel] | ||
] = Field(..., description="AMM tokens and balances.") | ||
fee: Decimal = Field(..., description="AMM trading fee (e.g. 0.003 for 0.3% fee).") | ||
reserves: Optional[ | ||
Dict[TokenId, Union[ConstantProductReservesModel, WeightedProductReservesModel]] | ||
] = Field(None, description="AMM tokens and balances.") | ||
fee: Optional[Decimal] = Field( | ||
None, description="AMM trading fee (e.g. 0.003 for 0.3% fee)." | ||
) | ||
cost: Optional[TokenAmountModel] = Field( | ||
None, description="Cost of using the pool." | ||
) | ||
|
@@ -383,11 +386,6 @@ class InteractionData(BaseModel): | |
class SettledBatchAuctionModel(BaseModel): | ||
"""Settled batch auction data (solution).""" | ||
|
||
ref_token: TokenId = Field( | ||
..., | ||
description="Token used for price vector normalization in case price " | ||
"vector is normalized.", | ||
) | ||
orders: Dict[OrderId, ExecutedOrderModel] = Field( | ||
..., description="Executed orders." | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for the workshop. Later on it might be useful to have an example solution which follows the correct format