Commit Graph

2521 Commits

Author SHA1 Message Date
Christian Kamm 077199ed39
ts: rework getMaxWithdrawWithBorrowForToken (#900)
* ts: rework getMaxWithdrawWithBorrowForToken

* binary seach for maxWithdraw

* tests

* warnings

* revert later, change for debugging

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

* fix looking deeper than 0.5 tokens

* no borrows on no-borrow-tokens

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2024-03-10 14:11:30 +01:00
Adrian Brzeziński ef5da37fba switchboard migrator example 2024-03-08 16:47:24 +01:00
Adrian Brzeziński 6841ca5166 add mangolana, fee and auto retry to create proposal for scripts 2024-03-07 13:27:57 +01:00
microwavedcola1 043b08fcc3 ts: update
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-03-07 09:08:36 +01:00
Adrian Brzeziński b296c23bbe v0.22.5 2024-03-05 17:15:07 +01:00
Adrian Brzeziński 1a6a544ecd
max accounts error margin fcn (#905)
* add error for max accounts limit

* fix
2024-03-05 16:56:35 +01:00
microwavedcola1 8aff0fb8c5 ts: add missing fields
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-03-04 14:28:49 +01:00
microwavedcola1 26e238bcd8 v0.22.3 2024-03-04 13:24:12 +01:00
microwavedcola1 a006b25e39 ts: fix client errors
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-03-04 13:21:42 +01:00
Christian Kamm 27ecc14000 Merge tag 'program-v0.22.0' into deploy 2024-03-04 11:32:42 +01:00
Serge Farny a6ed29b5a1 service-mango-health: read env variable for more configuration entries (#901)
(cherry picked from commit af9b21c430)
2024-03-01 17:08:33 +01:00
Serge Farny acef7278a0 Dockerfile: try to fix issue with cargo-chef not building 2024-03-01 11:59:56 +01:00
Serge Farny 5629017a8a service-mango-health: fix format 2024-03-01 11:44:06 +01:00
Serge Farny a06801db5c service-mango-health: monitors/historizes accounts health (#890)
* service-mango-health:  add a new service that compute health for all mango accounts and persist an history in postgres sql

(cherry picked from commit 6aa8a883f4)
2024-03-01 11:24:56 +01:00
microwavedcola1 cacf668999
ts: account for max swap fee rate, when swapping (#892)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-02-23 09:23:30 +01:00
Christian Kamm e107b281f9 Idl update 2024-02-21 15:06:34 +01:00
Christian Kamm d6a25f0699 Changelog for v0.22.0 2024-02-21 15:06:26 +01:00
Christian Kamm 8f19514a25 Audit v0.22 fixes (#887)
- apply recurring settle allowance constraint also in
  available_settle_limit
- bank constraints on util0, util1
- cleanup
- perp liq: take over oneshot and recurring limits separately

(cherry picked from commit efe4a1ae3d)
2024-02-21 09:01:23 +01:00
Adrian Brzeziński 2e5883324a v0.21.31 2024-02-20 12:54:50 +01:00
Adrian Brzeziński 6aabbb4ded
fix multi cancel (#888)
* fix multi cancel

* fix

* fix
2024-02-20 12:45:06 +01:00
microwavedcola1 4f84f984e8 ts: update script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-02-19 13:30:12 +01:00
microwavedcola1 355bc55955 ts: sort
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-02-19 12:24:39 +01:00
microwavedcola1 654b7b6ad5 v0.21.30 2024-02-19 09:34:21 +01:00
microwavedcola1 f216b7b696
Mc/tcs premium auction (#870)
* tcs: move to premium auctions by default

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

* tcs: error out if premium cant be computed

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

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-02-19 09:32:39 +01:00
Adrian Brzeziński 5bbed4a519
adjust loanoriginafeerate for untrusted (#885) 2024-02-16 11:26:12 +01:00
microwavedcola1 5b001a9002 ts: update script
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-02-15 10:05:20 +01:00
microwavedcola1 4cce7aad32
extend maintain alts script (#872)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-02-08 08:04:52 +01:00
Adrian Brzeziński b2a3e151ab v0.21.29 2024-02-07 17:47:37 +04:00
Adrian Brzeziński 6c29adddae fix conversion for sourceamount (tokens with a lot of decimals) 2024-02-07 17:42:21 +04:00
Christian Kamm 5e4da1dd3c deposit limit: always allow obv1-selling deposits (#869)
Previously serum3_place_order would fail when deposit limits were
exhausted on the payer token side. Now the failure only happens when
payer tokens need to be borrowed.

(cherry picked from commit a4cddf3129)
2024-02-07 14:20:19 +01:00
Christian Kamm 0380b3f097 Settler: Keep going on error (#873)
in particular: don't panic when a health cache can't be constructed

(cherry picked from commit 712a2e3bd6)
2024-02-07 14:18:29 +01:00
Christian Kamm dd9ea78dde Settler: Fix bad health accounts in tcs_start ix (#871)
(cherry picked from commit 9f4cb0f776)
2024-02-07 14:13:14 +01:00
Christian Kamm 1392f726ba fix perp settle limit materialization (#865)
Previously, we tried to keep track of "other" and "trade" realized pnl.
An issue occured when a perp base position went to zero: the way we
computed the trade pnl included potential non-trade unsettled pnl.

That caused follow-up trouble because the value could change sign and
reset the settle limit for trade pnl.

This change aims to simplify in some ways:
- explicitly talk about oneshot-settleable pnl (fees, funding,
  liquidation) and recurring-settleable pnl (materialization of settle
  limit derived from the stable value of the base position when reducing
  the base position)
- instead of directly tracking realized settleable amounts (which
  doesn't really work), just decrease the recurring settleable amount
  when it exceeds the remaining unsettled pnl
- get rid of the directionality to avoid bugs of that kind
- stop tracking unsettled-realized trade pnl (it was wrong before, and
  no client uses it) - we already track position-lifetime realized trade
  pnl

(cherry picked from commit ae5907ba3a)
2024-02-01 11:24:39 +01:00
Adrian Brzeziński ea7eeb92dc
fix decoding of broken oracle (#864)
* fix

* fix

* fix

* fix
2024-01-31 15:52:06 +01:00
microwavedcola1 e16a7db8dd Merge branch 'main' into deploy 2024-01-30 12:19:45 +01:00
Christian Kamm 699321653a delegate withdraw: require target to have expected owner
(cherry picked from commit 719aee37ae)
2024-01-29 15:13:54 +01:00
Christian Kamm 5253db8495 allocator: Don't allow growth beyond heap memory region
(cherry picked from commit afc2ff9e80)
2024-01-29 15:13:52 +01:00
Adrian Brzeziński 80cad71af5 add set to deepclone 2024-01-28 14:34:04 +01:00
Christian Kamm 39c5d029d0 Program version bump, changelog and idl update 2024-01-26 12:39:31 +01:00
Christian Kamm f28d665048 Update openbook v1 fast listing default parameter (#841)
(cherry picked from commit 53bc52efe7)
2024-01-26 12:06:57 +01:00
Christian Kamm 93d109b4ed Allow fast listing admin to register openbook v1 markets (#839)
(cherry picked from commit 857dcb397f)
2024-01-26 12:06:47 +01:00
Christian Kamm 8f593e00b8 perp: Add platform liquidation fee for base (#858)
(cherry picked from commit fcc8c85f6e)
2024-01-26 10:25:35 +01:00
Christian Kamm a4e5cf9b02 Add a token-token platform liquidation fee (#849)
The liqor liquidation fee and platform liquidation fee for the asset and
liab token are both payed by the liqee.

The platform liquidation fee is added to the Bank's
collected_fees_native and tracked in collected_liquidation_fees.

(cherry picked from commit 8383109f0d)
2024-01-26 10:25:27 +01:00
Christian Kamm 5f97f60719 Configurable interest rate for 0% utilization (#848)
(cherry picked from commit 18729cf04c)
2024-01-26 10:25:13 +01:00
microwavedcola1 9797ce70d7 v0.21.27 2024-01-24 14:29:52 +01:00
microwavedcola1 e079f199c2
ts: use potential serum tokens in deposit limits (#857)
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2024-01-24 14:26:33 +01:00
Adrian Brzeziński 84882a8d20 v0.21.24 2024-01-23 00:13:37 +01:00
Adrian Brzeziński 774ab42df8 upgrade mangolana 2024-01-23 00:11:23 +01:00
Adrian Brzeziński 5f6d75fb68 v0.21.23 2024-01-22 19:00:10 +01:00
Adrian Brzeziński e69214f408
max borrow fix (#855)
* fix

* ts: compute correct init scaled asset weight

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

---------

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
Co-authored-by: microwavedcola1 <microwavedcola@gmail.com>
2024-01-22 18:56:50 +01:00