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

BalancerV2 Feed #26

Open
wants to merge 65 commits into
base: main-archive
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b7e22e6
Adjust GitHub Actions for dev branch (#52)
sicknick99 Apr 13, 2022
a893c39
[WIP] Get BalancerV2 pool token addrs
sicknick99 Feb 5, 2022
26bca2d
Misc feed comments
sicknick99 Feb 5, 2022
1317889
[WIP] Stack too deep error
sicknick99 Feb 7, 2022
9803643
Pass BalV2 tokens data into feed as struct
sicknick99 Feb 7, 2022
cfd5028
Test BalV2 getPoolTokensData fn
sicknick99 Feb 9, 2022
e5c1d69
Fix sol lints
sicknick99 Feb 9, 2022
bfb0210
[WIP] Update feed deployer fn
sicknick99 Feb 10, 2022
9255a80
Fix ovlWethToken in construct
sicknick99 Feb 11, 2022
09a8e45
Test BalV2 feed reverts when market tok is not WETH
sicknick99 Feb 11, 2022
95d9813
Test all require statements in OverlayV1BalancerV2Feed deploy fn
sicknick99 Feb 11, 2022
1636ef1
Use PAR/USDC pool for reverts testing, doc comments
sicknick99 Feb 12, 2022
821f3d0
Move feed deploy fixture to conftest, test view fns"
sicknick99 Feb 12, 2022
0747e9a
[WIP] Check pool ids in balv2 feed, test getPoolId view, test reverts…
sicknick99 Feb 12, 2022
752a908
Pass in pool info as struct to deploy, tests
sicknick99 Feb 17, 2022
b4e8d31
Solidity lint
sicknick99 Feb 17, 2022
2923730
Misc comments
sicknick99 Feb 24, 2022
0d1ae80
Doc comment
sicknick99 Feb 24, 2022
0d6b25a
[WIP] Call getTimeWeightedAverage Balv2 fn from feed
sicknick99 Mar 7, 2022
2de27a5
[WIP] Working getOracleAverageQuery, getTimeWeightedAverage
sicknick99 Mar 9, 2022
f8905fa
Pass queries in as arr to getTimeWeightedAverage
sicknick99 Mar 9, 2022
f0d544d
getPairPrice function
sicknick99 Mar 9, 2022
7ea0e0f
Get reserve over a micro window, getReserve
sicknick99 Mar 10, 2022
900012a
Get reserve in OVL terms
sicknick99 Mar 17, 2022
b6dadf5
Doc comment syntax fixes
sicknick99 Mar 17, 2022
25dc402
Doc comments getTokensPool, getNormalizedWeights, getPoolId
sicknick99 Mar 17, 2022
494a780
Doc comments
sicknick99 Mar 23, 2022
e5ef030
[WIP] In the middle of feed revision
sicknick99 Mar 25, 2022
5185789
Order functions according to NatSpec
sicknick99 Mar 25, 2022
038a8f9
Fix syntax lints
sicknick99 Mar 26, 2022
d442252
Lint python
sicknick99 Mar 26, 2022
f37ac70
Begin testing BalancerV2 Factory
sicknick99 Mar 26, 2022
81e3b0a
Add in the BalancerV2Token struct fns
sicknick99 Mar 26, 2022
58b2165
Use interface for BalancerV2 factory
sicknick99 Mar 26, 2022
9d4d77f
Use interface for BalancerV2 feed -> needs updating in the future
sicknick99 Mar 26, 2022
16ce2e6
Doc comment update
sicknick99 Mar 26, 2022
fd8477b
Test that BalV2 factory deploys feed successfully
sicknick99 Mar 26, 2022
571befa
Test that BalV2 factory deploys inverse feed successfully
sicknick99 Mar 26, 2022
eb85288
Test that BalV2 factory reverts if deploying already existing feed
sicknick99 Mar 26, 2022
397b6f5
[WIP] getPairPrice not returning anything
sicknick99 Mar 29, 2022
901a0a9
Test getTWAPInvariant, fix balv2 feed contract errors
sicknick99 Mar 30, 2022
2caca62
Get reserve and some unfinished tests
sicknick99 Mar 31, 2022
0d559fd
BalV2 Feed inherits from interface
sicknick99 Apr 9, 2022
b1fc6f7
BalV2 feed interface includes more fns
sicknick99 Apr 9, 2022
9a744ce
Fix rebase error
sicknick99 Apr 9, 2022
426ce5c
Add init
sicknick99 Apr 10, 2022
b55697b
Minor comments to self
sicknick99 Apr 10, 2022
3db3332
Used fixed point
sicknick99 Apr 10, 2022
259ebdf
Rm unused ovlWethPoolId global
sicknick99 Apr 10, 2022
39c138f
Address some minor misc todos
sicknick99 Apr 10, 2022
bb80ced
Rm unused getTwapPairPrice fn
sicknick99 Apr 10, 2022
91a85d9
Misc comments
sicknick99 Apr 10, 2022
30202ec
Calculate B_k in getReserveInWeth depending on token order
sicknick99 Apr 11, 2022
117ac30
Calc reserve when WETH is base or quote, rm unused vars
sicknick99 Apr 11, 2022
902b779
Lint
sicknick99 Apr 11, 2022
194efa0
Todo test notes
sicknick99 Apr 12, 2022
444a36f
Lint python
sicknick99 Apr 18, 2022
202e207
Revert to main gh actions
sicknick99 Apr 18, 2022
2a1ee0f
Fix typos, rename balancer lib directory
sicknick99 Apr 20, 2022
d31a786
Mark hardcode WETH as TODO
sicknick99 Apr 20, 2022
135a75d
Update doc comment
sicknick99 Apr 20, 2022
4a94e1e
Comment fixes, getReserve market->ovlWeth fix
sicknick99 Apr 23, 2022
30057e6
Remove BalancerV2Tokens struct, add vault to BalancerV2PoolInfo struc…
sicknick99 Apr 24, 2022
e0ca652
Update tests post BalancerV2Tokens struct removal
sicknick99 Apr 24, 2022
05e6693
Remove marketBaseAmount global variable
sicknick99 Apr 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Doc comment syntax fixes
  • Loading branch information
sicknick99 committed Apr 18, 2022
commit b6dadf53e049d5d3ffe670f38503f02722cc2931
34 changes: 17 additions & 17 deletions tests/feeds/balancerv2/conftest.py
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ def rando(accounts):
def dai():
'''
Outputs:
[Contract] DAI token contract instance
[Contract]: DAI token contract instance

https://etherscan.io/address/0x6B175474E89094C44Da98b954EedeAC495271d0F
'''
@@ -61,7 +61,7 @@ def dai():
def weth():
'''
Outputs:
[Contract] WETH token contract instance
[Contract]: WETH token contract instance

https://etherscan.io/address/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
'''
@@ -72,7 +72,7 @@ def weth():
def balancer():
'''
Outputs:
[Contract] Balancer V2 BalancerGovernanceToken token contract instance
[Contract]: BalancerGovernanceToken token contract instance

https://etherscan.io/address/0xba100000625a3754423978a60c9317c58a424e3D
'''
@@ -83,8 +83,8 @@ def balancer():
def pool_daiweth():
'''
Outputs:
[Contract] Balancer V2 WeightedPool2Tokens contract instance for the
DAI/WETH pool
[Contract]: Balancer V2 WeightedPool2Tokens contract instance for the
DAI/WETH pool


https://etherscan.io/address/0x0b09deA16768f0799065C475bE02919503cB2a35
@@ -186,18 +186,18 @@ def feed(gov, balancer, weth, dai, balv2_tokens, pool_daiweth, pool_balweth):
market pool. The OVL/WETH pool is simulated using the BAL/WETH pool.

Inputs:
gov [Account]: Governor role account deploys the
OverlayV1BalancerV2Feed contract
dai [Contract]: DAI token contract instance
weth [Contract]: WETH token contract instance
balancer [Contract]: BAL token contract instance representing the
OVL token
balv2_tokens [tuple]: BalancerV2Tokens struct field variables
pool_daiweth [Contract]: Balancer V2 WeightedPool2Tokens contract
instance for the DAI/WETH pool
pool_balweth [Contract]: BAL/WETH Balancer V2 WeightedPool2Tokens
contract instance representing the OVL/WETH
token pair
gov [Account]: Governor role account deploys the
OverlayV1BalancerV2Feed contract
dai [Contract]: DAI token contract instance
weth [Contract]: WETH token contract instance
balancer [Contract]: BAL token contract instance representing the OVL
token
balv2_tokens [tuple]: BalancerV2Tokens struct field variables
pool_daiweth [Contract]: Balancer V2 WeightedPool2Tokens contract
instance for the DAI/WETH pool
pool_balweth [Contract]: BAL/WETH Balancer V2 WeightedPool2Tokens
contract instance representing the OVL/WETH
token pair
'''
market_pool = pool_daiweth
ovlweth_pool = pool_balweth