-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dune queries and update tenderly action flow
- Loading branch information
1 parent
20c5824
commit 0c2cb5d
Showing
9 changed files
with
144 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
with bids as ( | ||
SELECT | ||
Bidder as bidder, | ||
sum(amount) as bid_size | ||
FROM | ||
ipnft_{{chain}}.CrowdSale_evt_Bid | ||
WHERE | ||
saleId = cast('{{saleId}}' as uint256) | ||
GROUP BY | ||
Bidder, | ||
amount | ||
ORDER BY | ||
bid_size DESC | ||
), | ||
decimals as ( | ||
SELECT erc20.decimals | ||
FROM | ||
(SELECT from_hex(json_extract_scalar(sale, '$.biddingToken')) as biddingTokenContract | ||
FROM | ||
ipnft_{{chain}}.CrowdSale_evt_Bid | ||
WHERE | ||
saleId = cast('{{saleId}}' as uint256) | ||
) as sale | ||
LEFT JOIN tokens.erc20 as erc20 | ||
ON erc20.blockchain = '{{chain}}' | ||
AND erc20.contract_address = sale.biddingTokenContract | ||
) | ||
select | ||
Bidder, | ||
bid_size / pow(10, COALESCE(decimals,18)) as bid_amount | ||
FROM bids, decimals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SELECT | ||
bids.evt_block_time, | ||
SUM(previous_bids.amount) / 1e18 AS cumulative_growth | ||
FROM | ||
ipnft_{{chain}}.Crowdsale_evt_Bid as bids | ||
LEFT JOIN ipnft_{{chain}}.CrowdSale_evt_Bid | ||
AS previous_bids | ||
ON previous_bids.evt_block_time <= bids.evt_block_time | ||
AND previous_bids.saleId = cast('{{saleId}}' as uint256) | ||
WHERE | ||
bids.saleId = cast('{{saleId}}' as uint256) | ||
GROUP BY | ||
bids.evt_block_time, | ||
bids.amount | ||
ORDER BY | ||
bids.evt_block_time; |
File renamed without changes.
14 changes: 9 additions & 5 deletions
14
periphery/tenderly/dune.js → periphery/tenderly-actions/dune.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 33 additions & 17 deletions
50
periphery/tenderly/package-lock.json → periphery/tenderly-actions/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "tenderly-actions", | ||
"scripts": { | ||
"build": "tsc" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^4.3.5" | ||
}, | ||
"dependencies": { | ||
"@tenderly/actions": "^0.2.57", | ||
"axios": "^1.7.7" | ||
}, | ||
"private": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,66 @@ | ||
account_id: '' | ||
project_slug: '' | ||
actions: | ||
moleculeprotocol/project: | ||
tech_prod/catalyst: | ||
runtime: v2 | ||
sources: tenderly | ||
sources: tenderly-actions | ||
specs: | ||
BidEventGoerli: | ||
description: BidEvent on Goerli StakedLockingCrowdSale contract | ||
bideventmainnet: | ||
description: BidEvent on Mainnet StakedLockingCrowdSale contract | ||
execution_type: '' | ||
function: dune:triggerDuneQuery | ||
trigger: | ||
type: transaction | ||
transaction: | ||
filters: | ||
- eventEmitted: | ||
contract: | ||
address: 0x46c3369dEce07176Ad7164906D3593AA4C126d35 | ||
address: 0x35Bce29F52f51f547998717CD598068Afa2B29B7 | ||
name: Bid | ||
network: 5 | ||
network: 1 | ||
status: | ||
- mined | ||
type: transaction | ||
bideventsepolia: | ||
description: BidEvent on Sepolia StakedLockingCrowdSale contract | ||
execution_type: '' | ||
BidEventMainnet: | ||
description: BidEvent on Mainnet StakedLockingCrowdSale contract | ||
function: dune:triggerDuneQuery | ||
trigger: | ||
transaction: | ||
filters: | ||
- eventEmitted: | ||
contract: | ||
address: 0xd1cE2EA7d3b0C9cAB025A4aD762FC00315141ad7 | ||
name: Bid | ||
network: 11155111 | ||
status: | ||
- mined | ||
type: transaction | ||
plainbideventmainnet: | ||
description: BidEvent on Mainnet PlainCrowdsale contract | ||
execution_type: '' | ||
function: dune:triggerDuneQuery | ||
trigger: | ||
transaction: | ||
filters: | ||
- eventEmitted: | ||
contract: | ||
address: 0x35Bce29F52f51f547998717CD598068Afa2B29B7 | ||
address: 0xf0a8d23f38e9cbbe01c4ed37f23bd519b65bc6c2 | ||
name: Bid | ||
network: 1 | ||
status: | ||
- mined | ||
type: transaction | ||
plainbideventsepolia: | ||
description: BidEvent on Sepolia PlainCrowdsale contract | ||
execution_type: '' | ||
|
||
function: dune:triggerDuneQuery | ||
trigger: | ||
transaction: | ||
filters: | ||
- eventEmitted: | ||
contract: | ||
address: 0x8cA737E2cdaE1Ceb332bEf7ba9eA711a3a2f8037 | ||
name: Bid | ||
network: 11155111 | ||
status: | ||
- mined | ||
type: transaction |
This file was deleted.
Oops, something went wrong.