mirror of
https://github.com/FlipsideCrypto/external-models.git
synced 2026-02-06 11:21:59 +00:00
update-to-pro-api (#90)
This commit is contained in:
parent
0398d726df
commit
f508022d56
@ -8,7 +8,7 @@ WITH chain_base AS (
|
||||
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET','https://api.llama.fi/chains',{},{}
|
||||
'GET','https://pro-api.llama.fi/{api_key}/api/chains',{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
),
|
||||
|
||||
@ -8,10 +8,10 @@ WITH base AS (
|
||||
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET','https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyVolume',{},{}
|
||||
'GET','https://pro-api.llama.fi/{api_key}/api/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyVolume',{},{},'Vault/prod/defillama'
|
||||
) AS dex_read,
|
||||
live.udf_api(
|
||||
'GET','https://api.llama.fi/overview/options?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyPremiumVolume',{},{}
|
||||
'GET','https://pro-api.llama.fi/{api_key}/api/overview/options?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyPremiumVolume',{},{},'Vault/prod/defillama'
|
||||
) AS options_read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
)
|
||||
|
||||
@ -8,7 +8,7 @@ WITH protocol_base AS (
|
||||
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET','https://api.llama.fi/protocols',{},{}
|
||||
'GET','https://pro-api.llama.fi/{api_key}/api/protocols',{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
)
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
persist_docs ={ "relation": true,
|
||||
"columns": true },
|
||||
tags = ['defillama'],
|
||||
enabled = false,
|
||||
meta={
|
||||
'database_tags':{
|
||||
'table': {
|
||||
|
||||
@ -13,7 +13,7 @@ SELECT
|
||||
chain_id,
|
||||
chain,
|
||||
live.udf_api(
|
||||
'GET',CONCAT('https://api.llama.fi/charts/',chain),{},{}
|
||||
'GET',CONCAT('https://pro-api.llama.fi/{api_key}/api/charts/',chain),{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
FROM (
|
||||
|
||||
@ -11,7 +11,7 @@ WITH api_pull AS (
|
||||
PARSE_JSON(
|
||||
live.udf_api(
|
||||
'GET',
|
||||
'https://api.llama.fi/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyVolume',{},{}
|
||||
'https://pro-api.llama.fi/{api_key}/api/overview/dexs?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyVolume',{},{},'Vault/prod/defillama'
|
||||
)
|
||||
) :data :protocols AS response,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
@ -19,6 +19,7 @@ WITH api_pull AS (
|
||||
lat_flat AS (
|
||||
SELECT
|
||||
r.value AS VALUE,
|
||||
r.value :displayName :: STRING AS protocol,
|
||||
_inserted_timestamp
|
||||
FROM
|
||||
api_pull,
|
||||
@ -30,7 +31,7 @@ chain_breakdown AS (
|
||||
SELECT
|
||||
k.key AS chain,
|
||||
SYSDATE() :: DATE AS TIMESTAMP,
|
||||
v.key AS protocol,
|
||||
protocol,
|
||||
k.value AS dex_object,
|
||||
v.value :: INTEGER AS daily_volume,
|
||||
_inserted_timestamp
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = 'id',
|
||||
enabled = false,
|
||||
full_refresh = false,
|
||||
tags = ['defillama']
|
||||
) }}
|
||||
@ -15,7 +14,7 @@ SELECT
|
||||
FROM (
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET','https://api.llama.fi/overview/options?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyNotionalVolume',{},{}
|
||||
'GET','https://pro-api.llama.fi/{api_key}/api/overview/options?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyNotionalVolume',{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
),
|
||||
@ -29,7 +28,7 @@ options_base AS (
|
||||
SELECT
|
||||
chain,
|
||||
live.udf_api(
|
||||
'GET',CONCAT('https://api.llama.fi/overview/options/',chain,'?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyNotionalVolume'),{},{}
|
||||
'GET',CONCAT('https://pro-api.llama.fi/{api_key}/api/overview/options/',chain,'?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyNotionalVolume'),{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
FROM (
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
{{ config(
|
||||
materialized = 'incremental',
|
||||
unique_key = 'id',
|
||||
enabled = false,
|
||||
full_refresh = false,
|
||||
tags = ['defillama']
|
||||
) }}
|
||||
@ -15,7 +14,7 @@ SELECT
|
||||
FROM (
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET','https://api.llama.fi/overview/options?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyPremiumVolume',{},{}
|
||||
'GET','https://pro-api.llama.fi/{api_key}/api/overview/options?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyPremiumVolume',{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
),
|
||||
@ -29,7 +28,7 @@ options_base AS (
|
||||
SELECT
|
||||
chain,
|
||||
live.udf_api(
|
||||
'GET',CONCAT('https://api.llama.fi/overview/options/',chain,'?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyPremiumVolume'),{},{}
|
||||
'GET',CONCAT('https://pro-api.llama.fi/{api_key}/api/overview/options/',chain,'?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyPremiumVolume'),{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
FROM (
|
||||
|
||||
@ -14,7 +14,7 @@ SELECT
|
||||
FROM (
|
||||
SELECT
|
||||
live.udf_api(
|
||||
'GET','https://api.llama.fi/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyFees',{},{}
|
||||
'GET','https://pro-api.llama.fi/{api_key}/api/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyFees',{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
),
|
||||
@ -28,7 +28,7 @@ fees_base AS (
|
||||
SELECT
|
||||
chain,
|
||||
live.udf_api(
|
||||
'GET',CONCAT('https://api.llama.fi/overview/fees/',chain,'?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyFees'),{},{}
|
||||
'GET',CONCAT('https://pro-api.llama.fi/{api_key}/api/overview/fees/',chain,'?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyFees'),{},{},'Vault/prod/defillama'
|
||||
) AS read,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
FROM (
|
||||
|
||||
@ -11,7 +11,7 @@ WITH api_pull AS (
|
||||
PARSE_JSON(
|
||||
live.udf_api(
|
||||
'GET',
|
||||
'https://api.llama.fi/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyRevenue',{},{}
|
||||
'https://pro-api.llama.fi/{api_key}/api/overview/fees?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=true&dataType=dailyRevenue',{},{},'Vault/prod/defillama'
|
||||
)
|
||||
) :data :protocols AS response,
|
||||
SYSDATE() AS _inserted_timestamp
|
||||
|
||||
Loading…
Reference in New Issue
Block a user