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

feat: liquidity webhooks #1782

Merged
merged 25 commits into from
Sep 13, 2023
Merged

feat: liquidity webhooks #1782

merged 25 commits into from
Sep 13, 2023

Conversation

sabineschaller
Copy link
Member

@sabineschaller sabineschaller commented Aug 24, 2023

Changes proposed in this pull request

  • allows admins to add liquidity threshold for assets and peers using the admin API
  • fires webhook event when asset or peer liquidity falls below liquidity threshold
  • MASE defines liquidity thresholds and deals with webhook event
  • updates postman collection
  • adds event handler doc page to docs
  • still todo: Admin UI

Context

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Documentation added
  • Make sure that all checks pass
  • Postman collection updated

@netlify
Copy link

netlify bot commented Aug 24, 2023

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 6f5611f
🔍 Latest deploy log https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/6500531055739b0008e09e8a

@github-actions github-actions bot added type: tests Testing related pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. type: source Changes business logic pkg: mock-ase labels Aug 24, 2023
@github-actions github-actions bot added pkg: documentation Changes in the documentation package. type: documentation (archived) Improvements or additions to documentation labels Sep 8, 2023
@sabineschaller sabineschaller marked this pull request as ready for review September 8, 2023 10:47
@JoblersTune
Copy link
Collaborator

JoblersTune commented Sep 11, 2023

There are still mentions of updateAssetWithdrawalThreshold in

  • packages/documentation/src/content/docs/apis/backend/mutations.md
  • packages/documentation/src/content/docs/apis/backend/schema.mdx
  • documentation/src/schema-dumps/backend_raw_schema.md

The schema dump also doesn't contain the liquidity threshold field when explaining Assets or Peers.

@sabineschaller
Copy link
Member Author

There are still mentions of updateAssetWithdrawalThreshold in

* packages/documentation/src/content/docs/apis/backend/mutations.md

* packages/documentation/src/content/docs/apis/backend/schema.mdx

* documentation/src/schema-dumps/backend_raw_schema.md

The schema dump also doesn't contain the liquidity threshold field when explaining Assets or Peers.

@huijing could you help with that? Are these files generated or did you write them? They contain a lot of html.

@@ -8,6 +8,7 @@ exports.up = function (knex) {
table.smallint('scale').unsigned().notNullable()

table.bigInteger('withdrawalThreshold').nullable()
table.bigInteger('liquidityThreshold').nullable()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add these fields as a new migration? Something that we started doing here since it's friendler to existing deployments (e.g. testnet): #1522 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense. I wasn't aware of the discussion and not thinking this through.

@huijing
Copy link
Contributor

huijing commented Sep 12, 2023

There are still mentions of updateAssetWithdrawalThreshold in

* packages/documentation/src/content/docs/apis/backend/mutations.md

* packages/documentation/src/content/docs/apis/backend/schema.mdx

* documentation/src/schema-dumps/backend_raw_schema.md

The schema dump also doesn't contain the liquidity threshold field when explaining Assets or Peers.

@huijing could you help with that? Are these files generated or did you write them? They contain a lot of html.

That was generated by the graphql-markdown plugin. Can you tell me what the expected output should be? Basically, I generate the raw-schema dump then move the output into the schema.mdx file. As for the mutation.md, that is a legacy file copied over from before the Astro migration.

@sabineschaller
Copy link
Member Author

That was generated by the graphql-markdown plugin. Can you tell me what the expected output should be? Basically, I generate the raw-schema dump then move the output into the schema.mdx file. As for the mutation.md, that is a legacy file copied over from before the Astro migration.

I changed the endpoint to be updateAsset instead of being updateAssetWithdrawalThreshold.

@sabineschaller
Copy link
Member Author

@huijing I ran the docs generation command but only 1 file was updated:

  • documentation/src/schema-dumps/backend_raw_schema.md

The following 2 were not updated:

  • packages/documentation/src/content/docs/apis/backend/mutations.md
  • packages/documentation/src/content/docs/apis/backend/schema.mdx

@sabineschaller sabineschaller merged commit e26c8a8 into main Sep 13, 2023
25 checks passed
@sabineschaller sabineschaller deleted the s2-liquidity-webhooks branch September 13, 2023 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: backend Changes in the backend package. pkg: documentation Changes in the documentation package. pkg: frontend Changes in the frontend package. pkg: mock-ase type: documentation (archived) Improvements or additions to documentation type: source Changes business logic type: tests Testing related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webhook events for low asset and peer liquidity
6 participants