Arbitrum-Swaping of stablecoins and wrap tokens

    Methodology

    There are no swapping table for arbitrium on flipside database. so we had to find swap transaction from transactions table . for this porpose first we digged up all event from event table with 'Sawap' event name. after that we decoded json phrases of EVENT_INPUTSs. some of them has all information about swaping like token in , token out, amount in and amount out but some have not any information about token in and token out. for finding of token in and token out contract we stuck all jason phrase of transaction to rows of event log table from transaction table. by couple condition we found token in and token out you can see example below:

    when token_in is null and TX_JSON['receipt']['logs'][2]['decoded']['eventName']='Transfer' and (TX_JSON['receipt']['logs'][2]['decoded']['inputs']['from']=user or TX_JSON['receipt']['logs'][2]['decoded']['inputs']['to']in (PLATFORM_CONTRACT,vv )) and (TX_JSON['receipt']['logs'][2]['decoded']['inputs']['value']=AMOUNT_IN or TX_JSON['receipt']['logs'][2]['decoded']['inputs']['value']=AMOUNT_IN or TX_JSON['receipt']['logs'][2]['decoded']['inputs']['value']=abs(AMOUNT_IN) ) then TX_JSON['receipt']['logs'][2]['address'] now we have complete swap table, for finding decimal, token label , platform label we used label table and then use them ti find wtokens and stable tokens transactions.