Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blocked] feat: adding more fields to vault scalar #77

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0d4d958
feat: adding updateCollateral function
jtfirek Jan 27, 2023
ef9f11b
chore: repushing to add new folder
jtfirek Jan 27, 2023
dce2cc6
chore: generating model for new rows in vault scalar
jtfirek Jan 29, 2023
9c608cb
feat: colat amount for vaults
jtfirek Jan 30, 2023
0a6aa4e
Merge branch 'master' into jacob/addingToVault
jtfirek Jan 30, 2023
25fb5b5
feat: adding depositCollateral
jtfirek Jan 31, 2023
278a195
feat:shell script to run the processor
jtfirek Jan 31, 2023
d8555a7
chore: trying to fix bug
jtfirek Jan 31, 2023
df4015b
fix: bug
jtfirek Jan 31, 2023
69f496b
chore: fixing pr issues
jtfirek Feb 2, 2023
b10c36b
feat: adding pending BTC amount
jtfirek Feb 7, 2023
ffe4b70
feat: adding vault token check in oracle function
jtfirek Feb 7, 2023
1705adc
chore: merging with master
jtfirek Feb 8, 2023
8533013
chore: adding map
jtfirek Feb 9, 2023
6695de1
feat: contiuing to add to the vaults
jtfirek Feb 11, 2023
6bce822
chore: forgot to commit some of yesterdays code
jtfirek Feb 12, 2023
f5694a8
chore: pushing work from last few day
jtfirek Feb 15, 2023
39c8deb
fix: fixing our use of store.get
jtfirek Feb 15, 2023
214210e
Merge branch 'interlay:master' into jacob/addingToVault
jtfirek Feb 16, 2023
84d101a
chore: generating types
jtfirek Feb 16, 2023
8ca162c
chore: getting storage values for thresholds
jtfirek Feb 21, 2023
437a401
chore: types working
jtfirek Feb 21, 2023
ba9b56e
chore: more progress
jtfirek Mar 7, 2023
d57088b
feat: adding more fields to vault
jtfirek Mar 7, 2023
9965474
chore: refactoring oracle
jtfirek Mar 9, 2023
302df31
chore: cleaning code
jtfirek Mar 13, 2023
8fb1420
chore: cleaning code2
jtfirek Mar 13, 2023
ed07d7c
chore: cleaning code3
jtfirek Mar 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restore this file so it doesn't mess with README instructions for quick starts.

Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
# DB_PORT=5432

#Interlay-Firesquid (mainnet)
#ARCHIVE_ENDPOINT=https://interlay.archive.subsquid.io/graphql
#CHAIN_ENDPOINT=wss://api.interlay.io/parachain
#PROCESS_FROM=600000
#SS58_CODEC="interlay"
#BITCOIN_NETWORK="mainnet"
#DB_PORT=5435
ARCHIVE_ENDPOINT=https://interlay.archive.subsquid.io/graphql
CHAIN_ENDPOINT=wss://api.interlay.io/parachain
PROCESS_FROM=600000
SS58_CODEC="interlay"
BITCOIN_NETWORK="mainnet"
DB_PORT=5435

#Kintsugi-Firesquid (mainnet)
#ARCHIVE_ENDPOINT=https://kintsugi.archive.subsquid.io/graphql
#CHAIN_ENDPOINT=wss://api-kusama.interlay.io/parachain
#PROCESS_FROM=540000
#SS58_CODEC="kintsugi"
#BITCOIN_NETWORK='mainnet'
#DB_PORT=5434
# ARCHIVE_ENDPOINT=https://kintsugi.archive.subsquid.io/graphql
# CHAIN_ENDPOINT=wss://api-kusama.interlay.io/parachain
# PROCESS_FROM=540000
# SS58_CODEC="kintsugi"
# BITCOIN_NETWORK='mainnet'
# DB_PORT=5434

#Interlay (testnet)
#ARCHIVE_ENDPOINT=https://api-testnet.interlay.io/subsquid-gateway/graphql
Expand All @@ -30,11 +30,11 @@
#DB_PORT=5436

#Kintsugi (testnet)
ARCHIVE_ENDPOINT=https://api-dev-kintsugi.interlay.io/subsquid-gateway/graphql
CHAIN_ENDPOINT=wss://api-dev-kintsugi.interlay.io/parachain
SS58_CODEC="kintsugi"
BITCOIN_NETWORK='testnet'
DB_PORT=5433
# ARCHIVE_ENDPOINT=https://api-dev-kintsugi.interlay.io/subsquid-gateway/graphql
# CHAIN_ENDPOINT=wss://api-dev-kintsugi.interlay.io/parachain
# SS58_CODEC="kintsugi"
# BITCOIN_NETWORK='testnet'
# DB_PORT=5433

# Params config

Expand Down
7 changes: 6 additions & 1 deletion combined.typegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"VaultRegistry.DecreaseLockedCollateral",
"VaultRegistry.IncreaseLockedCollateral",
"VaultRegistry.RegisterVault",
"VaultRegistry.DepositCollateral",
"VaultRegistry.WithdrawCollateral",
"DexGeneral.AssetSwap",
"DexGeneral.LiquidityAdded",
"DexGeneral.LiquidityRemoved"
Expand All @@ -41,6 +43,9 @@
],
"storage": [
"Issue.IssuePeriod",
"Redeem.RedeemPeriod"
"Redeem.RedeemPeriod",
"VaultRegistry.PremiumRedeemThreshold",
"VaultRegistry.SecureCollateralThreshold",
"VaultRegistry.LiquidationCollateralThreshold"
]
}
15 changes: 0 additions & 15 deletions db/migrations/1675336213853-Data.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions db/migrations/1678203850076-Data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = class Data1678203850076 {
name = 'Data1678203850076'

async up(db) {
await db.query(`ALTER TABLE "vault" DROP COLUMN "status_collateral"`)
await db.query(`ALTER TABLE "vault" ADD "status_collateral" character varying(27) NOT NULL`)
}

async down(db) {
await db.query(`ALTER TABLE "vault" ADD "status_collateral" character varying(16) NOT NULL`)
await db.query(`ALTER TABLE "vault" DROP COLUMN "status_collateral"`)
}
}
7 changes: 7 additions & 0 deletions indexer/interlay.chainVersions.jsonl

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion indexer/testnet.chainVersions.jsonl

Large diffs are not rendered by default.

16 changes: 15 additions & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ enum Token {
KBTC
}

enum CollateralThreshold {
AboveSecureThreshold
BelowSecureThreshold
BelowPremiumRedeemThreshold
Liquidated
}

type NativeToken {
token: Token!
}
Expand Down Expand Up @@ -71,10 +78,17 @@ type Vault @entity {
id: ID!
accountId: String! @index
collateralToken: Currency!
collateralAmount: BigInt!
wrappedToken: Currency!
pendingWrappedAmount: BigInt!
wrappedAmount: BigInt!
collateralization: BigDecimal
statusIssuing: Boolean
statusCollateral: CollateralThreshold!
registrationBlock: Height!
registrationTimestamp: DateTime!
lastActivity: Height
issues: [Issue!]! @derivedFrom(field: "vault")
}

"Mapping of parachain raw/absolute blocks to parachain active blocks"
Expand Down Expand Up @@ -102,7 +116,7 @@ type Issue @entity {
userParachainAddress: String!
vaultWalletPubkey: String!
vaultBackingAddress: String!
vault: Vault!
vault: Vault! @index
period: IssuePeriod!
backingPayment: IssuePayment @derivedFrom(field: "issue")
status: IssueStatus @index
Expand Down
Loading