0

I have a transaction below from etherscan API. If I understood correctly, this transaction has transferred 75.075 AXS to 0x3019d4e366576a88d28b623afaf3ecb9ec9d9580 address.

[
 {
  "blockNumber": "14003507",
  "timeStamp": "1642161610",
  "hash": "0xbf282f0edf1252c65383fd33dd5c310273a97f54a26c8ffd8d872811590a3911",
  "nonce": "287",
  "blockHash": "0x24c9a5d1948c7d2f56f327a1336742f3555bb51e490a64ef395f7d33a7999a20",
  "from": "0x220bda5c8994804ac96ebe4df184d25e5c2196d4",
  "contractAddress": "0xbb0e17ef65f82ab018d8edd776e8dd940327b28b",
  "to": "0x3019d4e366576a88d28b623afaf3ecb9ec9d9580",
  "value": "75075000000000000000",
  "tokenName": "Axie Infinity Shard",
  "tokenSymbol": "AXS",
  "tokenDecimal": "18",
  "transactionIndex": "15",
  "gas": "322255",
  "gasPrice": "178122087663",
  "gasUsed": "205467",
  "cumulativeGasUsed": "748722",
  "input": "deprecated",
  "confirmations": "42"
 },
 ...
]

I would like to determine the equivalent or estimated amount transferred of this transaction in ETH, USDC and USDT.


What I've tried.

I'm using cryptocompare API to get the historical price of the AXS by passing the timeStamp of the transaction. Then I multiply the transaction's value (75.075) to the result's ETH, USDC, USDT price.

// https://min-api.cryptocompare.com/data/pricehistorical?fsym=AXS&tsyms=usdt,usdc,eth&ts=1642161610
{
 "AXS": {
  "USDT": 71.79,
  "USDC": 71.84,
  "ETH": 0.02229
 }
}

I'm hesitant on this solution. Beside from being slow (I'm doing this for the first 50 ERC20 transaction of the address), cryptocompare also doesn't have the data for all tokens. Do you guys, have a recommendation on achieving this?

I'm new on Ethereum things and have read about ABIs, and thought if that could somehow help me on this 🤷‍♂️. Thank you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.