Skip to content

l0c4t0r/uniswap-v3-performance

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analytics

VISR Token Endpoints

VISR token basic stats

GET /visr/basicStats

Returns basic stats about the VISR token

Response:

{
	"priceUSD": 1.0422319100795823, 
	"totalDistributed": 225157.93851120802, 
	"totalDistributedUSD": 354463.44960261334, 
	"totalStaked": 13531192.19599181, 
	"totalSupply": 100000000.0
}

VISR token staking yields

GET /visr/yield

Returns yield related data for the VISR token

Daily is calculated using the most recent day data.

Weekly is calculated using the most recent 7 day data.

Monthly is calculated using the most recent 30 day data.

Response:

{
	"daily": {
		"apy": 0.1517809650893731, 
		"estimatedAnnualDistribution": 2053777.410317091, 
		"estimatedAnnualDistributionUSD": 2247482.29752211, 
		"yield": 0.00041583826051883044
	},
	"weekly": {
		"apy": 0.13972700006103891, 
		"estimatedAnnualDistribution": 1865138.9157595846, 
		"estimatedAnnualDistributionUSD": 2534726.2017299226, 
		"yield": 0.0026796958915815683
	},
	"monthly": {
		"apy": 0.30411554158684123, 
		"estimatedAnnualDistribution": 3424276.9815246225, 
		"estimatedAnnualDistributionUSD": 5390798.296039745, 
		"yield": 0.019996638350915585
	}
}

Daily VISR distribution

GET /visr/dailyDistribution

Returns the amount of VISR distributed per day.

5 days by default, this can be adjusted by sending the days parameter

Response:

{
  "feeDistribution": [
    {
      "desc": "4,832 VISR Distributed", 
      "id": 2, 
      "title": "July 08, 2021"
    }, 
    {
      "desc": "3,472 VISR Distributed", 
      "id": 3, 
      "title": "July 07, 2021"
    }, 
    {
      "desc": "6,661 VISR Distributed", 
      "id": 4, 
      "title": "July 05, 2021"
    }, 
    {
      "desc": "10,403 VISR Distributed", 
      "id": 5, 
      "title": "July 03, 2021"
    }, 
    {
      "desc": "7,361 VISR Distributed", 
      "id": 6, 
      "title": "July 02, 2021"
    }
  ]
}

Uniswap V3 Hypervisor endpoints

Top level aggregated stats

GET /hypervisors/aggregateStats totalFeesClaimedUSD is USD

TVL has a 400k buffer at the moment to take into account closed beta positions

Response:

{
	"pairCount": 2, 
	"totalFeesClaimedUSD": 12841.893746720685, 
	"totalValueLockedUSD": 1052607.6932798002
}

Recently collected fees

GET /hypervisors/recentFees

Returns fees collected in the last 24 hours. The period can be modified by sending the hours parameter.

Response:

{
	"fees": {
		"grossFeesUSD": 8072.334992053622, 
		"grossFeesVISR": 7752.871811219713, 
		"netFeesUSD": 7265.101494049108, 
		"netFeesVISR": 6977.584631251066, 
		"protocolFeesUSD": 807.233498004513, 
		"protocolFeesVISR": 775.2871799686459
	}, 
	"periodHours": 24
}

Hypervisor Basic Stats

GET /hypervisor/<hypervisorAddress>/basicStats

Get cumulative stats about fees generated by hypervisor

grossFeesClaimedUSD is the total fees claimed from uniswap protocolFeesCollectedUSD is the total fees (10%) collected by Visor for VISR buyback and distribution to VISR stakers feesReinvestedUSD is gross fees minus protocol fees, these are reinvested into the uniswap position after each rebalance

Response:

{
	"id": "0x9a98bffabc0abf291d6811c034e239e916bbcec0",  
	"grossFeesClaimedUSD": "15910.10972755193251893566594460868", 
	"protocolFeesCollectedUSD": "1591.010965054488422528855185123715",
	"feesReinvestedUSD": "14319.09876249744409640681075948498", 
	"tvlUSD": "795874.8306677932804462177386957058"
}

