Commit Graph

4 Commits

Author SHA1 Message Date
Serge Farny bf0d748d2d
Serge/deploy v24+ (#945)
* liquidator: randomly select token/perps for rebalancing to avoid failing at every try if one token is having an issue (#921)

(cherry picked from commit e3a7ed9e32)

* liquidator: do not panic if token or perp rebalancing fails (#927)

(cherry picked from commit 0b7e62e671)

* Liquidator: add Sanctum swap (#919)

liquidator: add sanctum swap
(cherry picked from commit 01d5237162)

* liquidator: add more LST for sanctum swap (#944)

(cherry picked from commit c0b61b3b37)
2024-04-22 13:27:15 +02:00
Lou-Kamades db98ba5edf
Use fallback oracles in Rust client (#838)
* rename usd_opt to usdc_opt in OracleAccountInfos

* use fallbacks when fetching bank+ price in AccountFetcher struct

* feat: add derive_fallback_oracle_keys to MangoGroupContext

* test: properly assert failure CU in test_health_compute_tokens_fallback_oracles

* provide fallback oracle accounts in the rust client

* liquidator: update for fallback oracles

* set fallback config in mango services

* support fallback oracles in rust settler + keeper

* fix send error related to fetching fallbacks dynamically in tcs_start

* drop derive_fallback_oracle_keys_sync

* add fetch_multiple_accounts to AccountFetcher trait

* revert client::new() api

* deriving oracle keys uses account_fetcher

* use client helpers for deriving health_check account_metas

* add health_cache helper to mango client

* add get_slot to account_fetcher

* lint

* cached account fetcher only fetches uncached accounts

* ensure keeper client does not use cached oracles for staleness checks

* address minor review comments

* create unique job keys for CachedAccountFetcher.fetch_multiple_accounts

* fmt

* improve hashing in CachedAccountFetcher.fetch_multiple_accounts

---------

Co-authored-by: Christian Kamm <mail@ckamm.de>
2024-01-23 10:26:31 -06:00
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 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