-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update subgraph pool data * Run prettier * Add ptRate and IBTRate in APRInTime * Change APR to APY in naming * Change precision * Make baseAPY a BigDecimal
- Loading branch information
1 parent
303828c
commit 74a4a72
Showing
16 changed files
with
296 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Address, BigInt } from "@graphprotocol/graph-ts" | ||
|
||
import { APYInTime } from "../../generated/schema" | ||
import { UNIT_BI, ZERO_BD, ZERO_BI } from "../constants" | ||
|
||
export function createAPYInTimeForPool( | ||
poolAddress: Address, | ||
timestamp: BigInt, | ||
blockNumber: BigInt | ||
): APYInTime { | ||
let apyInTime = new APYInTime( | ||
`${poolAddress.toHex()}-${timestamp.toString()}` | ||
) | ||
|
||
apyInTime.createdAtTimestamp = timestamp | ||
apyInTime.block = blockNumber | ||
apyInTime.pool = poolAddress.toHex() | ||
|
||
apyInTime.spotPrice = UNIT_BI | ||
apyInTime.ptRate = ZERO_BI | ||
apyInTime.ibtRate = ZERO_BI | ||
apyInTime.baseAPY = ZERO_BD | ||
apyInTime.exponentAPY = ZERO_BD | ||
|
||
apyInTime.save() | ||
|
||
return apyInTime | ||
} | ||
|
||
export function createAPYInTimeForLPVault( | ||
lpVaultAddress: Address, | ||
timestamp: BigInt | ||
): APYInTime { | ||
let apyInTime = new APYInTime( | ||
`${lpVaultAddress.toHex()}-${timestamp.toString()}` | ||
) | ||
|
||
apyInTime.createdAtTimestamp = timestamp | ||
apyInTime.lpVault = lpVaultAddress.toHex() | ||
|
||
apyInTime.spotPrice = UNIT_BI | ||
apyInTime.ptRate = ZERO_BI | ||
apyInTime.ibtRate = ZERO_BI | ||
apyInTime.baseAPY = ZERO_BD | ||
apyInTime.exponentAPY = ZERO_BD | ||
apyInTime.save() | ||
|
||
return apyInTime | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.