-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CloseMarket function to redeem rent from permissioned markets #191
Open
Henry-E
wants to merge
26
commits into
project-serum:master
Choose a base branch
from
Henry-E:CloseMarkets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
bbf78b7
first compiling attempt at adding close markets
Henry-E 9be141f
create test that inits a serum market, test passing
Henry-E e20b46f
Merge branch 'master' of github.com:project-serum/serum-dex into Clos…
Henry-E 693e8ff
add test that sol is retrieved + get request queue sol back as well
Henry-E 941c1f8
add readme
Henry-E 2acfbfc
added queuesAreEmpty checks
Henry-E cf1f18f
Merge branch 'master' of github.com:project-serum/serum-dex into Clos…
Henry-E 9bc76a8
disable market; add extra wrapped program function for tests
Henry-E 185a322
some code
tomland123 f675805
some code
tomland123 6a2b052
more clear errors
Henry-E 660dc0a
Merge branch 'CloseMarkets' of github.com:Henry-E/serum-dex into Clos…
Henry-E f75cb09
update gitignore
Henry-E a0d62f2
delete package lock
Henry-E 42a4f00
Finished tests
tomland123 ad57550
Merge branch 'CloseMarkets' of https://github.com/Henry-E/serum-dex i…
tomland123 b1783eb
Finished tests
tomland123 2ecdd2b
Finished tests
tomland123 e328c0a
Finished tests
tomland123 b88d783
Finished tests
tomland123 2876856
Delete package.json
Henry-E 0eaa838
Delete validator-1639598743617.log
Henry-E 787fd82
remove test ledger + run cargo fmt
Henry-E fab0783
add close market test to travis CI
Henry-E 6a3bab2
make sure tests work
Henry-E 97f9596
Merge branch 'project-serum:master' into CloseMarkets
Henry-E File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[programs.localnet] | ||
close_markets = "Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS" | ||
|
||
[test] | ||
startup_wait = 20000 | ||
|
||
[registry] | ||
url = "https://anchor.projectserum.com" | ||
|
||
[provider] | ||
cluster = "localnet" | ||
wallet = "~/.config/solana/id.json" | ||
|
||
[[test.genesis]] | ||
address = "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin" | ||
program = "../../target/deploy/serum_dex.so" | ||
|
||
[scripts] | ||
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[workspace] | ||
members = [ | ||
"programs/*" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Migrations are an early feature. Currently, they're nothing more than this | ||
// single deploy script that's invoked from the CLI, injecting a provider | ||
// configured from the workspace's Anchor.toml. | ||
|
||
const anchor = require("@project-serum/anchor"); | ||
|
||
module.exports = async function (provider) { | ||
// Configure client to use the provider. | ||
anchor.setProvider(provider); | ||
|
||
// Add your deploy script here. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "close-markets", | ||
"version": "1.0.0", | ||
"description": "This repo demonstrates how to create, utilize and then close a permissioned serum market", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@project-serum/anchor": "^0.20.0", | ||
"@project-serum/anchor-cli": "^0.20.0", | ||
"@project-serum/serum": "^0.13.61", | ||
"@solana/spl-token": "^0.1.8", | ||
"mocha": "^9.1.3", | ||
"ts-mocha": "^8.0.0", | ||
"typescript": "^4.5.4" | ||
}, | ||
"scripts": { | ||
"test": "anchor test", | ||
"build": "yarn build:dex && anchor build", | ||
"build:dex": "cd ../../ && cargo build-bpf && cd tests/permissioned/" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "close-markets" | ||
version = "0.1.0" | ||
description = "Created with Anchor" | ||
edition = "2018" | ||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] | ||
name = "close_markets" | ||
|
||
[features] | ||
no-entrypoint = [] | ||
no-idl = [] | ||
cpi = ["no-entrypoint"] | ||
default = [] | ||
|
||
[dependencies] | ||
anchor-lang = "0.19.0" | ||
anchor-spl = {version = "0.19.0", features = ["dex"]} | ||
serum_dex = { path = "../../../..", features = ["no-entrypoint"]} | ||
solana-program = "1.8.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[target.bpfel-unknown-unknown.dependencies.std] | ||
features = [] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should use
Closed
instead ofDisabled
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serum already has the functionality for
Disabled
built in from the ability to manually shutdown. I didn't find anything similar forClosed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/project-serum/serum-dex/blob/master/dex/src/state.rs#L1884 - Here's where
new order
already checks for whether a market is disabled. Is this functionality different from closing? It's possible I haven't fully understood the full extent of what thedisable
flag affects