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

Should indexing logic require actual Sweep events at the aggregator level? #39

Closed
0xJurassicPunk opened this issue Sep 16, 2022 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@0xJurassicPunk
Copy link
Contributor

0xJurassicPunk commented Sep 16, 2022

Alternatives could be to use call traces or to use other marketplace events (e.g., Seaport, LR, Sudo) and build a logic using these sources of on-chain data.

@0xJurassicPunk 0xJurassicPunk added the question Further information is requested label Sep 16, 2022
@0xJurassicPunk
Copy link
Contributor Author

For now, the consensus is just to have a single event with the msg.sender in it if one trade or more is executed.

@rob-looksrare
Copy link

POC to get the function input parameters in java

    @Getter
    @AllArgsConstructor
    public static class TakerOrder extends DynamicStruct {
        Bool isOrderAsk;
        Address taker;
        Uint256 price;
        Uint256 tokenId;
        Uint256 minPercentageToAsk;
        DynamicBytes params;
    }

    @Getter
    @AllArgsConstructor
    public static class MakerOrder extends DynamicStruct {
        Bool isOrderAsk;
        Address signer;
        Address collection;
        Uint256 price;
        Uint256 tokenId;
        Uint256 amount;
        Address strategy;
        Address currency;
        Uint256 nonce;
        Uint256 startTime;
        Uint256 endTime;
        Uint256 minPercentageToAsk;
        DynamicBytes params;
        Uint8 v;
        Bytes32 r;
        Bytes32 s;
    }
    
    private static final org.web3j.abi.datatypes.Function MATCH_BID_WITH_TAKER_ASK =
            new org.web3j.abi.datatypes.Function("matchBidWithTakerAsk",
                    Collections.emptyList(),
                    Arrays.asList(
                            new TypeReference<TakerOrder>() {},
                            new TypeReference<MakerOrder>() {}
                    )
            );

    public void test() {
        EthTransaction ethTransaction = web3j.ethGetTransactionByHash("0x40a24bf63ade494c5ae34cfea7808305ab881c16cc92eee504f3cd916f940e23").send();
        Transaction transaction = ethTransaction.getResult();
        List<Type> types = FunctionReturnDecoder.decode(transaction.getInput().substring(10), MATCH_BID_WITH_TAKER_ASK.getOutputParameters());
    }

types array will contain the matchBidWithTakerAsk function input params as we can see here https://etherscan.io/tx/0x40a24bf63ade494c5ae34cfea7808305ab881c16cc92eee504f3cd916f940e23
image

@0xJurassicPunk
Copy link
Contributor Author

Does it impact the indexing performance? @rob-looksrare

@rob-looksrare
Copy link

Does it impact the indexing performance? @rob-looksrare

Based on gut feeling it does not impact the performance in a significant way, should be one extra call to rpc provider (did not do any tests regarding performance).

@0xJurassicPunk
Copy link
Contributor Author

Hmmm, let's stick to the current specs where there is one event from the aggregator then. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants