-
Notifications
You must be signed in to change notification settings - Fork 63
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
Meta Calculator: implementation of bulk get_dy and get_dx #15
base: meta-calc
Are you sure you want to change the base?
Changes from all commits
7b22f70
3910a45
f9eb6ac
3c692a8
4fea903
3c7e359
d01102f
9e55442
4bc35a4
75d92ae
988bf07
9684a2d
9be9cf3
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ symbol: public(String[32]) | |
decimals: public(uint256) | ||
balanceOf: public(HashMap[address, uint256]) | ||
allowances: HashMap[address, HashMap[address, uint256]] | ||
total_supply: uint256 | ||
total_supply: public(uint256) | ||
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. You actually don't need this public because |
||
|
||
|
||
@external | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,12 @@ def get_dy(i: int128, j: int128, dx: uint256) -> uint256: | |
return self._get_dy(self.coin_list[i], self.coin_list[j], dx) | ||
|
||
|
||
@external | ||
@view | ||
def A_precise() -> uint256: | ||
return self.A | ||
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. Actually, in real pools |
||
|
||
|
||
@external | ||
@view | ||
def get_dy_underlying(i: int128, j: int128, dx: uint256) -> uint256: | ||
|
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.
Changed
INPUT_SIZE
to80
as the contract size was exceeding the bytecode size limit. Was there a particular reason for setting it to100
?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.
Just some number. Doesn't matter how big it is I think as long as it fits, but should be big enough. That's for DEX aggregators to do this on-chain (where INPUT_SIZE is the maximum they do)