Skip to content

Commit

Permalink
Fix gas_strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeannette committed Oct 18, 2023
1 parent a4e4333 commit 58c3e0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions chief_keeper/chief_keeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def get_initial_tip(arguments) -> int:
if result.ok and result.content:
confidence_80_tip = result.json().get('blockPrices')[0]['estimatedPrices'][3]['maxPriorityFeePerGas']
logging.info(f"Using Blocknative 80% confidence tip {confidence_80_tip}")
logging.info(int(confidence_80_tip * GeometricGasPrice.GWEI))
return int(confidence_80_tip * GeometricGasPrice.GWEI)
except Exception as e:
logging.error(str(e))
Expand Down Expand Up @@ -280,6 +281,13 @@ def check_hat(self):

contender, highestApprovals = hat, hatApprovals

gas_strategy = GeometricGasPrice(
web3=self.web3,
initial_price=None,
initial_tip=self.get_initial_tip(self.arguments),
every_secs=180
)

for yay in yays:
contenderApprovals = self.dss.ds_chief.get_approvals(yay)
if contenderApprovals > highestApprovals:
Expand Down Expand Up @@ -309,12 +317,6 @@ def check_hat(self):

# Schedules spells that haven't been scheduled nor casted
if spell is not None:
gas_strategy = GeometricGasPrice(
web3=self.web3,
initial_price=None,
initial_tip=self.get_initial_tip(self.arguments),
every_secs=180
)
# Functional with DSSSpells but not DSSpells (not compatiable with DSPause)
if spell.done() == False and self.database.get_eta_inUnix(spell) == 0:
self.logger.info(f"Scheduling spell ({yay})")
Expand Down
2 changes: 1 addition & 1 deletion lib/pymaker
Submodule pymaker updated 88 files
+33 −0 .github/workflows/tests.yaml
+0 −32 .travis.yml
+10 −5 README.md
+81 −22 config/kovan-addresses.json
+126 −22 config/mainnet-addresses.json
+55 −57 config/testnet-addresses.json
+3 −3 docker-compose.yml
+215 −169 pymaker/__init__.py
+1 −1 pymaker/abi/Cat.bin
+1 −0 pymaker/abi/Clipper.abi
+1 −0 pymaker/abi/Clipper.bin
+1 −0 pymaker/abi/ClipperCallee.abi
+1 −0 pymaker/abi/ClipperCallee.bin
+1 −1 pymaker/abi/DaiJoin.bin
+1 −0 pymaker/abi/Dog.abi
+1 −0 pymaker/abi/Dog.bin
+1 −1 pymaker/abi/DsrManager.bin
+1 −1 pymaker/abi/DssCdpManager.bin
+1 −1 pymaker/abi/ESM.abi
+1 −1 pymaker/abi/ESM.bin
+1 −1 pymaker/abi/End.abi
+1 −1 pymaker/abi/End.bin
+0 −1 pymaker/abi/ExpiringMarket.abi
+0 −1 pymaker/abi/ExpiringMarket.bin
+1 −1 pymaker/abi/Flapper.bin
+1 −1 pymaker/abi/Flipper.bin
+1 −1 pymaker/abi/Flopper.bin
+1 −1 pymaker/abi/GemJoin.bin
+1 −1 pymaker/abi/GemJoin5.abi
+1 −1 pymaker/abi/GemJoin5.bin
+1 −1 pymaker/abi/Jug.bin
+1 −1 pymaker/abi/MatchingMarket.abi
+1 −1 pymaker/abi/MatchingMarket.bin
+1 −1 pymaker/abi/OSM.bin
+1 −1 pymaker/abi/Pot.bin
+1 −1 pymaker/abi/ProxyRegistry.bin
+1 −1 pymaker/abi/SimpleMarket.abi
+1 −1 pymaker/abi/SimpleMarket.bin
+1 −1 pymaker/abi/Spotter.bin
+1 −0 pymaker/abi/TokenFaucet.abi
+1 −0 pymaker/abi/TokenFaucet.bin
+1 −1 pymaker/abi/Vat.bin
+1 −1 pymaker/abi/Vow.bin
+0 −0 pymaker/abi/diff-abi.sh
+365 −102 pymaker/auctions.py
+68 −0 pymaker/collateral.py
+71 −38 pymaker/deployment.py
+2 −1 pymaker/dsrmanager.py
+224 −231 pymaker/dss.py
+144 −85 pymaker/gas.py
+90 −0 pymaker/ilk.py
+120 −0 pymaker/join.py
+20 −0 pymaker/keys.py
+3 −3 pymaker/logging.py
+10 −0 pymaker/numeric.py
+37 −99 pymaker/oasis.py
+17 −0 pymaker/oracles.py
+14 −4 pymaker/shutdown.py
+15 −0 pymaker/token.py
+1 −0 requirements-dev.txt
+3 −2 requirements.txt
+1 −1 setup.py
+24 −0 test-dss.sh
+1 −0 tests/abi/OasisMockPriceOracle.abi
+1 −0 tests/abi/OasisMockPriceOracle.bin
+12 −0 tests/abi/OasisMockPriceOracle.sol
+19 −1 tests/conftest.py
+ tests/gas_sandbox.ods
+3 −0 tests/helpers.py
+11 −12 tests/manual_test_async_tx.py
+7 −1 tests/manual_test_mcd.py
+230 −0 tests/manual_test_mempool.py
+93 −0 tests/manual_test_nomcd.py
+60 −0 tests/manual_test_token.py
+0 −90 tests/manual_test_tx_recovery.py
+2 −2 tests/test_approval.py
+326 −124 tests/test_auctions.py
+5 −3 tests/test_dsrmanager.py
+113 −55 tests/test_dss.py
+146 −113 tests/test_gas.py
+18 −1 tests/test_general.py
+26 −42 tests/test_general2.py
+17 −0 tests/test_numeric.py
+79 −60 tests/test_oasis.py
+1 −1 tests/test_proxy.py
+26 −18 tests/test_savings.py
+6 −8 tests/test_shutdown.py
+23 −4 tests/test_token.py

0 comments on commit 58c3e0a

Please sign in to comment.