DEV Community

Sort
Sort

Posted on • Updated on

Watching Beanstalk Fundraising with Sort

Beanstalk is working to build the world's best stablecoin, as the Beanstalk guide mentions, Beanstalk is:

A stablecoin that (1) prioritizes decentralization, (2) does not require collateral, and (3) organically trends toward more liquidity and stability over time, will unlock the potential of DeFi

Unfortunately, in April of 2022, Beanstalk funds were stolen through a governance exploit. Having one of the strongest communities in crypto, Beanstalk started a fundraising event called the "Barn Raise" to recapitalize the protocol.

We'll use Sort to track Barn Raise progress, and even export results to a spreadsheet.

Craft a Sort query for the Beanstalk Barn Raise

select
  transaction_hash as tx,
  transaction_from as from_address,
  timestamp,
  CAST(l.params [5].value as integer) as amount,
  CASE
    WHEN transaction_value_eth > 0 THEN 'ETH'
    ELSE 'USDC'
  END AS currency
from
  ethereum.transaction_log l
where
  l.transaction_to IN (
    '0x402c84de2ce49af88f5e2ef3710ff89bfed36cb6',
    '0x735cab9b02fd153174763958ffb4e0a971dd7f29'
  )
  and l.name = 'TransferSingle'
order by
  timestamp desc
limit
  1000
Enter fullscreen mode Exit fullscreen mode

View query results here

View a total for the fundraise

select
  SUM(CAST(l.params [5].value as integer)) as amount,
from
  ethereum.transaction_log l
where
  l.transaction_to IN (
    '0x402c84de2ce49af88f5e2ef3710ff89bfed36cb6',
    '0x735cab9b02fd153174763958ffb4e0a971dd7f29'
  )
  and l.name = 'TransferSingle'
Enter fullscreen mode Exit fullscreen mode

View query results here

Top comments (1)

Collapse
 
reecegilbert profile image
ReeceGilbert

This post is provide us good information about Beanstalk Fundraising with sort way. You use best method to explain your point! Thanks buddy!
Breaking relationship curses