Skip to content

Commit 6c45d4e

Browse files
committed
Update autocrat_v0 to the latest version of openbook_twap
1 parent 12e0f7a commit 6c45d4e

3 files changed

Lines changed: 57 additions & 57 deletions

File tree

Cargo.lock

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/autocratV0.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const CONDITIONAL_VAULT_PROGRAM_ID = new PublicKey(
7474
);
7575

7676
const OPENBOOK_TWAP_PROGRAM_ID = new PublicKey(
77-
"TWAP7frdvD3ia7TWc8e9SxZMmrpd2Yf3ifSPAHS8VG3"
77+
"TWAPrdhADy2aTKN5iFZtNnkQYXERD9NvKjPFVPMSCNN"
7878
);
7979

8080
const OPENBOOK_PROGRAM_ID = new PublicKey(
@@ -465,7 +465,7 @@ describe("autocrat_v0", async function () {
465465

466466
let passSellArgs: PlaceOrderArgs = {
467467
side: Side.Ask,
468-
priceLots: new BN(2000), // 0.2 USDC for 1 META
468+
priceLots: new BN(1100), // 0.11 USDC for 1 META
469469
maxBaseLots: new BN(10),
470470
maxQuoteLotsIncludingFees: new BN(12000),
471471
clientOrderId: new BN(2),
@@ -768,9 +768,9 @@ describe("autocrat_v0", async function () {
768768
banksClient
769769
);
770770

771-
// alice should have gained 1 META & lost 0.2 USDC
771+
// alice should have gained 1 META & lost 0.11 USDC
772772
assert.equal((await getAccount(banksClient, aliceUnderlyingBaseTokenAccount)).amount, 1_000_000_000n);
773-
assert.equal((await getAccount(banksClient, aliceUnderlyingQuoteTokenAccount)).amount, (10_000n * 1_000_000n) - 200_000n);
773+
assert.equal((await getAccount(banksClient, aliceUnderlyingQuoteTokenAccount)).amount, (10_000n * 1_000_000n) - 110_000n);
774774
});
775775

776776
it("rejects proposals when pass price TWAP < fail price TWAP", async function () {
@@ -801,7 +801,7 @@ describe("autocrat_v0", async function () {
801801

802802
let passSellArgs: PlaceOrderArgs = {
803803
side: Side.Ask,
804-
priceLots: new BN(2000), // 0.2 USDC for 1 META
804+
priceLots: new BN(1100), // 0.11 USDC for 1 META
805805
maxBaseLots: new BN(10),
806806
maxQuoteLotsIncludingFees: new BN(12000),
807807
clientOrderId: new BN(2),
@@ -813,7 +813,7 @@ describe("autocrat_v0", async function () {
813813

814814
let failSellArgs: PlaceOrderArgs = {
815815
side: Side.Ask,
816-
priceLots: new BN(5000), // 0.5 USDC for 1 META
816+
priceLots: new BN(3200), // 0.32 USDC for 1 META
817817
maxBaseLots: new BN(10),
818818
maxQuoteLotsIncludingFees: new BN(12000),
819819
clientOrderId: new BN(2),

tests/fixtures/openbook_twap.so

1.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)