The purpose of the function below is to track USDT that is transferred to and from Yearn and Fulcrum.
When I call search_liquidity(_toBlock), I get an error that says Returned error: query returned more than 10000 results
. This error is confusing to me because I even get this error when I query USDT transactions between Yearn and Fulcrum from a single block.
Are there situations where Infura returns this error even though the query did not return more than 10000 results? Is this a problem with the Fulcrum address I selected?
let search_liquidity = async(_toBlock) => {
try {
withdraw_events = await USDT_contract_interface.getPastEvents('Transfer',
{
filter: {
src: '0xE6354ed5bC4b393a5Aad09f21c46E101e692d447', // Yearn sender and receiver address for USDT
dst: '0xf013406a0b1d544238083df0b93ad0d2cbe0f65f' // what I suspect to be the sender and receiver address for USDT for Fulcrum
},
fromBlock: yearn_liquidity_transfer_addresses.starter_block,
toBlock: _toBlock
}
)
deposit_events = await USDT_contract_interface.getPastEvents('Transfer',
{
filter: {
src: '0xf013406a0b1d544238083df0b93ad0d2cbe0f65f',
dst: '0xE6354ed5bC4b393a5Aad09f21c46E101e692d447'
},
fromBlock: yearn_liquidity_transfer_addresses.starter_block,
toBlock: _toBlock
}
)
events.push(...withdraw_events,...deposit_events)
}
catch(error) {
console.log(error)
}
}