-
Notifications
You must be signed in to change notification settings - Fork 165
Builder based API for simulator crate
#4372
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
Open
MartinquaXD
wants to merge
90
commits into
main
Choose a base branch
from
new-api-simulator-crate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
ab8357b
initial commit
MartinquaXD 76b12c6
fixup
MartinquaXD d410031
fixup
MartinquaXD 417c9a0
introduce Solver enum
MartinquaXD 19926d9
factory
MartinquaXD 9731a30
Only allow list specific solver address
MartinquaXD 0f03c74
add function for funding settlement contract
MartinquaXD afedc26
add executed amounts
MartinquaXD db932ac
Move flashloan router address into simulator thingy
MartinquaXD 258539b
fixup
MartinquaXD 969ffee
simulate(), handle fillable amounts
MartinquaXD ae91cf6
Better handling of block target and executed amount
MartinquaXD 2ccedbb
Move encoding logic into separate file
MartinquaXD c1a0fe2
move code around
MartinquaXD 36d46aa
store chain_id and convert to tenderly request
MartinquaXD 9259b06
current block watcher in simulator
MartinquaXD fb58a25
more fixes
MartinquaXD 8a0cd78
fmt
MartinquaXD dcdd986
more fixes
MartinquaXD 6ecd600
correct tenderly block
MartinquaXD 93a8dda
comment for idea
MartinquaXD 5c1f7c3
extract wrappers from appdata
MartinquaXD 3f33170
Populate properties from appdata
MartinquaXD 7d0253a
.context() instead of unwrap()
MartinquaXD 764d3e7
fix tests
MartinquaXD 934da39
remove test log
MartinquaXD 67d7a8a
Merge branch 'main' into new-api-simulator-crate
squadgazzz c1aabeb
more functionality needed for trade verification
MartinquaXD 29c2254
remove need for native token address in trade verification
MartinquaXD 9aec495
Nicer API for handling state overrides
MartinquaXD 0a092dc
build final state overrides in separate function
MartinquaXD ba042f0
claude suggested changes
MartinquaXD bfc5627
use `SettlementSimulator` in trade verification
MartinquaXD ff58e63
Remove old code
MartinquaXD 104b759
assemble state overrides via simulator crate
MartinquaXD 12dead3
best effort override resolution
MartinquaXD aad3997
Remove customize functionality
MartinquaXD 56b020b
Support multiple orders
MartinquaXD 4dd3628
nicer API
MartinquaXD a0c3bcc
nits
MartinquaXD 1de44d9
api improvements
MartinquaXD 2afaf88
2 price vector entries per order
MartinquaXD 439d719
move gas_limit into settlement simulator
MartinquaXD 0929b38
Merge branch 'main' into new-api-simulator-crate
MartinquaXD 29ed574
sort dependencies
MartinquaXD 543d466
fix lints
MartinquaXD e24104d
Keep error reporting consistent
MartinquaXD 6ff31cb
fix other failing e2e test
MartinquaXD 42be284
Merge remote-tracking branch 'origin/main' into new-api-simulator-crate
MartinquaXD bd726e5
Pipe contract addresses around
MartinquaXD 2b87af2
add link for storage slot encoding
MartinquaXD bf12ca8
`.unwrap()` -> `.expect()`
MartinquaXD 2010b59
replace unreachable with error log
MartinquaXD 68bdd8d
Move new encoding logic into existing file
MartinquaXD 4e2ef55
Merge branch 'main' into new-api-simulator-crate
MartinquaXD 6d87308
delete unused file
MartinquaXD 7ab386a
Make tenderly URL optional
MartinquaXD b0348df
consistent naming
MartinquaXD d299a38
Replace awkward BuyTokensForBuffers variant
MartinquaXD 7d4c4aa
Stricter error handling
MartinquaXD ea48bce
move code around + comments
MartinquaXD a4aa3bf
Revert native token handling change to shrink diff
MartinquaXD 70885e8
group errors together
MartinquaXD 7192c76
doc comments
MartinquaXD 8ccf915
drop comment on tenderly gas price - should not be needed
MartinquaXD f7be2aa
import `tenderly` instead of using fully qualified paths
MartinquaXD ed7ef9a
cleaner error conversion
MartinquaXD 7c0521f
doc comments
MartinquaXD 3098ef2
move struct + impl together
MartinquaXD c74823f
move ethcallinputs to simulationbuilder
MartinquaXD 036ed92
fixup
MartinquaXD a37050b
move struct + impl together
MartinquaXD f07d4d1
Function for wrapping hooks in trampoline call
MartinquaXD 2ef69f7
match instead of ifs
MartinquaXD 667a4c7
doc comment
MartinquaXD 4a7f75e
use `vec![]` instead of pushing into empty vector
MartinquaXD 16cd8f3
use iterators intead of eagerly collecting into vectors
MartinquaXD e16f2da
Use `#[from]` over `#[source]`
MartinquaXD 88b8e73
better errors
MartinquaXD 65a4f0f
prepare jit orders in separate function
MartinquaXD c05d82c
Merge branch 'main' into new-api-simulator-crate
MartinquaXD 5b0499c
better error
MartinquaXD 4698b86
mark fields as required in openapi spec
MartinquaXD a6ab2f5
don't override interactions, remove from order, drop functions
MartinquaXD 121fbbc
drop unnecessary dependency
MartinquaXD 573ae5e
fix comment
MartinquaXD bd8be29
mark appdata as required as well
MartinquaXD 14e0f06
comment
MartinquaXD 010b1a1
Merge branch 'main' into new-api-simulator-crate
MartinquaXD edf7993
extend instead over overwrite appdata interactions
MartinquaXD File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2731,31 +2731,50 @@ components: | |
| if omitted. | ||
| allOf: | ||
| - $ref: "#/components/schemas/Address" | ||
| nullable: true | ||
| sellTokenBalance: | ||
| description: Where the sell token should be drawn from. | ||
| allOf: | ||
| - $ref: "#/components/schemas/SellTokenSource" | ||
| default: erc20 | ||
| buyTokenBalance: | ||
| description: Where the buy token should be transferred to. | ||
| allOf: | ||
| - $ref: "#/components/schemas/BuyTokenDestination" | ||
| default: erc20 | ||
| appData: | ||
| description: > | ||
| Full app data JSON string. Defaults to `"{}"` if omitted. | ||
| Full app data JSON string. | ||
| type: string | ||
| nullable: true | ||
| blockNumber: | ||
| type: integer | ||
| nullable: true | ||
| signingScheme: | ||
| $ref: "#/components/schemas/SigningScheme" | ||
| signature: | ||
| $ref: "#/components/schemas/Signature" | ||
| feeAmount: | ||
| description: > | ||
| The fee amount in sell token atoms. Expected to be 0; only present | ||
| because it must be part of the signed order data. | ||
| allOf: | ||
| - $ref: "#/components/schemas/TokenAmount" | ||
| validTo: | ||
| description: Unix timestamp (`uint32`) until which the order is valid. | ||
| type: integer | ||
| partiallyFillable: | ||
| description: Whether the order can be partially filled or must be filled all at once. | ||
| type: boolean | ||
| required: | ||
| - sellToken | ||
| - buyToken | ||
| - sellAmount | ||
| - buyAmount | ||
| - kind | ||
| - owner | ||
| - signingScheme | ||
| - signature | ||
| - feeAmount | ||
| - validTo | ||
| - partiallyFillable | ||
|
Contributor
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. appData is missing. |
||
| - appData | ||
| OrderSimulation: | ||
| description: > | ||
| The Tenderly simulation request for an order, along with any | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
OrderSimulationRequestincrates/orderbook/src/dto/mod.rsdeclaresapp_data: String,fee_amount: U256,valid_to: u32,partially_fillable: bool- noneOption, none#[serde(default)]. Serde will 422 when any is missing.