galacticcouncil / galacticcouncil/sdk

SOR: Respect tradeable flag in Omnipool

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
area/sdk kind/enhancement
Dominant language
TypeScript
Stars
28
Forks
32
Avg merge
1d 4h
Merged PRs (30d)
10

Description

functions that are enabled to do with asset is stored in `tradable` bit flags
https://apidocs.bsx.fi/HydraDX/pallets/Omnipool/storage/Assets

hub asset (LRNA) has these flags stored in:
https://apidocs.bsx.fi/HydraDX/pallets/Omnipool/storage/HubAssetTradability

these bitflags can be transformed using the WASM to the following permissions:
```
export function is_sell_allowed(a: number): number;
export function is_buy_allowed(a: number): number;
export function is_add_liquidity_allowed(a: number): number;
export function is_remove_liquidity_allowed(a: number): number;
```

buy / sell should be disabled accorg to these permissions

Contributor guide

Open the contributing guide

Research direction

Start by locating the SOR buy and sell entry points and the WASM bindings for is_buy_allowed and is_sell_allowed. Compare the asset and hub-asset tradability data with the Omnipool Assets and HubAssetTradability references in the issue. Done means buy and sell operations are disabled when their corresponding permissions are not enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, wasm
Domain
api, blockchain
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.