fix: Add tx signature verification
All checks were successful
Build Docker / BuildImage (push) Successful in 32s

This commit is contained in:
Nathan Woodburn 2024-12-10 11:20:35 +11:00
parent 87b7b1ba20
commit 606d31ba17
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
16 changed files with 32 additions and 16 deletions

View File

@ -1 +1 @@
{"timestamp": 1733719019.8687048, "result": 3917.66}
{"timestamp": 1733789918.4846652, "result": 3712.77}

View File

@ -1 +1 @@
{"timestamp": 1733718944.0457852, "result": 1.16}
{"timestamp": 1733789921.2481468, "result": 0.98991}

View File

@ -1 +1 @@
{"timestamp": 1733719021.134048, "result": 4.19}
{"timestamp": 1733789854.0988004, "result": 4.19}

View File

@ -1 +1 @@
{"timestamp": 1733719018.4388325, "result": 245.52}
{"timestamp": 1733789856.5556242, "result": 227.89}

View File

@ -1 +1 @@
{"timestamp": 1733719082.3050148, "result": 4.18}
{"timestamp": 1733789919.6086097, "result": 3.77}

View File

@ -1 +1 @@
{"timestamp": 1733718865.254725, "result": 231.94}
{"timestamp": 1733789851.6413863, "result": 215.13}

View File

@ -1 +1 @@
{"timestamp": 1733719142.596215, "result": 4.32}
{"timestamp": 1733789920.0200877, "result": 3.9}

View File

@ -1 +1 @@
{"timestamp": 1733720614.112476, "result": 326.899783283}
{"timestamp": 1733790003.498964, "result": 388.922873018}

View File

@ -1 +1 @@
{"timestamp": 1733718864.8976314, "result": 0.038218578}
{"timestamp": 1733789851.2324705, "result": 0.034115021}

View File

@ -1 +1 @@
{"timestamp": 1733719021.178202, "result": 1.0}
{"timestamp": 1733789854.9180405, "result": 1.0}

View File

@ -1 +1 @@
{"timestamp": 1733719020.2031393, "result": 98929}
{"timestamp": 1733789857.3777826, "result": 97129}

View File

@ -1 +1 @@
{"timestamp": 1733720524.535053, "result": [{"mint": "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4", "balance": 19.88979, "price": 4.19, "value": 83.33822010000002, "name": "Jupiter Perpetuals Liquidity Provider Token", "symbol": "jlp"}, {"mint": "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", "balance": 0.00035766, "price": 98929, "value": 35.38294614, "name": "Wrapped BTC (Wormhole)", "symbol": "wbtc"}, {"mint": "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v", "balance": 0.039815492, "price": 245.52, "value": 9.775499595840001, "name": "Jupiter Staked SOL", "symbol": "jupsol"}, {"mint": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", "balance": 0.00255735, "price": 3917.66, "value": 10.018827800999999, "name": "Ethereum (Wormhole)", "symbol": "eth"}, {"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.18, "value": 3.77391344726, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.32, "value": 41.72633568864, "name": "Volo Staked SUI", "symbol": "vsui"}]}
{"timestamp": 1733789920.0303614, "result": [{"mint": "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4", "balance": 19.88979, "price": 4.19, "value": 83.33822010000002, "name": "Jupiter Perpetuals Liquidity Provider Token", "symbol": "jlp"}, {"mint": "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v", "balance": 0.039815492, "price": 227.89, "value": 9.07355247188, "name": "Jupiter Staked SOL", "symbol": "jupsol"}, {"mint": "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh", "balance": 0.00056828, "price": 97129, "value": 55.19646812, "name": "Wrapped BTC (Wormhole)", "symbol": "wbtc"}, {"mint": "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs", "balance": 0.00255735, "price": 3712.77, "value": 9.4948523595, "name": "Ethereum (Wormhole)", "symbol": "eth"}, {"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 3.77, "value": 3.4037449033900002, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 3.9, "value": 37.669608607799994, "name": "Volo Staked SUI", "symbol": "vsui"}]}

View File

@ -1 +1 @@
{"timestamp": 1733720524.479128, "result": [{"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 4.18, "value": 3.77391344726, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 4.32, "value": 41.72633568864, "name": "Volo Staked SUI", "symbol": "vsui"}]}
{"timestamp": 1733789920.0300026, "result": [{"mint": "0x2::sui::SUI", "balance": 0.902850107, "price": 3.77, "value": 3.4037449033900002, "name": "Sui", "symbol": "sui"}, {"mint": "0x549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT", "balance": 9.658874002, "price": 3.9, "value": 37.669608607799994, "name": "Volo Staked SUI", "symbol": "vsui"}]}

View File

@ -1 +1 @@
{"timestamp": 1733720521.0848057, "result": 82.815227}
{"timestamp": 1733789920.8670247, "result": 82.815227}

View File

@ -1 +1 @@
{"timestamp": 1733720598.8847191, "result": [{"name": "Kamino USDC Lending", "description": "Kamino USDC Lending", "apy": 26.85, "url": "https://app.kamino.finance/lending/reserve/DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek/Ga4rZytCpq1unD4DbEJ5bkHeUz9g3oh9AAFEi6vSauXp", "value": 20, "updated": "1733719659", "initial": 20, "bought": "1733717057", "type": "Lending"}, {"name": "dYdX MegaVault", "description": "dYdX MegaVault", "apy": 46, "url": "https://dydx.trade/vault", "value": 23.25, "updated": "1733719659", "initial": 23, "bought": "1733300000", "type": "Lending"}]}
{"timestamp": 1733789922.7835755, "result": [{"name": "Kamino USDC Lending", "description": "Kamino USDC Lending", "apy": 26.85, "url": "https://app.kamino.finance/lending/reserve/DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek/Ga4rZytCpq1unD4DbEJ5bkHeUz9g3oh9AAFEi6vSauXp", "value": 20, "updated": "1733729835", "initial": 20, "bought": "1733717057", "type": "Lending"}, {"name": "dYdX MegaVault", "description": "dYdX MegaVault", "apy": 46, "url": "https://dydx.trade/vault", "value": 23.29, "updated": "1733729835", "initial": 23, "bought": "1733300000", "type": "Lending"}]}

View File

@ -573,11 +573,27 @@ def parseDeposit(data):
continue
if 'tokenTransfers' not in tx:
continue
# Skip memo txs
if 'Memo' in json.dumps(tx):
print(f"Skipping deposit as it contains memo: {tx['description']}")
continue
signature = tx['signature']
if not os.path.exists(f"cache/txs.json"):
with open(f"cache/txs.json", "w") as f:
json.dump([], f)
with open(f"cache/txs.json") as f:
txs = json.load(f)
if signature in txs:
print(f"Skipping duplicate tx: {signature}")
continue
txs.append(signature)
with open(f"cache/txs.json", "w") as f:
json.dump(txs, f)
for transfer in tx['nativeTransfers']:
if transfer['toUserAccount'] != str(vault_sol_address):