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

An 5001/update amm sell #616

Merged
merged 10 commits into from
Jul 24, 2024
Merged

An 5001/update amm sell #616

merged 10 commits into from
Jul 24, 2024

Conversation

tarikceric
Copy link
Member

Use decoded instructions to create new nft_sales_amm_sell_decoded model

  • deprecate legacy model nft_sales_amm_sell and create view
  • use legacy model for sales before 2022-10-30 in gold fact_nft_sales because those txs cannot be decoded
  • add relationship test to decoded_instructions_combined
full refresh
1 of 1 OK created sql incremental model silver.nft_sales_amm_sell_decoded ...... [SUCCESS 1 in 929.20s]

incremental
1 of 1 OK created sql incremental model silver.nft_sales_amm_sell_decoded ...... [SUCCESS 244 in 21.26s]

 test
01:25:51  Finished running 18 tests, 11 hooks in 0 hours 0 minutes and 37.88 seconds (37.88s).
01:25:51  
01:25:51  Completed successfully
01:25:51  
01:25:51  Done. PASS=18 WARN=0 ERROR=0 SKIP=0 TOTAL=18

nft.fact_nft_sales incremental
1 of 1 OK created sql view model silver.nft_sales_amm_sell_view ................ [SUCCESS 1 in 1.64s]

Copy link
Contributor

@desmond-hui desmond-hui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting NULL sales_amount when I run the test on the full output

recent_date_filter: &recent_date_filter
      config:
        where: _inserted_timestamp >= '2020-01-01'
16:11:58  Completed with 1 error and 0 warnings:
16:11:58  
16:11:58  Failure in test not_null_silver__nft_sales_amm_sell_decoded_SALES_AMOUNT (models/silver/nfts/silver__nft_sales_amm_sell_decoded.yml)
16:11:58    Got 27 results, configured to fail if != 0
16:11:58  
16:11:58    compiled Code at target/compiled/solana_models/models/silver/nfts/silver__nft_sales_amm_sell_decoded.yml/not_null_silver__nft_sales_amm_sell_decoded_SALES_AMOUNT.sql
16:11:58  
16:11:58    See test failures:
  --------------------------------------------------------------------------------
  select * from SOLANA_DEV.not_null_silver.nft_sales_amm_sell_decoded_SALES_AMOUNT
  --------------------------------------------------------------------------------
16:11:58  
16:11:58  Done. PASS=17 WARN=0 ERROR=1 SKIP=0 TOTAL=18

Copy link
Contributor

@desmond-hui desmond-hui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depositSell
extDepositSell
mip1DepositSell
ocpDepositSell
solDepositBuy

What do these events do if they are not sales?

@tarikceric
Copy link
Member Author

depositSell
extDepositSell
mip1DepositSell
ocpDepositSell
solDepositBuy

What do these events do if they are not sales?

They're related to creation of liquidity pools and depositing NFTs into them (or depositing SOL into a buy-side liquidity pool for solDepositBuy). Don't completely understand how it works but those events don't seem to deal with the direct NFT sales.

@tarikceric
Copy link
Member Author

Getting NULL sales_amount when I run the test on the full output

recent_date_filter: &recent_date_filter
      config:
        where: _inserted_timestamp >= '2020-01-01'
16:11:58  Completed with 1 error and 0 warnings:
16:11:58  
16:11:58  Failure in test not_null_silver__nft_sales_amm_sell_decoded_SALES_AMOUNT (models/silver/nfts/silver__nft_sales_amm_sell_decoded.yml)
16:11:58    Got 27 results, configured to fail if != 0
16:11:58  
16:11:58    compiled Code at target/compiled/solana_models/models/silver/nfts/silver__nft_sales_amm_sell_decoded.yml/not_null_silver__nft_sales_amm_sell_decoded_SALES_AMOUNT.sql
16:11:58  
16:11:58    See test failures:
  --------------------------------------------------------------------------------
  select * from SOLANA_DEV.not_null_silver.nft_sales_amm_sell_decoded_SALES_AMOUNT
  --------------------------------------------------------------------------------
16:11:58  
16:11:58  Done. PASS=17 WARN=0 ERROR=1 SKIP=0 TOTAL=18

Good catch, didn't think about the filter. I added additional event_type in the ME logic, and the test on the complete dataset is passing:

19:55:21  Finished running 18 tests, 11 hooks in 0 hours 0 minutes and 41.24 seconds (41.24s).
19:55:21  
19:55:21  Completed successfully
19:55:21  
19:55:21  Done. PASS=18 WARN=0 ERROR=0 SKIP=0 TOTAL=18

'solMip1FulfillSell',
'solOcpFulfillSell'
) THEN silver.udf_get_account_pubkey_by_name(
'pool',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The seller is the NFT pool for coral cube?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vice versa for purchaser comment

decoded_instruction :accounts
)
ELSE silver.udf_get_account_pubkey_by_name(
'pool',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purchaser is the NFT pool for coral cube?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in these instances the 'pool' address is what recieves the NFT and has ownership, and also what sends payment so we ID that as technically the purchaser.

@tarikceric tarikceric merged commit 698b946 into main Jul 24, 2024
1 check passed
@tarikceric tarikceric deleted the an-5001/update_amm_sell branch September 23, 2024 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants