KuramaOsmosis failed transactions - by error message
    Updated 2022-05-31

    select to_date(block_timestamp) as date,
    case when tx_code = 7 and codespace = 'gamm' then 'Token is lesser than min amount: calculated amount is lesser than min amount'
    when tx_code = 32 and codespace = 'sdk' then 'Account sequence mismatch, incorrect account sequence'
    when tx_code = 30 and codespace = 'sdk' then 'Tx timeout height'
    when tx_code = 5 and codespace = 'sdk' then 'Insufficient funds'
    when tx_code = 13 and codespace = 'channel' then 'IBC Update client: invalid packet'
    when tx_code = 11 and codespace = 'sdk' then 'Out of gas' -- get rewards
    when tx_code = 14 and codespace = 'channel' then 'Packet timeout'
    when tx_code = 18 and codespace = 'sdk' then 'Invalid request' -- either insufficient funds, invalid ID
    when tx_code = 3 and codespace = 'gov' then 'Inactive proposal'
    when tx_code = 32 and codespace = 'staking' then 'Redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation'
    when tx_code = 6 and codespace = 'gamm' then 'Token is larger than max amount: calculated amount is larger than max amount'
    when tx_code = 1 and codespace = 'undefined' then 'Internal'
    when tx_code = 29 and codespace = 'client' then 'Status Expired: client is not active'
    when tx_code = 7 and codespace = 'superfluid' then 'Lockup is already being used for superfluid staking'
    when tx_code = 40 and codespace = 'staking' then 'Redelegation to this validator already in progress; first redelegation to this validator must complete before next redelegation'
    when tx_code = 5 and codespace = 'distribution' then 'No delegation distribution info'
    when tx_code = 8 and codespace = 'gamm' then 'Token amount is zero or negative: invalid calculated result'
    when tx_code = 7 and codespace = 'client' then 'Timeout packet verification failed: consensus state not found'
    when tx_code = 4 and codespace = 'sdk' then 'Signature verification failed; please verify account number: unauthorized'
    when tx_code = 5 and codespace = 'superfluid' then 'Lockup is not used for superfluid staking'
    when tx_code = 19 and codespace = 'staking' then 'No delegation for (address, validator) tuple'
    when tx_code = 2 and codespace = 'superfluid' then 'Unbonding lockup is not allowed to participate in superfluid staking'
    when tx_code = 26 and codespace = 'sdk' then 'Failed packet acknowledgement verification for client: invalid height'
    when tx_code = 27 and codespace = 'staking' then 'Too many unbonding delegation entries for (delegator, validator) tuple'
    when tx_code = 24 and codespace = 'staking' then 'No delegation for (address, validator) tuple'
    when tx_code = 3 and codespace = 'bech32ibc' then 'Hrp record not found for cosmos: No record found for requested HRP'
    when tx_code = 10 and codespace = 'superfluid' then 'Provided asset is not supported for superfluid staking'
    when tx_code = 29 and codespace = 'staking' then 'Cannot redelegate to the same validator'
    when tx_code = 111222 and codespace = 'undefined' then 'Panic message redacted to hide potentially sensitive system info: panic'
    when tx_code = 2 and codespace = 'gov' then 'Unknown proposal'
    else 'Others' end as error_message,
    count(distinct tx_id) from osmosis.core.fact_transactions
    where tx_status = 'FAILED'
    and block_timestamp between current_date - 120 and current_date
    Run a query to Download Data