Hypervisor returns

GET /hypervisor/<hypervisorAddress>/returns

Get stats related to returns calculated using the most recent daily/weekly/monthly data

Response:

{
	"hypervisor": "0x9a98bffabc0abf291d6811c034e239e916bbcec0", 
	"returns": {
		"daily": {
			"cumFeeReturn": 0.012640184493185824, 
			"feeApr": 4.656187384531289, 
			"feeApy": 102.18029213532452, 
			"totalPeriodSeconds": 85611.0
		}, 
		"monthly": {
			"cumFeeReturn": 0.07161614564526353, 
			"feeApr": 6.352486355699216, 
			"feeApy": 543.3968639875819, 
			"totalPeriodSeconds": 355528.0
		}, 
		"weekly": {
			"cumFeeReturn": 0.07161614564526353, 
			"feeApr": 6.352486355699216, 
			"feeApy": 543.3968639875819, 
			"totalPeriodSeconds": 355528.0
		}
	}
}

All hypervisor returns

GET /hypervisors/returns

Get stats related to returns calculated using the most recent daily/weekly/monthly data for ALL hypervisors

Response:

{
  "0x09b8d86c6275e707155cdb5963cf611a432ccb21": {
    "daily": {
      "cumFeeReturn": 0.0025895779926869977, 
      "feeApr": 0.9981291595660754, 
      "feeApy": 1.70950754393257, 
      "totalPeriodSeconds": 81818.0
    }, 
    "monthly": {
      "cumFeeReturn": 0.020502573303036842, 
      "feeApr": 1.0619043775418842, 
      "feeApy": 1.8874179316359543, 
      "totalPeriodSeconds": 608877.0
    }, 
    "weekly": {
      "cumFeeReturn": 0.020371796472323123, 
      "feeApr": 1.0737696530067824, 
      "feeApy": 1.9217808701189476, 
      "totalPeriodSeconds": 598308.0
    }
  }, 
  ...
  "0x18d3284d9eff64fc97b64ab2b871738e684aa151": {
    "daily": {
      "cumFeeReturn": 0.003232720797256894, 
      "feeApr": 1.702295669621517, 
      "feeApy": 4.464859244435365, 
      "totalPeriodSeconds": 59888.0
    }, 
    "monthly": {
      "cumFeeReturn": 0.057164421519664055, 
      "feeApr": 1.5369376610111896, 
      "feeApy": 3.635346051196099, 
      "totalPeriodSeconds": 1172941.0
    }, 
    "weekly": {
      "cumFeeReturn": 0.04786421857173351, 
      "feeApr": 2.566364875295517, 
      "feeApy": 11.902030647243988, 
      "totalPeriodSeconds": 588165.0
    }
  }
}

All Hypervisor Data

GET /hypervisors/allData

Get all latest useful data for all hypervisors

Response:

{
  "0x032c4e67fa01f6c3b01d0903d672d73b2f8d9dce": {
    "capacityUsed": "No cap", 
    "decimals0": 18, 
    "decimals1": 18, 
    "depositCap0": 1.157920892373162e+59, 
    "depositCap1": 1.157920892373162e+59, 
    "maxTotalSupply": 0, 
    "observationIndex": "0", 
    "poolAddress": "0xcd83055557536eff25fd0eafbc56e74a1b4260b3", 
    "poolFeesUSD": "238243.8132098102578987264563502838", 
    "poolTvlUSD": "8210196.990103881962712220969744398", 
    "returns": {
      "daily": {
        "cumFeeReturn": 0.0, 
        "feeApr": 0, 
        "feeApy": 0, 
        "totalPeriodSeconds": 0
      }, 
      "monthly": {
        "cumFeeReturn": 0.0, 
        "feeApr": 0, 
        "feeApy": 0, 
        "totalPeriodSeconds": 0
      }, 
      "weekly": {
        "cumFeeReturn": 0.0, 
        "feeApr": 0, 
        "feeApy": 0, 
        "totalPeriodSeconds": 0
      }
    }, 
    "sqrtPrice": "5194954499130605945949899211", 
    "tick": "-54496", 
    "totalSupply": 0, 
    "tvl0": 0.0, 
    "tvl1": 0.0, 
    "tvlUSD": "0"
  }, 
  ...
}

