Skip to content

7SigmaLLC/dfpy-sql-backend

 
 

Repository files navigation

SQL API for data farming

image

Endpoints

POST /pools

Queries pool_info table.
Queryable fields:

chainID,basetoken,pool_addr,vol_amt,stake_amt,nft_addr,DT_addr,DT_symbol,basetoken_addr,did,url

POST /stakes

Queries pool_stakes table.
Queryable fields:

chainID,basetoken,pool_addr,LP_addr,stake_amt

POST /volume

Queries pool_vols table.
Queryable fields:

chainID,basetoken,pool_addr,vol_amt

POST /rewards

Queries rewards_info table.
Queryable fields:

chainID,pool_addr,LP_addr,amt,token

Request examples

POST /pool_info

"query":{
   "vol_amt":{"$gt":3}
}

Returns the list of pools where the vol_amt is greater than 3.


POST /pool_info

"query":{
  "pool_addr":"0x18b025e44bcd8dafd00638ce87bddbd38c4c38e7"
}

Returns the info for pool with the address 0x18b025e44bcd8dafd00638ce87bddbd38c4c38e7


POST /pool_info

"query":{
  "$or": [
    {
      "$and": {
        "chainID": 4,
        "vol_amt": {
          "$gt": 3
        }
      }
    },
    {
      "$and": {
        "chainID": 1,
        "vol_amt": {
          "$gt": 5
        }
      }
    }
  ]
}

Returns the list of pools where chainID is 4 and vol_amt is greater than 3 or chainID is 1 and vol_amt is greater than 5.


POST /pool_info

"query":{
  "vol_amt":{"$gt":3}
},
"sort":{
  "vol_amt":-1
},
"limit":10

Returns the list of 10 pools where the vol_amt is greater than 3. Sorted by vol_amt descending.


POST /pool_info

"query":{
  "vol_amt":{"$gt":3}
},
"sort":{
  "vol_amt":-1
},
"limit":10,
"offset":10

Same as above + skips the first 10 pools.


POST /rewards_info

{
  "fields": [
    {
      "expression": {
        "pattern": "sum(amt)"
      }
    },
    "pool_addr"
  ],
  "group": "pool_addr"
}

Returns the reward amount per pool.


POST /pool_info

{
  "join": [
    {
      "alias": "t0",
      "type": "left",
      "on": {
        "pool_info.pool_addr": "t0.pool_addr"
      },
      "select": {
        "table": "rewards_info",
        "fields": [
          {
            "expression": {
              "pattern": "sum(amt)"
            }
          },
          "pool_addr"
        ],
        "group": "pool_addr"
      }
    }
  ]
}

Returns the pool list with the total reward amount for each pool.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 99.0%
  • Dockerfile 1.0%