Inspiration

After reviewing sample projects for the Stacks 2.0 blockchain with smart contracts, we decided to build our own to help margin traders focus more on trading while automatically managing on-account margin limits and

What it does

This smart contract acts as a filter for transactions in and out of a margin trading account; based on a set margin and balance in the account (at a Stacks address), it will automatically approve or reject transactions to help traders keep track of their spending.

How we built it

The margin trading smart contract was built over 36 hours comprised of Stacks and Clarity tutorials and reviewing sample projects before building our own.

Challenges we ran into

We are all first-time hackathoners and most of us have not programmed in anything other than Python before, so learning Clarity was a huge step into the unknown! The syntax, which varied a lot from the languages that we were used to, took a lot of time to adjust to and learn. In addition, the Stacks testnet blockchain was down for the duration of this hackathon, so we couldn't formally test our smart contract, but we were able to built out our idea anyways despite this major obstacle to development.

Accomplishments that we're proud of

Despite the above challenges, we're proud to have finished our first hackathon product on time!

What we learned

Over the course of this project, we learned a lot about the Clarity language, creating smart contracts to handle logic and a bit more about how blockchains work.

What's next for Margin Trading FailSafe Smart Contract

We have ideas for adding in auto-enforced daily deposit/withdraw limits but did not have enough time to implement them with the other functionalities in this first 36-hour iteration.

Built With

Share this project:

Updates