Skip to content

Commit e696653

Browse files
acamillCryptoMaxPlanckcnek
authored
v3.0.2 <- v3.1.0 (#129)
* Acammm/anchor 0.22.0 (#126) * - ProgramResult -> Result<()> * Use error! * use error from anchor * Add Check for Unchecked accountsInfo * WIP trying to make it work but seems that devnet is having issues. Pausing for now * feat: accounting suite for accounting tests (#125) * feat: accounting suite for accounting tests * added more checks * working * changed back to test_development * Edit rebase error * Update latest uxd-client * Yarn lock * resynchronise a random dev key to enable the replace script * bump version * Acammm/ppov2 (place_perp_order_v2) (#131) * Use new anchor-comp package for mango CPI * remove old CPI helpers * Safe changes (w/o mint/redeem/rebalance) * Use place_perp_order_v2 and simplify code * Working * Update tests (most logic been offloaded to Mango) * Remove uneeded accounts + explicit ATA checks * allow 100% slippage * Improve computing for tests * Slippage tweaks - Slippage u32 -> u16 - 0 slippage accepted again (was disabled due to previous code but that's been refactored) * Fix comments + mango 3.4.1 * Acam/enforce limit price (#132) * Update mango 3.4.1 * fix comment * Enforce limit price through providing it from front end * Cleanup * Ken comments * idl * json idl * Update latest client (was locally linked) * Add 2.3.1 to changelog * Cleanup post merge * Update yarn lock * Acam/enhancement wo 01 (#144) * Add zo-abi WIP zo Stash pop stash pop WIP Cpi almost there. More updates Currently doesn't work with yarn so kinda annoying, let's wait for them to fix this as discussed in the TG Toward cpi support.. Toward cpi support.. almost there Update reserved padding Update IDL and client version (still using yarn link) Fixes Working Init zo deposiroty + tests Init Control account in the program for simplicity Mint WIP Cargo audit fix Working register with OO account creationg Mint issue with CPI Update client * wip ZO - issue with constraint. Will add anchor latest for more info to debug * Deposit mint * Redeem and mint - Computing issue. Breakpoiint will transit to 0copy * Redeem withdraw and controller as zero_copy Require! * Update PR feedback * Use latest client (private) Use accountLoader for mango depository * Fixing test slowly... * More test updates and fixes * Update latest 01 version * Fixed tests * ZO Cleanup (Make a branc without any ZO change for clarity) * Updated idl * add the mistakenly erased bank keypair * Fix memory layout of accounts * Use the oss version of the client and ditch the private one * simplified assertion (#147) * Chore/fix tests (#149) * Use udx-protocol on NPM instead of private gh version * Misc * Fixed mint * Working integration tests * Offering to Clippy gods + fmt * New program ID + resident program for CI * Update CI * npm ci Co-authored-by: Bamboozelino <memail> * Usdc minting/redeeming of the PnL (#148) * first * instructions (#139) * instructions * comments * api * rename * math * start on tests * wip tests * require * fixes with accounts and merge * quote_redeem (#140) * quote_redeem * comments * fixed comments and mango check * a * poggers * latest * save * nothing * save * math fixes * save * Invalid Blockhash * for remote version * Feature/positive minting and more (#151) * quote_redeem * comments * fixed comments and mango check * a * poggers * latest * save * nothing * save * math fixes * save * Fix memory layout of accounts * Use the oss version of the client and ditch the private one * Invalid Blockhash * for remote version * simplified assertion (#147) * save changes * save * Chore/fix tests (#149) * Use udx-protocol on NPM instead of private gh version * Misc * Fixed mint * Working integration tests * Offering to Clippy gods + fmt * New program ID + resident program for CI * Update CI * npm ci Co-authored-by: Bamboozelino <memail> * committed * save * progress Co-authored-by: Acammm <alexcamill@gmail.com> Co-authored-by: Ken C <ctk2012ac@gmail.com> Co-authored-by: acammm <40299747+acamill@users.noreply.github.com> * Work with max * misc - added test to ensure user has UXD - formatting - account mutability for mango * Added test quote test to CI * - fix quoteMintAndRedeemSuite switch cases - fix quote mint and redeem test asserts - changed equals to close_to * testing improvements - adding accounting tests for quoteMint and quoteRedeem - incorporate accounting tests into test suite * - small test fix * Test working Co-authored-by: Max Planck <maxplanck.crypto@gmail.com> Co-authored-by: Max Planck <99688618+CryptoMaxPlanck@users.noreply.github.com> Co-authored-by: Ken C <ctk2012ac@gmail.com> Co-authored-by: Bamboozelino <memail> * Upgrade CI * Cleanup + test fixes * Update package.json and lock * Update client version to beta next * fix import * Update CI * Update CI * Mango explorer replacement * Update CI * Update Readme * Update CI * Use older solana version for more successful deployments * Update CI * added ix to disable minting (#152) * added new ix * minor * updated idl * updated naming * updated idl * added ix to disable minting - integration test (#153) * added integration test * updated naming * Update CI * fmt + ci * Update uxd-client to beta3 * Update CI * Disable MM in CI must be ran from the side now update CI * Add back the program ID to the IDL * Cleanup * Swap program ID in the constants * CI fix + readme * Add missing user ata * fix ci * Fix ci transfers * Fix quote mint redeem * Fixes * Add log for rebalancing lite amount * Fix rebalancing CI * Fix quote mint/redeem * Logs * Fix CI * Audit 2 Fixes (#160) * updated cargo.toml (#158) * fix the accounting for the redeem_from_mango_depository ix (#157) * Update the conditions for quote (mint and redeem) (#162) * Update the conditions for quote (mint and redeem) after talking with Soteria todo: add tests to try minting/redeeming beyond the adjusted_unreliazed_pnl (SHOULD FAIL) todo: update tests to verify that the opration should pass or not before running the test (if there isn't enough unrealized PnL to do an operation the test should fail properly) * added test coverage * fixes - add require for minting_disabled in quote_mint - change update_onchain for quote_mint to add redeemable_minted_amount * Update @lamine feedback - Don't double dip on the quote mint amount * Add support + tests for quote_mint_redeem_soft_cap * fix tests Co-authored-by: Max Planck <maxplanck.crypto@gmail.com> * audit 2 fixed: info6 (naming and minor fix) (#163) * fixed comment about bps * fixed naming * Update mango_depository.rs Eng Co-authored-by: acammm <40299747+acamill@users.noreply.github.com> * Fee rounding issue, floor when negative to keep the same behaviour (#164) * Fee rounding issue, floor when negative to keep the same behavior * Update order_delta.rs * Coherent operations for accounting (#166) * Fix/info 5 checks quotemint (#167) * Add check for the quote * Update IDL + tests * updated test naming (#165) Co-authored-by: Ken C <ctk2012ac@gmail.com> Co-authored-by: Max Planck <99688618+CryptoMaxPlanck@users.noreply.github.com> Co-authored-by: Max Planck <maxplanck.crypto@gmail.com> * Update mango version to use v3.4.6 + use latest anchor-comp (0.2.3) * fixed test (#171) * fix e2e tests * dev state for cargo.toml * FMT Co-authored-by: Max Planck <99688618+CryptoMaxPlanck@users.noreply.github.com> Co-authored-by: Ken C <ctk2012ac@gmail.com> Co-authored-by: Max Planck <maxplanck.crypto@gmail.com> Co-authored-by: Bamboozelino <memail>
1 parent 4784be4 commit e696653

106 files changed

Lines changed: 10678 additions & 6635 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci-anchor-test.yml

Lines changed: 190 additions & 256 deletions
Large diffs are not rendered by default.

.github/workflows/ci-cargo-lint-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Lint and Test
22

33
on:
44
push:
5-
branches: [main, v*.*, acam/soteria-audit*]
5+
branches: [main, v*.*]
66

77
env:
88
CARGO_TERM_COLOR: always
9-
SOLANA_VERSION: 1.9.7
9+
SOLANA_VERSION: 1.8.16
1010
RUST_TOOLCHAIN: nightly-2022-02-01
1111

1212
defaults:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Soteria Audit
2+
# Update to match your branch names and requirements
3+
on:
4+
push:
5+
branches: [main, v*.*]
6+
pull_request:
7+
branches: [main, v*.*]
8+
9+
jobs:
10+
audit:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check-out the repository
14+
uses: actions/checkout@v2
15+
- name: Soteria Audit
16+
continue-on-error: false # set to true if you don't want to fail jobs
17+
uses: silas-x/soteria-action@main
18+
with: # remove if not passing arguments below
19+
# solana-version: "1.9.14" # not required
20+
run-mode: "-analyzeAll" # not required
21+
cargo-com: "." # not required
22+
program-path: "." # not required

.github/workflows/ci-soteria.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ test-ledger/
1616
/programs/uxd/.coderrect/**
1717
/programs/uxd/target/**
1818
/programs/uxd/Cargo.lock
19-
yarn-error.log
2019
programs/uxd/src/lib.rs.bak
2120
.gitignore
2221
Anchor.toml.bak

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const modifiedConfig = {
2+
arrowParens: 'avoid',
3+
bracketSpacing: true,
4+
quoteProps: 'as-needed',
5+
semi: false,
6+
tabWidth: 2,
7+
trailingComma: 'none',
8+
useTabs: false,
9+
singleQuote: true,
10+
jsxSingleQuote: true,
11+
spaceBeforeFunctionParen: false,
12+
printWidth: 100,
13+
bracketSameLine: true
14+
}
15+
16+
module.exports = modifiedConfig

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"Marketv",
3030
"mngo",
3131
"mochawesome",
32+
"MSRM",
3233
"NPMRC",
3334
"orderbook",
3435
"oustanding",
@@ -55,6 +56,6 @@
5556
"thiserror",
5657
"Tjpk",
5758
"UXDATA",
58-
"WSOLATA"
59+
"WSOLATA",
5960
]
6061
}

Anchor.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ wallet = "~/.config/solana/id.json"
66
uxd = "UXD8m9cvwk4RcSxnX2HZ9VudQCEeDH6fRnB4CAP57Dr"
77

88
[programs.devnet]
9-
uxd = "BA67esrWE7cPzQWtAftaTbrVWtmHZJ1PbbBBpZgpjH4p"
9+
uxd = "9PjjDLyfxPmnMRNZ8L5WFZBsqjaZZihfh2x6H4QWLGQF"
1010

1111
[registry]
1212
url = "https://anchor.projectserum.com"
1313

1414
[scripts]
1515
# The quick version for development - Keep this version as the CI swap this line for its needs
16-
# test = "yarn ts-mocha --require tests/fixtures.ts -p ./tsconfig.json -t 500000 tests/test_development.ts --reporter mochawesome --require mochawesome/register --reporter-options quiet=true,reportTitle=uxdprogram-test_integration --trace-warnings"
16+
test = "npx ts-mocha --require tests/fixtures.ts -p ./tsconfig.json -t 500000 tests/test_development.ts --reporter mochawesome --require mochawesome/register --reporter-options quiet=true,reportTitle=uxdprogram-test_integration --trace-warnings"
1717
# Sol only version
18-
test = "yarn ts-mocha --require tests/fixtures.ts -p ./tsconfig.json -t 500000 tests/test_ci_sol.ts --reporter mochawesome --require mochawesome/register --reporter-options quiet=true,reportTitle=uxdprogram-test_integration --trace-warnings"
18+
# test = "npx ts-mocha --require tests/fixtures.ts -p ./tsconfig.json -t 500000 tests/test_ci_sol.ts --reporter mochawesome --require mochawesome/register --reporter-options quiet=true,reportTitle=uxdprogram-test_integration --trace-warnings"
1919
# Longer version
20-
# test = "yarn ts-mocha --require tests/fixtures.ts -p ./tsconfig.json -t 500000 tests/test_integration.ts --reporter mochawesome --require mochawesome/register --reporter-options quiet=true,reportTitle=uxdprogram-test_integration --trace-warnings"
20+
# test = "npx ts-mocha --require tests/fixtures.ts -p ./tsconfig.json -t 500000 tests/test_integration.ts --reporter mochawesome --require mochawesome/register --reporter-options quiet=true,reportTitle=uxdprogram-test_integration --trace-warnings"

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# CHANGELOG
22

3+
## [Unreleased]
4+
5+
- Use place_perp_order_v2 to save computing and reduce composability issues
6+
- Pass a limit_price in place of the slippage to ensure execution price match user expectations
7+
- Add `01` support (mint/redeem/depositories creation)
8+
- Remove init_if_needed (and remove Rent and Associated Token Program from inputs)
9+
- Updates Anchor to version 0.24.2
10+
311
## v3.0.2 (audit report fixes Soteria)
412

513
Deployed: Mar 31, 2022 at 08:50:52 UTC | Slot: 127,530,926
614

715
1. Remove un needed passthrough accounts through the app to save computing
816

9-
## v3.0.0 (audited Soteria)
17+
## v3.0.1 (audited Soteria)
1018

1119
Deployed: | Slot:
1220

0 commit comments

Comments
 (0)