<aside> 💡 Welcome aboard! You’ve landed on one of our evergreen education bounties - open for everyone at anytime.
</aside>
This particular SQL guide is on Anchor Protocol. We take you on a step by step journey to look at the volume of UST deposited into Anchor.
You can interact with Anchor Protocol here: https://app.anchorprotocol.com/ or read up its docs here: https://docs.anchorprotocol.com/
At the end of this guide, we’ve included a challenge for you to apply what you’ve learnt to find out how much UST is borrowed from Anchor. The estimated time to go through this guide is 30 minutes - 1 hour.
Now, on the left panel you can see a list of schema and tables to select from. Click on the SCHEMA dropdown and select ANCHOR . You should be able to see this list of tables:
Hover your mouse over the DEPOSITS table and click on PREVIEW
the anchor.deposits
table records all transactions where users deposit UST into Anchor Earn to earn about 19.5% APY
Running PREVIEW will display 10 rows of results for that particular table. Splitting the table screenshot into 2 parts:
Part 1:
In this table, each event would appear as separate rows.
BLOCK_TIMESTAMP
is the time the transaction occurred. The timezone here is UTC+0
TX_ID
is the unique transaction ID for that transaction. We can look up transaction IDs on https://finder.extraterrestrial.money/ or https://finder.terra.money/ to verify them.
select*
from anchor.deposits
where tx_id = 'insertyourTXIDhere' -- include the ' ' punctuation marks
SENDER
is the address that initiated the transaction. Since this table is ANCHOR.DEPOSITS, the SENDER
column here would mean the addresses that deposited UST into Anchor.