Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
f251378
program: init lp pool
0xbigz Apr 8, 2025
be58c57
cargo fmt --
0xbigz Apr 8, 2025
2cf149d
add total fee fields
0xbigz Apr 8, 2025
b2cf992
add update_target_weights math
0xbigz Apr 9, 2025
a405a56
program: use sparse matrix for constituent map and update tests
0xbigz Apr 18, 2025
34b044c
zero copy accounts, init ix (#1578)
wphan Apr 18, 2025
5d3fd5e
update accounts (#1580)
wphan Apr 21, 2025
9826453
zero copy + permissionless crank ixs (#1581)
moosecat2 Apr 21, 2025
b7e0cab
program: support negative target weights for borrow-lend
0xbigz Apr 21, 2025
57b4ec2
fix tests to work with zero copy
moosecat2 Apr 22, 2025
81dd06e
few comment changes
moosecat2 Apr 22, 2025
73b32d5
remove discriminator from impl macro
moosecat2 Apr 22, 2025
afdfe7b
add get_swap_amount, get_swap_fees, get_weight (#1579)
wphan Apr 23, 2025
9383688
fix swap fee calc (#1582)
wphan Apr 23, 2025
007bace
add init amm mapping to lp context (#1583)
moosecat2 Apr 23, 2025
10d070e
init constituent
moosecat2 Apr 24, 2025
6cd4254
Merge pull request #1584 from drift-labs/nour/init-constituent
moosecat2 Apr 24, 2025
1d7fd00
add initializeLpPool test (#1585)
wphan Apr 24, 2025
be22c24
add add datum ix
moosecat2 Apr 24, 2025
ffd6a51
Merge branch 'bigz/init-lp-pool' into nour/add-mapping-datum
moosecat2 Apr 24, 2025
188ab4e
add init tests and invariant checks
moosecat2 Apr 24, 2025
6353b62
Merge pull request #1587 from drift-labs/nour/add-mapping-datum
moosecat2 Apr 24, 2025
f450cb2
rename data to more useful names
moosecat2 Apr 24, 2025
c803c16
dlp use spl token program (#1588)
wphan Apr 24, 2025
f7fac79
add crank ix
moosecat2 Apr 24, 2025
6bbe40d
update total_weight for validation_flags check
0xbigz Apr 24, 2025
55014a0
push test so far
moosecat2 Apr 24, 2025
4b13618
overriding perp position works
moosecat2 Apr 25, 2025
39726c5
remove message
moosecat2 Apr 25, 2025
222a335
Merge pull request #1589 from drift-labs/nour/crank-constituent-targe…
moosecat2 Apr 25, 2025
bddb41f
fix dup total_weight add
0xbigz Apr 25, 2025
495977f
constituent map remaining accounts
moosecat2 Apr 25, 2025
014b4a3
compiles
moosecat2 Apr 26, 2025
228b94b
bankrun tests pass
moosecat2 Apr 28, 2025
0b7049c
compiles but casting failure in overflow protection test
moosecat2 Apr 28, 2025
9372702
address comment and change token arguments from u64 to u128
moosecat2 Apr 28, 2025
9addd8c
bankrun tests pass
moosecat2 Apr 29, 2025
33dbe08
Merge branch 'nour/crank-aum' into nour/remove-amm-mappings
moosecat2 Apr 29, 2025
5d6f15f
Merge pull request #1595 from drift-labs/nour/remove-amm-mappings
moosecat2 Apr 29, 2025
e950e5d
init constituent token account (#1596)
wphan Apr 29, 2025
f145aa1
update aum calc
moosecat2 Apr 29, 2025
4c8a721
add update /remove mapping ixs
moosecat2 Apr 29, 2025
16ab911
Merge branch 'bigz/init-lp-pool' into nour/crank-aum
moosecat2 Apr 29, 2025
b6ec47c
Merge pull request #1593 from drift-labs/nour/crank-aum
moosecat2 Apr 29, 2025
3923458
fix test - init constituent spot market
wphan Apr 29, 2025
11fed5f
add crank improvements
moosecat2 Apr 29, 2025
8721f9b
crank improvements
moosecat2 Apr 30, 2025
a059f00
passes tests
moosecat2 Apr 30, 2025
cbf3395
precision fix crank aum
moosecat2 Apr 30, 2025
a7830f4
precision fixes and constituent map check for account owner
moosecat2 May 1, 2025
420b85f
Merge pull request #1598 from drift-labs/nour/crank-aum-improvements
moosecat2 May 1, 2025
1c24027
add passthrough account logic (#1602)
moosecat2 May 2, 2025
cb34da4
Wphan/dlp-swap-ixs (#1592)
wphan May 2, 2025
4974540
Merge branch 'master' into bigz/init-lp-pool
wphan May 2, 2025
2589040
post-merge fixes
wphan May 3, 2025
961d6ed
store bumps on accounts (#1604)
moosecat2 May 5, 2025
9bfbab1
address comments
moosecat2 May 7, 2025
b363288
Merge pull request #1611 from drift-labs/nour/address-comments
moosecat2 May 7, 2025
dce2442
Wphan/add liquidity (#1607)
wphan May 8, 2025
8f19f61
program: lp-pool-to-use-target-base-vector (#1615)
0xbigz May 12, 2025
acab7f5
add beta and cost to trade in bps to target datum
moosecat2 May 12, 2025
9f99b1d
add more tests
moosecat2 May 12, 2025
ec2e2f0
Merge pull request #1617 from drift-labs/nour/beta-cost-to-trade
moosecat2 May 13, 2025
db3ad52
add fields to LP events, fix tests (#1620)
wphan May 14, 2025
b9efc52
dlp jup swap (#1636)
moosecat2 May 29, 2025
ee50a60
cleanup
moosecat2 May 29, 2025
1f70026
transfer oracle data ix to constituent (#1643)
moosecat2 May 30, 2025
83e22ec
big cargo test (#1644)
moosecat2 Jun 3, 2025
e980aa7
derivative constituents + better testing + bug fixes (#1657)
moosecat2 Jun 10, 2025
2ae54d1
deposit/borrow working and changing positions (#1652)
moosecat2 Jun 10, 2025
b1fb7a8
sdk: allow custom coder
wphan Jun 17, 2025
81e442a
program: dlp add upnl for settles to amm cache (#1659)
0xbigz Jun 18, 2025
d374e55
remove unused accounts coder
wphan Jun 18, 2025
a4a2f02
move customCoder into sdk, lint
wphan Jun 18, 2025
0871d9d
testing: ix: settle perp to dlp, insufficient balance edge case and i…
moosecat2 Jun 19, 2025
34e9f99
added more settle test coverage and squash bugs (#1689)
moosecat2 Jun 20, 2025
feda828
dlp: add constituentMap (#1699)
wphan Jun 27, 2025
71db8bf
Nour/gauntlet fee impl (#1698)
moosecat2 Jun 27, 2025
7a94a4a
update aum considers amm cache (#1701)
moosecat2 Jun 30, 2025
f5d5a4f
prettify (#1702)
moosecat2 Jun 30, 2025
30fe08f
Wphan/merge master dlp (#1703)
wphan Jun 30, 2025
bd615ea
slot staleness checks (#1705)
moosecat2 Jul 2, 2025
b41cd6e
Nour/derivative constituent testing (#1708)
moosecat2 Jul 2, 2025
7efab3e
merge
crispheaney Jul 4, 2025
c00ebb6
Merge branch 'master' into bigz/init-lp-pool
wphan Jul 4, 2025
4fe3146
Merge branch 'master' into bigz/init-lp-pool
wphan Jul 4, 2025
d5643a1
remove incorrect usage of nav
wphan Jul 4, 2025
6cfa245
Merge remote-tracking branch 'origin/bigz/init-lp-pool' into bigz/ini…
wphan Jul 4, 2025
8be6977
fix adminClient and tests
wphan Jul 4, 2025
99b52ac
Nour/fee grid search testing (#1714)
moosecat2 Jul 6, 2025
6e6813a
Nour/address comments (#1715)
moosecat2 Jul 7, 2025
84569d6
add swap fee unit tests (#1713)
wphan Jul 8, 2025
9ebb39a
Nour/settle accounting (#1723)
moosecat2 Jul 9, 2025
bac790e
dont update lp quote owed unless collateralized
moosecat2 Jul 9, 2025
0e9a454
Nour/settle testing (#1725)
moosecat2 Jul 9, 2025
c5ccdea
prettify
moosecat2 Jul 9, 2025
464e1d3
Nour/address more comments (#1726)
moosecat2 Jul 9, 2025
19c88f8
refactor update_aum, add unit tests (#1727)
wphan Jul 10, 2025
b8a8030
Nour/parameterize dlp (#1731)
moosecat2 Jul 11, 2025
a3e2ee0
Merge branch 'master' into bigz/init-lp-pool
moosecat2 Jul 11, 2025
0bafd5a
fixes
moosecat2 Jul 18, 2025
016dda3
update idl
moosecat2 Jul 21, 2025
5f8f4f0
bug fixes
moosecat2 Jul 21, 2025
839c17d
mostly sdk fixes
moosecat2 Jul 22, 2025
0dffd52
bug fixes
moosecat2 Jul 22, 2025
ee408ae
merge in master and fix conflicts
moosecat2 Jul 23, 2025
edb3039
bug fix and deploy script
moosecat2 Jul 23, 2025
ce30260
merge in master
moosecat2 Jul 23, 2025
e6eef9d
program: new amm oracle (#1738)
moosecat2 Jul 23, 2025
f493187
fix tests (#1764)
moosecat2 Jul 23, 2025
fa47f31
Nour/move ixs around (#1766)
moosecat2 Jul 23, 2025
2bb3ab4
add devnet oracle crank wallet
moosecat2 Jul 23, 2025
35a5939
refactored mm oracle
moosecat2 Jul 24, 2025
bd9c1ac
Merge branch 'master' into nour/mm-oracle-2
moosecat2 Jul 24, 2025
13264f1
sdk changes + cargo fmt
moosecat2 Jul 24, 2025
7015234
fix tests
moosecat2 Jul 24, 2025
10d9178
validate price bands with fill fix
moosecat2 Jul 24, 2025
d6708e2
normalize fill within price bands
moosecat2 Jul 24, 2025
254990e
add sdk warning
moosecat2 Jul 24, 2025
d812fd2
updated type
moosecat2 Jul 24, 2025
7377f16
undefined guard so anchor tests pass
moosecat2 Jul 24, 2025
742ac6c
accept vec for update amm and view amm
moosecat2 Jul 24, 2025
ee40ac8
adjust test to work with new price bands
moosecat2 Jul 24, 2025
ddf3067
Revert "adjust test to work with new price bands"
moosecat2 Jul 24, 2025
607a687
remove price bands logic
moosecat2 Jul 24, 2025
c66099e
add zero ix for mm oracle for reset
moosecat2 Jul 25, 2025
4b5aa72
merge mm oracle refactor
moosecat2 Jul 25, 2025
a886a49
add new drift client ix grouping
moosecat2 Jul 25, 2025
4c36b9f
v1 safety improvements
moosecat2 Jul 26, 2025
406dc91
isolate funding from MM oracle
moosecat2 Jul 26, 2025
4a83337
add cargo tests for amm availability
moosecat2 Jul 26, 2025
9ba8217
change oracle validity log bool to enum
moosecat2 Jul 26, 2025
5588574
address comment
moosecat2 Jul 26, 2025
396cd47
make validate fill direction agnostic
moosecat2 Jul 26, 2025
de784dd
merge master
moosecat2 Jul 28, 2025
6158c74
fix liquidate borrow for perp pnl test
moosecat2 Jul 28, 2025
213d0f2
merge master
moosecat2 Jul 28, 2025
4105ecc
fix tests and address comments
moosecat2 Jul 29, 2025
ce3b2ef
Merge branch 'nour/safety-improvements' into bigz/init-lp-pool
moosecat2 Jul 29, 2025
04c1a3e
Merge branch 'nour/validate-fill-change' into bigz/init-lp-pool
moosecat2 Jul 29, 2025
8451b2d
merge in master
moosecat2 Jul 29, 2025
010e8a3
add RevenueShare and RevenueShareEscrow accounts an init ixs
wphan Aug 1, 2025
dfe4330
fix multiple array zc account, and handling different message types i…
wphan Aug 4, 2025
aa88106
decoding error
wphan Aug 5, 2025
9af0257
merge master
moosecat2 Aug 5, 2025
cd716ea
commit constituent map to barrel file
moosecat2 Aug 5, 2025
df1f5d8
add lp fields to perp market account
moosecat2 Aug 5, 2025
6afc60c
recording orders in RevenueShareEscrow workin
wphan Aug 5, 2025
9da4114
rearrange perp market struct for lp fields
moosecat2 Aug 5, 2025
e93bc21
cancel and fill orders
wphan Aug 6, 2025
2e247b5
Merge remote-tracking branch 'origin/master' into wphan/builder_codes
wphan Aug 6, 2025
35486e9
idl
wphan Aug 6, 2025
35350ba
fix sdk build
wphan Aug 6, 2025
f0e06af
fix math
wphan Aug 6, 2025
a2ffde0
bug fix for notional position tracking
moosecat2 Aug 7, 2025
2ef60ce
update RevenueShareOrder bitflags, store builder_idx instead of pubkey
wphan Aug 7, 2025
fcd1c65
view function
moosecat2 Aug 7, 2025
57e335d
merge RevenueShareOrders on add
wphan Aug 8, 2025
9070282
fee view functions
moosecat2 Aug 8, 2025
5ddfdf1
max aum + whitelist check and removing get_mint_redeem_fee for now
moosecat2 Aug 9, 2025
f2c9f22
add wsol support for add liquidity
moosecat2 Aug 11, 2025
6add765
fix sdk and typing bugs
moosecat2 Aug 12, 2025
101fd6e
update lp pool params ix
moosecat2 Aug 12, 2025
0a2171a
merge master
moosecat2 Aug 12, 2025
300e343
admin override cache and disable settle functions
moosecat2 Aug 12, 2025
b2fe670
remove builder accounts from cancel ixs, wip settle impl
wphan Aug 12, 2025
7b688ad
dont fail settlpnl if no builder users provided
wphan Aug 12, 2025
abc450e
devnet swap working
moosecat2 Aug 12, 2025
d11de9e
finish settle, rename RevenueShare->Builder, RevenueShareEscrow->Buil…
wphan Aug 13, 2025
464ff9b
add more bankrun tests, clean up
wphan Aug 14, 2025
97ef7f7
Merge branch 'master' into wphan/builder_codes
wphan Aug 14, 2025
8ffb821
clean up, fix tests
wphan Aug 14, 2025
7971ab5
why test fail
wphan Aug 14, 2025
6b5142a
dlp taker discovered bug fixes and sdk changes
moosecat2 Aug 14, 2025
28860b1
add subaccountid to BuilderOrder
wphan Aug 14, 2025
e4aafb0
reduce diff
wphan Aug 14, 2025
dca7093
refactor last settle ts to last settle slot
moosecat2 Aug 14, 2025
fabe2ff
add referrals
wphan Aug 15, 2025
84e7c46
add test can fill settle user with no builderescrow
wphan Aug 15, 2025
29fb679
add referral builder feature flag and referral migration method
wphan Aug 15, 2025
8870bad
fix cargo tests, try fix bankrun test timing issue
wphan Aug 15, 2025
3bf665d
Nour/settle pnl fix (#1817)
moosecat2 Aug 15, 2025
2540d55
add log msgs for withdraw and fix casting bug
moosecat2 Aug 19, 2025
9c37f89
Merge remote-tracking branch 'origin/master' into wphan/builder_codes
wphan Aug 20, 2025
6069dd5
add SignedMsgOrderParamsMessageV2
wphan Aug 21, 2025
55d866d
check in for z (#1823)
moosecat2 Aug 22, 2025
bcea62b
zero pad swift messages to make backwards compatible
wphan Aug 25, 2025
e44f43d
PR feedback
wphan Aug 25, 2025
08b7432
add price for lp validates (#1833)
moosecat2 Aug 25, 2025
d6fa03f
update tests/placeAndMakeSignedMsgBankrun.ts to handle client side er…
wphan Aug 25, 2025
15ef9e2
add missing token account reloads and syncs
moosecat2 Aug 26, 2025
86ba8dc
add disabled lp pool swaps by default
moosecat2 Aug 26, 2025
d9382a3
Merge pull request #1836 from drift-labs/nour/admin-can-disable-swap
moosecat2 Aug 26, 2025
f557fb4
refactor account logic for borrows
wphan Aug 26, 2025
3932d27
remove double fee count, update tests to check filled position and qu…
wphan Aug 27, 2025
a2a16c2
more extensive aum logging
moosecat2 Aug 27, 2025
267c5e8
rename Builder -> RevenueShare
wphan Aug 27, 2025
75b9654
Merge remote-tracking branch 'origin/master' into wphan/builder_codes
wphan Aug 27, 2025
06c3909
add test check accumulated builder/ref fees
wphan Aug 27, 2025
00dae75
fix settle multiple pnl accounts, test ref rewards in multiple markets
wphan Aug 28, 2025
404dbbc
express builder fees in tenth of bps
wphan Aug 28, 2025
cd29a8c
update referral migration params
wphan Aug 28, 2025
90cd0bb
PR feedback
wphan Aug 29, 2025
254b9eb
add builder code feature gate
wphan Aug 29, 2025
20d1a47
Merge remote-tracking branch 'origin/master' into wphan/builder_codes
wphan Sep 1, 2025
1f17720
fix tests
wphan Sep 1, 2025
142b10f
add referral fields
wphan Sep 2, 2025
5365402
Merge branch 'wphan/builder_codes' into wphan/merge-builder-codes
wphan Sep 2, 2025
57b0147
run all tests
wphan Sep 2, 2025
d3a7aad
kickoff build
wphan Sep 2, 2025
a4fe692
disable extra instructions, fix builder code feature flag selection
wphan Sep 3, 2025
5db315b
update driftclient
wphan Sep 3, 2025
415f247
Revert recent builder codes chain and merge (#1848)
wphan Sep 4, 2025
eb90de5
Merge branch 'master' into wphan/builder_codes
wphan Sep 4, 2025
e3db97b
clean up account inclusion rules in settle pnl for builder codes
wphan Sep 23, 2025
76e2f2f
Merge branch 'master' into wphan/builder_codes
wphan Sep 23, 2025
cf07e05
Merge remote-tracking branch 'origin/master' into wphan/builder_codes
wphan Sep 23, 2025
3dc10eb
cargo fmt
wphan Sep 23, 2025
cb96b3b
Merge remote-tracking branch 'origin/master' into wphan/builder_codes
wphan Sep 25, 2025
0e9b82f
PR comments, featureflag clean up
wphan Sep 26, 2025
413c87d
move authority check into get_revenue_share_escrow_account
wphan Sep 26, 2025
dd0a964
clean up referrer eligibility check, support placeAndTake/Make referr…
wphan Sep 26, 2025
b5746e4
skip builder fee accrual on full escrow account, dont throw
wphan Sep 26, 2025
47887d2
Merge remote-tracking branch 'origin/master' into wphan/builder_codes
wphan Sep 26, 2025
61f8f4f
add feature flag sdk fn
wphan Sep 27, 2025
e1dc1b0
program: builder codes dont throw tx on missing acc
wphan Sep 29, 2025
7e1b469
placeAndMake respect builder codes
wphan Sep 29, 2025
f161577
ensure update userstats referrerstatus on migration
wphan Sep 29, 2025
86ea2a3
hold back OrderActionRecord idl changes
wphan Sep 29, 2025
fa64671
update CHANGELOG.md
wphan Sep 29, 2025
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Features

- program: builder codes ([#1805](https://github.com/drift-labs/protocol-v2/pull/1805))

### Fixes

### Breaking
Expand Down
5 changes: 5 additions & 0 deletions programs/drift/src/controller/liquidation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ pub fn liquidate_perp(
maker_existing_quote_entry_amount: maker_existing_quote_entry_amount,
maker_existing_base_asset_amount: maker_existing_base_asset_amount,
trigger_price: None,
builder_idx: None,
builder_fee: None,
};
emit!(fill_record);

Expand Down Expand Up @@ -1038,6 +1040,7 @@ pub fn liquidate_perp_with_fill(
clock,
order_params,
PlaceOrderOptions::default().explanation(OrderActionExplanation::Liquidation),
&mut None,
)?;

drop(user);
Expand All @@ -1058,6 +1061,8 @@ pub fn liquidate_perp_with_fill(
None,
clock,
FillMode::Liquidation,
&mut None,
false,
)?;

let mut user = load_mut!(user_loader)?;
Expand Down
1 change: 1 addition & 0 deletions programs/drift/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub mod pda;
pub mod pnl;
pub mod position;
pub mod repeg;
pub mod revenue_share;
pub mod spot_balance;
pub mod spot_position;
pub mod token;
Loading
Loading