-
Notifications
You must be signed in to change notification settings - Fork 0
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
Basis trading contract v1 #4
base: main
Are you sure you want to change the base?
Conversation
deepsp94
commented
May 2, 2022
- Contract is meant to hold only one user's weth deposit.
- Update function checks funding and goes long or stays idle
- Withdraw function works when contract is long or idle
+ Use load_contract in conftest for improving run time
Pool fixture liquidity increased to allow more/larger trades
Except for some small changes, this looks good so far. Need integration tests for interacting with Overlay Haven't thoroughly reviewed security wise, but will once move beyond the MVP. |
tests/basistrade/integrations/uniswap-v3/test_swapSingleUniV3.py
Outdated
Show resolved
Hide resolved
@mikeyrf i'm good to review and merge this branch when you're back.
Without the Would be nice if you could help improve this test. |
Sounds good. Let's get to this when I'm back, but some things to check:
To check whether it's related to the TWAP changing, you can use the mock feed setup in the v1 core tests (where you set the price manually). |
Hey @mikeyrf, this test passes now since I'm using the mock feed. Looks like it was a TWAP issue after all.
However, to be able to use the mock market in the unwind and build functions of my contract, i had to expose it as an argument. v1-vaults/contracts/EthBasisTrade.sol Line 157 in 9226bbd
and here: v1-vaults/contracts/EthBasisTrade.sol Line 168 in 9226bbd
This is how the unwind (and build too) test looked before. I was using the weth/ovl market by default: https://github.com/overlay-market/v1-vaults/blame/64515b894b0f8ce80180571132ee5629f28f0122/contracts/EthBasisTrade.sol#L164 Lemme know your thoughts/if you think there's a better way to go about it. |