rkedia145

rkedia145

Member Since 9 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
8
repos

9 contributions in the last year

Pinned
⚡ Dispersion Trading using Options
Activity
Dec
3
3 days ago
Activity icon
fork

rkedia145 forked mrharicot/monodepth

⚡ Unsupervised single image depth prediction with CNNs
rkedia145 Updated
fork time in 3 days ago
Nov
30
6 days ago
Activity icon
issue

rkedia145 issue comment Bella-DeFinTech/uniswap-v3-bot

rkedia145
rkedia145

Build error: no exported member

Hi Bella Team,

I'm trying to build this project (I ran 'tsc'), and I'm getting the following error:

src/EventDBManager.ts:4:10 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'DateConverter'.

4 import { DateConverter, JSBIDeserializer } from "uniswap-v3-simulator";
           ~~~~~~~~~~~~~

src/EventDBManager.ts:4:25 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'JSBIDeserializer'.

4 import { DateConverter, JSBIDeserializer } from "uniswap-v3-simulator";
                          ~~~~~~~~~~~~~~~~

test/Backtest.test.ts:4:3 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'TickMath'.

4   TickMath,
    ~~~~~~~~

test/Backtest.test.ts:5:3 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'LiquidityMath'.

5   LiquidityMath,
    ~~~~~~~~~~~~~

test/Backtest.test.ts:6:3 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'FullMath'.

6   FullMath,
    ~~~~~~~~

test/LogDBManager.ts:2:10 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'DateConverter'.

2 import { DateConverter } from "uniswap-v3-simulator";
           ~~~~~~~~~~~~~


Found 6 errors.

I can get around this for now by manually copying over these files, but if there is a better way to resolve this please let me know! Since uniswap-v3-simulator is a npm package I don't think i need to add a reference to the other project in ts-config...

rkedia145
rkedia145

@neptune-v fantastic, thank you! I've gotten by importing the files locally, but i'll transition to the new package.

Nov
19
2 weeks ago
Activity icon
issue

rkedia145 issue Bella-DeFinTech/uniswap-v3-bot

rkedia145
rkedia145

Build error: no exported member

Hi Bella Team,

I'm trying to build this project (I ran 'tsc'), and I'm getting the following error:

src/EventDBManager.ts:4:10 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'DateConverter'.

4 import { DateConverter, JSBIDeserializer } from "uniswap-v3-simulator";
           ~~~~~~~~~~~~~

src/EventDBManager.ts:4:25 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'JSBIDeserializer'.

4 import { DateConverter, JSBIDeserializer } from "uniswap-v3-simulator";
                          ~~~~~~~~~~~~~~~~

test/Backtest.test.ts:4:3 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'TickMath'.

4   TickMath,
    ~~~~~~~~

test/Backtest.test.ts:5:3 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'LiquidityMath'.

5   LiquidityMath,
    ~~~~~~~~~~~~~

test/Backtest.test.ts:6:3 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'FullMath'.

6   FullMath,
    ~~~~~~~~

test/LogDBManager.ts:2:10 - error TS2305: Module '"uniswap-v3-simulator"' has no exported member 'DateConverter'.

2 import { DateConverter } from "uniswap-v3-simulator";
           ~~~~~~~~~~~~~


Found 6 errors.

I can get around this for now by manually copying over these files, but if there is a better way to resolve this please let me know! Since uniswap-v3-simulator is a npm package I don't think i need to add a reference to the other project in ts-config...

Activity icon
issue

rkedia145 issue comment Bella-DeFinTech/uniswap-v3-simulator

rkedia145
rkedia145

Usage Example

Hello Team,

This tool looks exceptionally useful, I am producing components on Nethereum for integrating with UniswapV3, and was looking for a way to simulate Positions, your tool would be amazing to use.

Do you have any usage examples?

I can see the intent is to stream in events into the Library some how, after configuring a pool. You have checked in some DBs to get started, but do you have a Gist or similar of a basic usage?

Create Pool Stream Events Get Positions/Pool State Exit

var client = await SimulatorClient.buildInstance();
var configurablePool = client.initCorePoolFromConfig(
    SimulatorClient.buildPoolConfig(60, "USDC", "ETH", FeeAmount.MEDIUM)
);

let sqrtPriceX96ForInitialization = JSBI.BigInt("4295128739");
await configurablePool.initialize(sqrtPriceX96ForInitialization);
let pools = await client.simulatorRoadmapManager.listRoutes();
console.log(pools); // <-- We have a Pool

for(var OneEvent in AllMyEvents)
{
    configurablePool.PushEventIntoPool(OneEvent)
    var myFees = configurablePool.Posititions.MyPosition.feeGrowthInside0X128;
    console.log('My Stacks: ' + myFees);
}
rkedia145
rkedia145

@neptune-v @kafeikui ah I just found the answer to my question. The amountSpecified is not used in the v3-simulator, but in the v3-bot. Thanks!

Nov
18
2 weeks ago
Activity icon
issue

rkedia145 issue comment Bella-DeFinTech/uniswap-v3-simulator

rkedia145
rkedia145

add events download script

This script will download events(mint, burn, swap) of Uniswap v3 core pool on mainnet to sqlite database. Set up pool address and block range(both left and right edge included), then run it by: yarn hardhat run scripts/Events.ts

rkedia145
rkedia145

