Skip to content

Commit

Permalink
saturnswap: use on chain data
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jul 26, 2024
1 parent 65242c8 commit 4d575b6
Showing 1 changed file with 47 additions and 10 deletions.
57 changes: 47 additions & 10 deletions projects/saturnswap/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,52 @@
const { fetchURL } = require("../helper/utils")
const { sumTokensExport } = require('../helper/chain/cardano')

async function tvl() {
const res = await fetchURL("https://api.saturnswap.io/v1/defillama/tvl");
return {
cardano: res.data.tvl.tvl
};
module.exports = {
timetravel: false,
cardano: {
tvl: sumTokensExport({ scripts: ['stake1u902fq2jxqctywjf22rv5xsch52p5jf7nddpnkyfj5lkekcnnhvtv'] },), // 0x0f4b4f7f7e507f3b6e9e954d5f6f3f8f7fa06e0f
}
}

module.exports = {
timetravel: false,
cardano: {
tvl
/*
// graph query for info
https://api.saturnswap.io/v1/graphql
query {
pools(first: 1000, order: { pool_stats: { tvl: DESC } }) {
edges {
node {
lp_fee_percent
name
pool_stats {
tvl
user_fees_earned_1d
updated_at
volume_1d
reserve_token_two
reserve_token_one
price
}
token_project_one {
asset_name
id
policy_id
name
ticker
price
decimals
}
token_project_one_id
token_project_two {
asset_name
id
policy_id
name
price
decimals
ticker
}
}
}
}
}
*/

0 comments on commit 4d575b6

Please sign in to comment.