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

How to fetch exchange rate in a contract? #17

Open
mmalmi opened this issue May 30, 2017 · 0 comments
Open

How to fetch exchange rate in a contract? #17

mmalmi opened this issue May 30, 2017 · 0 comments

Comments

@mmalmi
Copy link

mmalmi commented May 30, 2017

I've been sketching a margin trading addition to EtherDelta. This would allow users to lend their tokens for interest to traders who want to short sell.

Margin accounts are backed by collateral and can be liquidated by the creditor if the market value of collateral falls below a certain threshold. Do you have any ideas for fetching the exchange rate from, say, last 12 hours in a contract? Afaik, contracts cannot access the event log. Current order book depth would also help, but EtherDelta stores it mostly off-chain.

Incomplete and untested draft:
mmalmi@0eb1c33#diff-e438becd3bae07de17d35137485d8c3b

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

No branches or pull requests

1 participant