Skip to content

Commit

Permalink
Merge pull request #24 from overlay-market/sepolia
Browse files Browse the repository at this point in the history
Sepolia to Main
  • Loading branch information
TomasCImach authored Aug 12, 2024
2 parents 3a6d9b5 + 851d16f commit 1dcde69
Show file tree
Hide file tree
Showing 16 changed files with 3,850 additions and 393 deletions.
1,152 changes: 1,152 additions & 0 deletions abis/PowerCard.json

Large diffs are not rendered by default.

1,343 changes: 1,343 additions & 0 deletions generated/PowerCard/PowerCard.ts

Large diffs are not rendered by default.

924 changes: 657 additions & 267 deletions generated/schema.ts

Large diffs are not rendered by default.

49 changes: 38 additions & 11 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type AnalyticsHourData @entity {

type Factory @entity {
# factory address
id: ID!
id: Bytes!
# amount of markets created
marketCount: BigInt!
# amount of transactions all time
Expand All @@ -47,7 +47,7 @@ type Factory @entity {

type Market @entity {
# market contract address
id: ID!
id: Bytes!
# feed contract address
feedAddress: String!
# factory contract address
Expand Down Expand Up @@ -127,7 +127,7 @@ type Market @entity {

type MarketState @entity {
# market address
id: ID!
id: Bytes!
market: Market!
bid: BigInt!
ask: BigInt!
Expand All @@ -143,7 +143,7 @@ type MarketState @entity {

type Position @entity {
# market contract concat'd with position id
id: ID!
id: Bytes!
# position id
positionId: String!
# owner of position
Expand Down Expand Up @@ -189,7 +189,7 @@ type Position @entity {

type Transaction @entity {
# txn hash
id: ID!
id: Bytes!
# block txn was included in
blockNumber: BigInt!
# timestamp txn was confirmed
Expand All @@ -206,7 +206,7 @@ type Transaction @entity {

type Build @entity {
# market contract concat'd with position id
id: ID!
id: Bytes!
# account performing action
owner: Account!
# position entitie
Expand All @@ -233,7 +233,7 @@ type Build @entity {

type Unwind @entity {
# market contract concat'd with position id concat'd with unwind number
id: ID!
id: Bytes!
# account performing action
owner: Account!
# position id
Expand Down Expand Up @@ -278,7 +278,7 @@ type Unwind @entity {

type Liquidate @entity {
# market contract concat'd with position id
id: ID!
id: Bytes!
# owner of the position
owner: Account!
# address performing the transaction
Expand Down Expand Up @@ -320,7 +320,7 @@ type Liquidate @entity {

type Account @entity {
# account address
id: ID!
id: Bytes!
# totalRealizedPnl
realizedPnl: BigInt!
# numberOfUnwinds of the account
Expand All @@ -341,6 +341,7 @@ type Account @entity {
tradingMiningEpochVolumes: [TradingMiningEpochVolume!]! @derivedFrom(field: "trader")
tokens: [TokenPosition!]! @derivedFrom(field: "owner")
nfts: [ERC721NFT!]! @derivedFrom(field: "owner")
erc1155Tokens: [ERC1155TokenBalance!]! @derivedFrom(field: "owner")
}

type TokenTransfer @entity(immutable: true) {
Expand Down Expand Up @@ -507,7 +508,7 @@ type TradingMiningEpochVolume @entity {

type TotalSupplyHourData @entity {
# token address concatendated with date
id: ID!
id: Bytes!
# unix timestamp for start of hour
periodStartUnix: Int!
# pointer to token
Expand All @@ -522,7 +523,7 @@ type TotalSupplyHourData @entity {

type MarketHourData @entity {
# market address concatendated with date
id: ID!
id: Bytes!
# unix timestamp for start of hour
periodStartUnix: Int!
# pointer to market
Expand All @@ -538,3 +539,29 @@ type MarketHourData @entity {
oiShort: BigInt!
fundingRate: BigInt!
}

type ERC1155TokenBalance @entity {
id: Bytes! # contract address + tokenId + owner
owner: Account!
token: ERC1155Token!
amount: BigInt!
burnt: BigInt!
}

type ERC1155Token @entity {
id: Bytes! # contract address + tokenId
address: String!
tokenId: BigInt!
totalSupply: BigInt!
totalBurnt: BigInt!
tokenUri: String!
}

type ERC1155Transfer @entity {
id: Bytes! # transaction hash + log index + index of transaction in a batch
token: ERC1155Token!
from: Account!
to: Account!
amount: BigInt!
transaction: Transaction!
}
6 changes: 3 additions & 3 deletions src/__test__/unit/market-factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe("Market Factory events", () => {
describe("Fee Recipient Updated event", () => {
beforeEach(() => {
// initializing factory
loadFactory(factoryAddress.toString())
loadFactory(factoryAddress)
// imitating an event
const event = createFeeRecipientUpdatedEvent(factoryAddress, user, recipientAddress)
handleFeeRecipientUpdated(event)
Expand All @@ -82,7 +82,7 @@ describe("Market Factory events", () => {

describe("Param Updated event", () => {
beforeEach(() => {
loadFactory(factoryAddress.toString())
loadFactory(factoryAddress)
const event = createParamUpdatedEvent(factoryAddress, user, market, paramNameValue, paramValue)
handleParamUpdated(event)
})
Expand All @@ -98,7 +98,7 @@ describe("Market Factory events", () => {

describe("Emergency Shutdown event", () => {
beforeEach(() => {
loadFactory(factoryAddress.toString())
loadFactory(factoryAddress)
const event = createEmergencyShutdownEvent(factoryAddress, user, market)
handleEmergencyShutdown(event)
})
Expand Down
2 changes: 1 addition & 1 deletion src/__test__/unit/market.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe("Market events", () => {
const affiliate = Address.fromString("0x0000000000000000000000000000000000000123")

const ownerReferralPosition = loadReferralPosition(referralAddress, sender)
ownerReferralPosition.affiliatedTo = affiliate.toHexString();
ownerReferralPosition.affiliatedTo = affiliate;
ownerReferralPosition.save()

const affiliateReferralPosition = loadReferralPosition(referralAddress, affiliate)
Expand Down
Loading

0 comments on commit 1dcde69

Please sign in to comment.