1
1
import { manualCliff , manualLinear } from "../adapters/manual" ;
2
2
import adapter from "../adapters/uniswap/uniswap" ;
3
- import { Protocol } from "../types/adapters" ;
4
- import { periodToSeconds } from "../utils/time" ;
3
+ import { CliffAdapterResult , Protocol } from "../types/adapters" ;
4
+ import { queryCustom } from "../utils/queries" ;
5
+ import { periodToSeconds , readableToSeconds } from "../utils/time" ;
5
6
6
7
// some missing from uni somewhere
7
8
const start = 1600106400 ;
9
+
10
+ const merklRewards = async ( ) : Promise < CliffAdapterResult [ ] > => {
11
+ const data = await queryCustom ( `
12
+ SELECT
13
+ toStartOfDay(timestamp) AS date,
14
+ SUM(reinterpretAsUInt256(reverse(unhex(substring(data, 3))))) / 1e18 AS amount
15
+ FROM evm_indexer.logs
16
+ PREWHERE topic0 = '0xf7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd3992683'
17
+ AND address IN (
18
+ '0x3ef3d8ba38ebe18db133cec108f4d14ce00dd9ae'
19
+ )
20
+ WHERE topic2 IN (
21
+ '0x0000000000000000000000001f9840a85d5af5bf1d1762f925bdaddc4201f984',
22
+ '0x0000000000000000000000008f187aa05619a017077f5308904739877ce9ea21'
23
+ )
24
+ GROUP BY date
25
+ ORDER BY date DESC;
26
+
27
+ ` , { } ) ;
28
+
29
+ const result : CliffAdapterResult [ ] = [ ] ;
30
+ for ( let i = 0 ; i < data . length ; i ++ ) {
31
+ result . push ( {
32
+ type : "cliff" ,
33
+ start : readableToSeconds ( data [ i ] . date ) ,
34
+ amount : Number ( data [ i ] . amount ) ,
35
+ isUnlock : false ,
36
+ } ) ;
37
+ }
38
+ return result ;
39
+ } ;
40
+
8
41
function uniswap ( ) : Protocol {
9
42
const community = async ( ) =>
10
43
Promise . all (
@@ -17,6 +50,7 @@ function uniswap(): Protocol {
17
50
) ;
18
51
return {
19
52
community,
53
+ incentives : merklRewards ,
20
54
airdrop : manualCliff ( start , 150000000 ) ,
21
55
"LP staking" : manualLinear (
22
56
start ,
@@ -30,9 +64,10 @@ function uniswap(): Protocol {
30
64
sources : [ "https://uniswap.org/blog/uni" ] ,
31
65
token : "ethereum:0x1f9840a85d5af5bf1d1762f925bdaddc4201f984" ,
32
66
protocolIds : [ "2196" , "2197" , "2198" ] ,
67
+ notes : [ "We track incentives when user claimed their rewards" ]
33
68
} ,
34
69
categories : {
35
- farming : [ "community" ] ,
70
+ farming : [ "community" , "incentives" ] ,
36
71
airdrop : [ "airdrop" ] ,
37
72
privateSale : [ "investors" ] ,
38
73
insiders : [ "team" , "advisors" ] ,
0 commit comments