Compare commits
2 Commits
6c76a9efd7
...
aed6c36746
| Author | SHA1 | Date | |
|---|---|---|---|
| aed6c36746 | |||
| 31a2edd0c6 |
@@ -4,3 +4,17 @@ archive_url = 'arbitrum_alchemy'
|
|||||||
concurrent_rpc_connections=8
|
concurrent_rpc_connections=8
|
||||||
metrics_port=9090
|
metrics_port=9090
|
||||||
metadata = '' # this setting approves no tokens
|
metadata = '' # this setting approves no tokens
|
||||||
|
stablecoins = [
|
||||||
|
# in order of preference
|
||||||
|
'0xaf88d065e77c8cC2239327C5EDb3A432268e5831', # USDC
|
||||||
|
'0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9', # USDT
|
||||||
|
'0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', # USDC.e
|
||||||
|
]
|
||||||
|
|
||||||
|
quotecoins = [
|
||||||
|
# in order of preference
|
||||||
|
'0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', # WBTC
|
||||||
|
'0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', # WETH
|
||||||
|
]
|
||||||
|
|
||||||
|
nativecoin = ['0x82aF49447D8a07e3bd95BD0d56f35241523fBab1'] # WETH
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ async def _initialize_mark_to_market():
|
|||||||
impl_addr = await factory.implementation()
|
impl_addr = await factory.implementation()
|
||||||
wrapper = await ContractProxy(impl_addr, 'Vault').wrapper()
|
wrapper = await ContractProxy(impl_addr, 'Vault').wrapper()
|
||||||
if wrapper != ADDRESS_0:
|
if wrapper != ADDRESS_0:
|
||||||
|
log.info(f'Detected native coin wrapper {wrapper}')
|
||||||
config.nativecoin = wrapper
|
config.nativecoin = wrapper
|
||||||
quotes.clear()
|
quotes.clear()
|
||||||
quotes.extend(config.stablecoins)
|
quotes.extend(config.stablecoins)
|
||||||
|
|||||||
@@ -172,20 +172,26 @@ async def handle_transaction_receipts():
|
|||||||
log.warning(f'ignoring transaction request with bad type "{job.request.type}"')
|
log.warning(f'ignoring transaction request with bad type "{job.request.type}"')
|
||||||
else:
|
else:
|
||||||
await handler.complete_transaction(job, receipt)
|
await handler.complete_transaction(job, receipt)
|
||||||
|
end_job(job)
|
||||||
try:
|
try:
|
||||||
await handler.release_account(accounts_in_flight.pop(job.tx_id))
|
await handler.release_account(accounts_in_flight.pop(job.tx_id))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
end_job(job)
|
|
||||||
|
|
||||||
|
|
||||||
def end_job(job):
|
def end_job(job):
|
||||||
ended_jobs.append(job)
|
ended_jobs.append(job)
|
||||||
|
|
||||||
|
|
||||||
def cleanup_jobs():
|
async def cleanup_jobs():
|
||||||
for job in ended_jobs:
|
for job in ended_jobs:
|
||||||
log.debug(f'ending job {job.id}')
|
log.debug(f'ending job {job.id}')
|
||||||
|
if job.tx_id in accounts_in_flight:
|
||||||
|
try:
|
||||||
|
handler = TransactionHandler.of(job.request.type)
|
||||||
|
await handler.release_account(accounts_in_flight.pop(job.tx_id))
|
||||||
|
except KeyError:
|
||||||
|
log.warning(f'ignoring transaction request with bad type "{job.request.type}"')
|
||||||
in_flight.discard((job.request.type, job.request.key))
|
in_flight.discard((job.request.type, job.request.key))
|
||||||
db.session.delete(job)
|
db.session.delete(job)
|
||||||
ended_jobs.clear()
|
ended_jobs.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user