Charting Endpoints

Visor Finance Dashboard

GET /dashboard

All data used for dashboard

Response:

{
  "feeCumulativeFeeDistributed": 370536.5737831378, 
  "feeCumulativeFeeDistributedAnnual": 2220034.2857142854, 
  "feeCumulativeFeeUsd": 449861.0550215234, 
  "feeCumulativeFeeUsdAnnual": 1633879.9773082633, 
  "feeStatsAmountVisr": 4832.0, 
  "feeStatsFeeAccural": 4157.342166244254, 
  "feeStatsStakingApr": 0.16659683342450002, 
  "feeStatsStakingApy": 0.18123302000049968, 
  "feeStatsStakingDailyYield": 0.0031950077643054797, 
  "id": 2, 
  "stakedAmount": 13744658.013716914, 
  "stakedUsdAmount": 11825589.056505034, 
  "uniswapFeesBasedApr": "165%", 
  "uniswapFeesGenerated": 191832.3372774014, 
  "uniswapPairAmountPairs": 14, 
  "uniswapPairTotalValueLocked": 3952783.027803304, 
  "visrPrice": 0.8603771039412778
}

Daily Total Value Locked

GET /visr/dailyTvl

Parameters: days: specify how many days of data to return, default 20

Returns data for plotting the daily TVL chart

Response:

