Skip to content
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

Market and oracle modules #1

Draft
wants to merge 24 commits into
base: v23.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c531a5c
Added impl of market module, added proto files
yuraolex Mar 22, 2024
dc0f0f8
Fixed cmd for market swap, refactored market module
yuraolex Mar 22, 2024
2b86b77
Updated last commit
yuraolex Mar 22, 2024
12358cf
Updated localnet osmosis doc
yuraolex Mar 22, 2024
c592fc9
Added oracle module, added first batch of tests for market module
yuraolex Mar 29, 2024
ba94f98
Added more tests for oracle module
yuraolex Mar 29, 2024
d4c46f8
Added unit test for market and oracle module, added receive permissio…
yuraolex Apr 5, 2024
56103d3
Removed old handler for oracle module
yuraolex Apr 5, 2024
6dbac40
Updated swap by remains stable coin in the vault, updated tests ans d…
yuraolex Apr 5, 2024
35213fc
renamed some methods to be consistent with others
yuraolex Apr 5, 2024
f8c9fe5
Removed unused
yuraolex Apr 5, 2024
a5e67cc
Fixed multinode script
yuraolex Apr 18, 2024
2091076
Added sleep beetween sending for multinode script
yuraolex Apr 18, 2024
c85ee1b
Updated multinode script
yuraolex Apr 19, 2024
45a16c9
Added reserve vault for market module
yuraolex Apr 19, 2024
a16f1ed
Upgraded swap using exchange vault for native coins, added tests
yuraolex Apr 19, 2024
601de3f
Merged with v23.x
yuraolex Apr 23, 2024
da7cc59
Generated protofile changes
invalid-email-address Apr 23, 2024
2090055
Reverted back settings changes
yuraolex Apr 23, 2024
7e59039
Merge branch 'feature/market-module' of github.com:Orchestra-Labs/sym…
yuraolex Apr 23, 2024
485f35c
Linted
yuraolex Apr 23, 2024
27f58dc
Fixed typos
yuraolex Apr 23, 2024
7523ec8
Updated multinode-local-testnet script
yuraolex Apr 24, 2024
d205f98
chore: change banner
dblackstone1 May 9, 2024
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
Prev Previous commit
Next Next commit
Added reserve vault for market module
  • Loading branch information
yuraolex committed Apr 19, 2024
commit 45a16c99e4c6d561cf532437ce2fa3b59973a354
7 changes: 5 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibc "github.com/cosmos/ibc-go/v7/modules/core"
markettypes "github.com/osmosis-labs/osmosis/v23/x/market/types"
oracletypes "github.com/osmosis-labs/osmosis/v23/x/oracle/types"

"github.com/osmosis-labs/osmosis/v23/ingest/sqs"
Expand Down Expand Up @@ -124,8 +125,10 @@ var (

// module accounts that are allowed to receive tokens.
allowedReceivingModAcc = map[string]bool{
protorevtypes.ModuleName: true,
oracletypes.ModuleName: true,
protorevtypes.ModuleName: true,
oracletypes.ModuleName: true,
markettypes.ModuleName: true,
markettypes.ReserveModuleName: true,
}

// TODO: Refactor wasm items into a wasm.go file
Expand Down
1 change: 1 addition & 0 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ var moduleAccountPermissions = map[string][]string{
valsetpreftypes.ModuleName: {authtypes.Staking},
poolmanagertypes.ModuleName: nil,
markettypes.ModuleName: {authtypes.Minter, authtypes.Burner},
markettypes.ReserveModuleName: {authtypes.Minter, authtypes.Burner},
oracletypes.ModuleName: nil,
cosmwasmpooltypes.ModuleName: nil,
}
Expand Down
5 changes: 5 additions & 0 deletions x/market/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func NewKeeper(
panic(fmt.Sprintf("%s module account has not been set", types.ModuleName))
}

// ensure reserve market module account is set
if addr := accountKeeper.GetModuleAddress(types.ReserveModuleName); addr == nil {
panic(fmt.Sprintf("%s module account has not been set", types.ReserveModuleName))
}

// set KeyTable if it has not already been set
if !paramstore.HasKeyTable() {
paramstore = paramstore.WithKeyTable(types.ParamKeyTable())
Expand Down
5 changes: 5 additions & 0 deletions x/market/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ func (AppModuleBasic) Name() string {
return types.ModuleName
}

// ReserveName returns the reserve market module's name
func (AppModuleBasic) ReserveName() string {
return types.ReserveModuleName
}

// RegisterLegacyAminoCodec registers the module's types on the given LegacyAmino codec.
func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
types.RegisterLegacyAminoCodec(cdc)
Expand Down
2 changes: 2 additions & 0 deletions x/market/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const (
// ModuleName is the name of the market module
ModuleName = "market"

ReserveModuleName = "reserve_market"

// StoreKey is the string store representation
StoreKey = ModuleName

Expand Down