h4wkcreate / close strategy
Updated 2025-01-20
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
-- lending 1 usdc -- 4gY2vuyzJSe7bRtUSMxqcivWx92Ch9sscdJP8WbXTRWPfXJGy13kZ6QXrCRvftcU3U21Sbxhir1YiveacuL5jUqe
---------------------
-- borrowing 0.008 sol with 4 USDC as collateral -- 54iuK4UV5CKFsVnxWVLuhGjtCR9szfXz8enkhpbh28x3KiTGMJv82GrZngXh3wsSHTZXxLAr9kdDP8wu1tuVCUee
-- Create order -> 54iuK4UV5CKFsVnxWVLuhGjtCR9szfXz8enkhpbh28x3KiTGMJv82GrZngXh3wsSHTZXxLAr9kdDP8wu1tuVCUee
-- Refinanced 1 -> oWrxS83WqXjyRbtqWzP177BNqanV8hY3GcsouiEKLhNtMmp6vP18xMG6y62paMJ4qgSAqGMHhQgNrVpk1TnJYeS
-- Refinanced 2 -> 3qgJyfzyMMZof2qFg6fgFWyMwQBtUXuB37Pi2NigrftiNKKxJAqxeJpW57zbxD7EJYSK4KyCFuVn3oTPu7zSkTXh
-- Refinanced 3 -> 3Kw4ZEgKzfsZARQ7acNkW6YXJAK5e2Lgzt1BrmqLPEeQ1rmi5WgWxPRVyNfWMWy66oaFmC4DwPmUeUgufPbz32Z4
-- Repay -> pTCkgD4y8W2Kyk1FteRysR7qDPRiBHuQH71tCsa6ce7xmnkhV3jUJhDTTreTst9wumqSNHRRELqBMDatAFasScu
-- Order = new, Refinanced order = old
-- Loan Vault = new, Refinanced Loan Vault = old
---> Done find lockbox address to get the collateral asset (1oCkVqJ2uk4SuHyCuZKi8q3J6gjoe9Pux3XvHnHFVy4)
---> TODO: Close Strategy (loan closed)
with price as (
select hour::date as price_date,
token_address,
symbol,
decimals,
avg(price) as price
from solana.price.ez_prices_hourly
group by all
)
, abf_events as (
select block_timestamp, tx_id
from solana.core.fact_events
where program_id = 'abfcSQac2vK2Pa6UAJb37DzarVxF15bDTdphJzAqYYp'
and block_timestamp >= '2024-11-05'
UNION
select block_timestamp, tx_id
from solana.core.fact_events_inner
where program_id = 'abfcSQac2vK2Pa6UAJb37DzarVxF15bDTdphJzAqYYp'
and block_timestamp >= '2024-11-05'
QueryRunArchived: QueryRun has been archived