Commit Graph

88 Commits

Author SHA1 Message Date
riordanp 24d8a5753a
Merge dev changes (#532)
* Fix script

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fix docs build job (#501)

* workaround where rpc rejects base58 encoded pubkeys (#502)

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Rename settle-bot to settler, fix build (#492)

* Fix settler build, rename due to heroku not liking '-'

* Temporarily remove ref tag

* Remove temporary branch trigger

* Add oracleProvider to Bank and PerpMarket (#491)

* Add oracleProvider to Bank and PerpMarket

* v0.9.6

* Fix null checks on getters for PerpMarket and Bank (#505)

* Export OracleProvider

* Fix null checks on getters

* token_liq_bankruptcy: Use oracle for valuing insurance fund tokens (#503)

Previously a token from the insurance fund was valued at 1 USD. Now it
uses the oracle associated with it (USDC oracle).

* v0.9.7

* ts: Fix ix gate enum, add code for creating a disable-tx gov ix

* Fee buyback: Respect USDC oracle (#504)

* refactor script (#509)

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* IxGateSet: Log AccountBuybackFeesWithMngo state

* TokenRegister: Sanity checks on token_index

* Allow token/market names to fill storage bytes completely

Previously the last byte was always zero.

* HealthRegion: Whitelist allowed instruction types (#508)

This fixes a security issue where bankruptcy related instructions could
be called inside a health region. Now health regions are limited to
compute optimization like when placing multiple orders in one
transaction.

This limitation also makes it impossible to abuse health regions for
flash loans. Use the FlashLoan instructions for that purpose.

* Add fly deploy scripts (#490)

* Bump program version to v0.10.0

* liquidator docs (#512)

* liquidator docs

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* update

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* update

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Quality of life fixes (#511)

* breaking: make pegLimit an optional arg
* pass externally cached blockhashes to sendTransaction
* convenience accessors for connection & walletPk on client

* add script to sim accounts with leverage change (#514)

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fix bug: only account for borrows we are offsetting (#513)

* Fix bug: only account for borrows we are offsetting

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* fix

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Bank: Unittest for net borrow limits

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>

* extend script, fix util function

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fix interest rate computation in client (#520)

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* minor ts fixes

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Temporarily disable health region use on mm script (#507)

* Use new shared mango-feeds-connector crate for chain_data (#515)

* Add prometheus metrics to crank (#517)

* Add prometheus metrics to keeper

* update script

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* fix bug where unrealised profit was not abs'ed

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fix script

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* update script

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* in perp settle fees, dont error, rather return early, this enables blindly concatenating perp settle fees to perp settle pnl (#526)

* in perp settle fees, dont error, rather return early

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* update script

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Net borrow limits: Use correct price for check (#527)

* Changelog for program-v0.10.0 and idl update

* script for grabbing logs

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Perp funding: Fix logging in update funding + deactivate pos (#528)

* update

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fix test

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* sync rate params to latest proposal (#523)

* sync rate params to latest proposal

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Limit funding and interest accrual during downtimes (#529)

Previously, if the funding or interest updating instruction wasn't
called for a long time (like for a solana downtime or the security
council halting the program), the next update would apply funding or
interest for the whole time interval since the last update.

This could lead to a bad downtime situation becoming worse. Instead,
limit the maximum funding and interest time interval to one hour.

* Changelog for program-v0.11.0, bump version, update idl

* Don't reload openorders if there's no active markets

* update

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* reorg

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Emit perp fees settled on update_funding. Required to have a full picture of total perp market fees. (#530)

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <89031858+microwavedcola1@users.noreply.github.com>
Co-authored-by: Christian Kamm <mail@ckamm.de>
Co-authored-by: Maximilian Schneider <mail@maximilianschneider.net>
Co-authored-by: tlrsssss <tjshipe@gmail.com>
Co-authored-by: Nicholas Clarke <nicholasgclarke@gmail.com>
2023-04-07 13:57:53 +01:00
Christian Kamm 9a8cb3c7a9
Add idl-compare script to check for binary incompatibilities (#498) 2023-03-09 08:32:59 +01:00
Christian Kamm 305e646262
CI pipeline for verifiable builds (#496) 2023-03-07 17:28:26 +01:00
microwavedcola1 70b65c5880 Fix more paths
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-21 12:10:21 +01:00
microwavedcola1 0eeda22441 Fix path for docker images
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-02-21 12:05:07 +01:00
Christian Kamm 7b9e19cc08
Organize paths, rename crates (#466)
liquidator, keeper, cli and settle-bot moved to bin/
client moved to lib/client

All crates have a "mango-v4-" prefix
2023-02-20 14:08:38 +01:00
Christian Kamm 7a51ce0619
Add a "settle-bot" binary (#465)
The bot will call settle on all accounts with unsettled pnl where it can
receive either the flat or low-health fee.
2023-02-20 12:09:17 +01:00
Christian Kamm 8916c28b99
License: Mark instructions GPLv3 and everything else MIT (#454)
To do that, split up the Accounts objects and the instruction
implementations.

GPL code is only used when the "enable-gpl" feature is enabled. That
means compiling the program or running tests need explicit feature
activation now.
2023-02-15 08:42:07 +01:00
riordanp 6139c716ba
Add doc generation job (#450)
* Add doc generation job

* Debug cargo doc

* Checkout submodules

* Remove unused build artifacts

* Remove debug commands

* Build on pushes to dev and main
2023-02-13 08:29:50 +01:00
Christian Kamm e65eb79860
CI: Fix soteria action (#443) 2023-02-09 11:28:53 +01:00
silas 5e637c3b79
change 'ci' to 'devops' label (#444) 2023-02-09 10:14:09 +01:00
riordanp e4bcb218a2
Add branch labels to docker images (#441) 2023-02-07 15:48:44 +01:00
silas 3f0ed5978c
ci: add PR labels and combine workflows (#407)
* Automatically labels PRs based on change paths to make it easier to see what is in scope of a PR at a glance
* Merges dependency security scanning into single CI workflows for Rust/TS changes
2023-01-20 13:57:09 +00:00
silas 0da1d5d1ba
Output to security tab (#376) 2023-01-13 16:03:26 +00:00
Christian Kamm 4f0b4da26d
clippy: fix spelling of lint derive_partial_eq_without_eq lint (#377) 2023-01-12 21:40:16 +01:00
microwavedcola1 b4b7085e67
fix clippy (#373)
* fix clippy

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* Fixes from review

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

* add clippy whitelist trait

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-01-12 14:26:55 +01:00
silas 143d90ff23
rs CI improvements (#356)
* remove actionrs and add cache

* add rust version check for log

* add back rc version and allow args

* update to vanity address

* resolve merge conflict

Co-authored-by: Christian Kamm <mail@ckamm.de>
2023-01-10 13:35:16 +00:00
Christian Kamm 6cef8caa34
rust client: Make AccountFetcher futures Send (#357)
This required redoing the cached account fetcher logic to properly deal
with locking and repeated calls while a fetch is ongoing.
2023-01-04 16:15:46 +01:00
Christian Kamm 0ed7175341 Upgrade to solana ~1.14.9
- Update anchor submodule
- Fork and submodule switchboard-v2 package to update dep
2022-12-13 17:00:57 +01:00
Riordan Panayides 2b8e976956 Allow manual docker builds 2022-11-05 13:10:34 +00:00
Riordan Panayides fcfb1e8823 Force build 2022-11-05 13:08:03 +00:00
Riordan Panayides 813fc0996a Run docker build on program changes 2022-11-05 13:05:30 +00:00
Riordan Panayides a0cb6be83f Run action on updates 2022-11-04 17:32:06 +00:00
Riordan Panayides 2b694e553f Merge branch 'dev' of github.com:blockworks-foundation/mango-v4 into dev 2022-11-04 17:21:44 +00:00
Riordan Panayides 014953f30a Restrict docker build paths, run build on main 2022-11-04 17:21:38 +00:00
riordanp df1c2782f1
Use cargo-chef for dependency caching in docker build (#278)
* Try cargo chef for caching build deps in docker

* Run docker build on pan/cargo-chef

* Replace before cheffing

* Fix serum_dex conflict

* Only build what's needed and only once

* Fix typo

* Force liquidator rebuild

* Upgrade vulnerable package lz4-sys

* Revert "Force liquidator rebuild"

This reverts commit c169779542.

* Revert "Temporarily run docker build on branch"

This reverts commit 63ee27eb1e.
2022-11-04 14:30:31 +00:00
silas 7ae8d47e82
update versions 2022-10-18 19:44:14 +01:00
silas 384370ed21
add deps scanning for yarn 2022-10-18 19:40:43 +01:00
silas 9f108ab784
add deps scanning for cargo 2022-10-18 19:36:59 +01:00
silas a5e5851dc1
update file name to harmonise 2022-10-18 19:35:15 +01:00
silas 0ee6157dd0
update action versions, paths and naming 2022-10-18 19:34:28 +01:00
silas c46c219448
add typescript review jobs 2022-10-18 19:29:25 +01:00
silas 423ac1f8a9
remove and replace with trivy 2022-10-18 19:27:52 +01:00
riordanp 4919364d67
Fix keeper dockerfile path 2022-08-31 12:52:30 +01:00
riordanp 3cca63c735
Docker CI Improvements (#195)
* Push separate images for binaries to GCR

* Add base image version arg to heroku deployment

* Test docker build

* Try setting mode

* Fix tags

* switch back to dev

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2022-08-31 11:37:58 +02:00
Riordan Panayides f94c7c3bed Update trigger branch 2022-08-09 12:14:48 +01:00
riordanp 5af39e7956
Merge branch 'dev' into mc/docker 2022-08-08 20:54:31 +01:00
Riordan Panayides e3d69a588d Remove push trigger 2022-08-08 20:32:32 +01:00
Riordan Panayides 458fea705b Force run 2022-08-08 20:29:10 +01:00
Riordan Panayides dbb1c314da Add ci-docker-heroku-deploy.yml 2022-08-08 20:25:56 +01:00
Riordan Panayides e97e8a085a Remove ci-docker-heroku-deploy.yml 2022-08-08 20:24:24 +01:00
Riordan Panayides a53c061d1f Superficial change to force workflow parsing 2022-08-08 20:20:17 +01:00
Riordan Panayides 4024e76bd0 Fix YAML 2022-08-08 20:15:14 +01:00
Riordan Panayides 442b6a6ff0 Fix yaml 2022-08-08 20:14:07 +01:00
Riordan Panayides 2353e94d12 Add heroku deploy workflow 2022-08-08 20:06:27 +01:00
Riordan Panayides bddb0f363e Add bin dockerfiles to subdirectories 2022-08-05 17:50:43 +01:00
Riordan Panayides 74e05d41f8 Fix registry path 2022-08-05 15:51:31 +01:00
Riordan Panayides 4050d0ed4e Fix registry path 2022-08-05 15:50:32 +01:00
Riordan Panayides 69094f4286 Try a different registry path 2022-08-05 15:03:42 +01:00
Riordan Panayides f452b08462 Login to Google Cloud and generate oauth token 2022-08-05 13:49:14 +01:00