{
  "data": [
    {
      "date": "2021-07-09T00:00:00Z", 
      "group": "MATIC-WETH", 
      "value": 75722.32094085723
    }, 
    {
      "date": "2021-07-08T00:00:00Z", 
      "group": "MATIC-WETH", 
      "value": 71736.50304179122
    }, 
    {
      "date": "2021-07-07T00:00:00Z", 
      "group": "MATIC-WETH", 
      "value": 76702.43929888491
    }, 
    {
      "date": "2021-07-06T00:00:00Z", 
      "group": "MATIC-WETH", 
      "value": 70528.60971291398
    }, 
    {
      "date": "2021-07-05T00:00:00Z", 
      "group": "MATIC-WETH", 
      "value": 68066.23221701225
    }, 
    {
      "date": "2021-07-09T00:00:00Z", 
      "group": "WETH-GTC", 
      "value": 250840.78329538702
    ...
  ]  
}

Hypervisor Base Range Chart

GET /charts/baseRange/<hypervisor_address>

Parameters: days: specify how many days of data to return, default 20

Returns data to plot price chart with base range bands.

Response:

{
  "0x09b8d86c6275e707155cdb5963cf611a432ccb21": [
    {
      "date": "2021-07-01T21:21:08Z", 
      "group": "MATIC-WETH", 
      "max": 0.0005633407208100223, 
      "min": 0.00045663990777634303, 
      "value": 0.0005096973634525789
    }, 
    {
      "date": "2021-07-01T21:24:34Z", 
      "group": "MATIC-WETH", 
      "max": 0.0005633407208100223, 
      "min": 0.00045663990777634303, 
      "value": 0.0005097709374719882
    }, 
    {
      "date": "2021-07-01T21:33:36Z", 
      "group": "MATIC-WETH", 
      "max": 0.0005633407208100223, 
      "min": 0.00045663990777634303, 
      "value": 0.0005098445114913974
    }, 
    ...
  ]
}

All Hypervisor Base Range Chart

GET /charts/baseRange/all

Parameters: days: specify how many days of data to return, default 20

Returns data to plot price chart with base range bands. This is same as Hypervisor Base Range Chart but returns all hypervisors

Benchmark Chart

GET /charts/benchmark/<hypervisorAddress>

Parameters: startDate: Set start date for chart (YYYY-MM-DD) endDate: Set start date for chart (YYYY-MM-DD)

Returns data to plot hypervisor returns against various benchmarks

Response:

{
  "0x97491b65c9c8e8754b5c55ed208ff490b2ee6190": [
    {
      "date": "2021-06-18T00:00:00Z", 
      "group": "Hypervisor", 
      "value": 1.0
    }, 
    {
      "date": "2021-06-19T00:00:00Z", 
      "group": "Hypervisor", 
      "value": 0.9788681219249996
    }, 
    {
      "date": "2021-06-20T00:00:00Z", 
      "group": "Hypervisor", 
      "value": 1.0030726571948547
    },
    ...
  ]
}

User/Vault Data

User data

GET /user/<user_address>

Get visors owned by users and positions in hypervisors

Response:

{
  "0x04a0b6732d8c03c598a005471721176f15182aae": {  // Visor
    "0x6c8116abe5c5f2c39553c6f4217840e71462539c": {  //Hypervisor
      "balance0": 60.7040491828372, 
      "balance1": 0.0745740786468935, 
      "balanceUSD": 217.1838873830843, 
      "shareOfSupply": 0.0006500671724555293, 
      "shares": "65740489139965549"
    }, 
    "0x97491b65c9c8e8754b5c55ed208ff490b2ee6190": {  //Hypervisor
      "balance0": 1.1937978153737167e-05, 
      "balance1": 7.10377272450416e-05, 
      "balanceUSD": 0.5411936546845825, 
      "shareOfSupply": 2.4106312955619674e-06, 
      "shares": "259716650867521"
    }, 
    "0x9a98bffabc0abf291d6811c034e239e916bbcec0": {  //Hypervisor
      "balance0": 0.03544642552690304, 
      "balance1": 32.68156773074734, 
      "balanceUSD": 107.019510359322, 
      "shareOfSupply": 8.247170845679256e-05, 
      "shares": "121597648"
    }
  }, 
  "0xcf033df6ef13454d12e6625063f482e927aa4571": {}
}

Visor data

GET /vault/<user_address>

Get positions of vaults

Response:

{
  "0x6c8116abe5c5f2c39553c6f4217840e71462539c": {
    "balance0": 60.7040491828372, 
    "balance1": 0.0745740786468935, 
    "balanceUSD": 217.1838873830843, 
    "owner": "0xab44ae2ba15a0004d0308b04dd04797176372366", 
    "shareOfSupply": 0.0006500671724555293, 
    "shares": 65740489139965549
  }, 
  "0x97491b65c9c8e8754b5c55ed208ff490b2ee6190": {
    "balance0": 1.1937978153737167e-05, 
    "balance1": 7.10377272450416e-05, 
    "balanceUSD": 0.5411936546845825, 
    "owner": "0xab44ae2ba15a0004d0308b04dd04797176372366", 
    "shareOfSupply": 2.4106312955619674e-06, 
    "shares": 259716650867521
  }, 
  "0x9a98bffabc0abf291d6811c034e239e916bbcec0": {
    "balance0": 0.03544642552690304, 
    "balance1": 32.68156773074734, 
    "balanceUSD": 107.019510359322, 
    "owner": "0xab44ae2ba15a0004d0308b04dd04797176372366", 
    "shareOfSupply": 8.247170845679256e-05, 
    "shares": 121597648
  }
}

Bollinger Bands

Chart data for bollinger bands

GET /charts/bollingerbands/<poolAddress>

To get bollinger bands for a specific pool

with these paramaters:

poolAddress: address of pool

periodHours: The total period in hours

Misc

Subgraph Status

GET /status/subgraph

Gets current status of subgraph

Response:

{
  "latestBlock": 12978109, 
  "url": "https://api.thegraph.com/subgraphs/name/visorfinance/visor"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%