Hi @kafeikui , I'm trying to run this script, but i'm getting a 'SQLITE_ERROR: no such table: liquidity_events_usdc_weth_3000' error. Could you please provide details on how to correctly set up a db so that this script could run? I would also like to run this for other pools...

Activity icon
issue

rkedia145 issue comment Bella-DeFinTech/uniswap-v3-simulator

rkedia145
rkedia145

add events download script

This script will download events(mint, burn, swap) of Uniswap v3 core pool on mainnet to sqlite database. Set up pool address and block range(both left and right edge included), then run it by: yarn hardhat run scripts/Events.ts

rkedia145
rkedia145

Hi @kafeikui , I tried running this script, and I'm getting the following error:

[email protected]:uniswap-v3-simulator$ yarn hardhat run scripts/Events.ts yarn run v1.22.15 $ /Users/xyz/projects/src/mfin/defi_independent_study/uniswap-v3-simulator/node_modules/.bin/hardhat run scripts/Events.ts No need to generate any newer typings. TypeError: (0 , dayjs_1.default) is not a function at Function.DateConverter.formatDate (/Users/xyz/projects/src/mfin/defi_independent_study/uniswap-v3-simulator/src/util/DateConverter.js:12:39) at /Users/xyz/projects/src/mfin/defi_independent_study/uniswap-v3-simulator/test/EventDBManager.js:65:57 at /Users/xyz/projects/src/mfin/defi_independent_study/uniswap-v3-simulator/node_modules/knex/lib/execution/transaction.js:221:22 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Any suggestions for how to fix this?

Activity icon
issue

rkedia145 issue comment Bella-DeFinTech/uniswap-v3-simulator

rkedia145
rkedia145

Usage Example

Hello Team,

This tool looks exceptionally useful, I am producing components on Nethereum for integrating with UniswapV3, and was looking for a way to simulate Positions, your tool would be amazing to use.

Do you have any usage examples?

I can see the intent is to stream in events into the Library some how, after configuring a pool. You have checked in some DBs to get started, but do you have a Gist or similar of a basic usage?

Create Pool Stream Events Get Positions/Pool State Exit

var client = await SimulatorClient.buildInstance();
var configurablePool = client.initCorePoolFromConfig(
    SimulatorClient.buildPoolConfig(60, "USDC", "ETH", FeeAmount.MEDIUM)
);

let sqrtPriceX96ForInitialization = JSBI.BigInt("4295128739");
await configurablePool.initialize(sqrtPriceX96ForInitialization);
let pools = await client.simulatorRoadmapManager.listRoutes();
console.log(pools); // <-- We have a Pool

for(var OneEvent in AllMyEvents)
{
    configurablePool.PushEventIntoPool(OneEvent)
    var myFees = configurablePool.Posititions.MyPosition.feeGrowthInside0X128;
    console.log('My Stacks: ' + myFees);
}
rkedia145
rkedia145

Hi @neptune-v, @kafeikui ,

Thanks for the detailed responses! One more followup:

I understand what you mean about how 'swapEventDB.addAmountSpecified' is a one time pre-processing step (my understanding is that essentially the parameters of the swap event, namely amount0 and amount1, will not precisely line up with the original amountSpecified that was passed into the swap function, so you do a trial-and-error approach to figure out which value of amountSpecified results in the amount0 and amount1 seen on the event, correct?).

However, after the 'amount_specified' is saved to the DB, and that line is commented out, I don't actually see where amount_specified is being used again. In the current ConfigurableCorePool.test.ts, when tryWithDryRun and trySwap are called, it is still passing in either param.amount0, or param.amount1, not param.amountSpecified. Could you please clarify if this is the correct behavior?

Activity icon
issue

rkedia145 issue comment Bella-DeFinTech/uniswap-v3-simulator

rkedia145
rkedia145

Usage Example

Hello Team,

This tool looks exceptionally useful, I am producing components on Nethereum for integrating with UniswapV3, and was looking for a way to simulate Positions, your tool would be amazing to use.

Do you have any usage examples?

I can see the intent is to stream in events into the Library some how, after configuring a pool. You have checked in some DBs to get started, but do you have a Gist or similar of a basic usage?

Create Pool Stream Events Get Positions/Pool State Exit

var client = await SimulatorClient.buildInstance();
var configurablePool = client.initCorePoolFromConfig(
    SimulatorClient.buildPoolConfig(60, "USDC", "ETH", FeeAmount.MEDIUM)
);

let sqrtPriceX96ForInitialization = JSBI.BigInt("4295128739");
await configurablePool.initialize(sqrtPriceX96ForInitialization);
let pools = await client.simulatorRoadmapManager.listRoutes();
console.log(pools); // <-- We have a Pool

for(var OneEvent in AllMyEvents)
{
    configurablePool.PushEventIntoPool(OneEvent)
    var myFees = configurablePool.Posititions.MyPosition.feeGrowthInside0X128;
    console.log('My Stacks: ' + myFees);
}
rkedia145
rkedia145

Hi @neptune-v and team, thank you so much for creating this tool! Quick question:

In the Events.ts script, the '// await saveEvents(EventType.SWAP, fromBlock, endBlock);' is commented out. Why is this? Is the script not yet ready to save swap events?

Nov
3
1 month ago
push

rkedia145 push rkedia145/defi_exploration

rkedia145
rkedia145

raw transactions + jupyer notebook

commit sha: 7591926aa366987672c8c1d4fa717e50f91adf08

push time in 1 month ago
Oct
31
1 month ago